Pre-requisites
Run the following command to enable watsonx Orchestrate Developer Edition to process documents:BASH
Note:
You need to configure a minimum allocation of 20GB RAM to your Docker engine during installation of watsonx Orchestrate Developer edition to support document processing features.
Configuring document processing in flows
In your agentic workflow, include a call to thedocproc() method to process a document.
Supported arguments
Unique identifier for the node.
Specifies which information is extracted from the document upon processing; supported values are:
text_extraction: Extracts plain text from documents.
Display name for the node.
Description of the node.
Controls the output schema of the results. The possible values are:
DocProcOutputFormat.docref(“docref”): This is the default value.- Returns a URL reference to the stored extraction result
- Response type:
TextExtractionResponse - Best for documents that contain large amount of text or complex structures where the expected output is large.
DocProcOutputFormat.object(“object”):- Returns extraction results as an inline JSON object.
- Response type:
TextExtractionObjectResponse - Best for small documents or when the output of this node needs to flow into another node.
- When using this value, it is highly recommended to map all top-level output fields in
TextExtractionObjectResponseinto the input of downstream nodes or the flow output.
Define input mappings using a structured collection of Assignment objects.
Controls whether the output includes additional fields as part of the document assembly. Set to
true to include these fields.The key-value pair schemas used for extraction.
Enable the handwritten feature by setting this to
true.The LLM model used for key-value pair extraction. If no value is provided, the default WDU model is used. The default model is currently
watsonx/mistralai/mistral-small-3-1-24b-instruct-2503. The name of the model must match the list of models registered with your watsonx Orchestrate environment. To check the list of models, see List all LLMs.Compatible models must be able to process images as input and respond in JSON format. Examples include:watsonx/mistralai/mistral-small-3-1-24B-instruct-2503watsonx/mistralai/mistral-medium-2505watsonx/meta-llama/llama-4-maverick-17b-128e-instruct-fp8
The schema name used for KVP extraction. If not set or None, uses the default schema.
Enables text hints to assist with KVP extraction.
Using the docproc() method
The input to a docproc node uses the DocProcInput type from the ibm_watsonx_orchestrate.flow_builder.types module. You can optionally configure the kvp_schemas parameter to define key-value pair input schemas. For more information, see Semantic Key-Value Pair (KVP) Extraction.
Example use of the docproc node in a agentic workflow:
Python
Semantic Key-Value Pair (KVP) Extraction
Note:
KVP schemas are only available in the SaaS editions of DocProc.
kvp_schemas parameter in the text extraction task to extract semantic key-value pairs from input documents.
You can define this parameter in two places:
-
Node specification: Set
kvp_schemasin the node configuration. The node supports semantic KVP extraction in the following cases:- If you define
kvp_schemasin the input, the node uses those schemas. If you pass an empty array, it falls back to default schemas. - If you don’t define
kvp_schemasin the input but include them in the node specification, the node uses the specification-defined schemas. Again, if the array is empty, it defaults to the built-in schemas.
kvp_schemasis configured as a JSON object. The following example shows how to definekvp_schemasin a node configuration.Python - If you define
-
Runtime input: Set
kvp_schemasin the input payload. The following example shows how to define akvp_schemasin the input payload.Python
kvp_schemas is null. If you define the parameter in both places, the runtime input takes precedence and overrides the node specification. To use predefined extraction schemas, pass an empty array (kvp_schemas: []).
Use kvp_force_schema_name to specify the schema name for KVP extraction. Use kvp_enable_text_hints to enable or disable text hints during extraction. Configure both settings inside the docproc() node.
Python
Document processing with output format
See the following examples to learn how to use custom output formats with document processing:Python
Python

