Create Workflow
Create a workflow from a typed graph of parse / classify / splitter / extract nodes in a single atomic transaction
POST /v2/workflows/ creates a workflow from a strongly-typed graph. Use it to:
- Configure parse-node settings (standard or agentic mode, prompt hints, figure enhancement)
- Build parse-only workflows (no extract node — markdown only)
- Route documents through classifiers or splitters to multiple extract nodes
- Run simple linear
parse → extractworkflows
Request Body
Parse Node
The entry-point node. Exactly one per workflow.Extract Node
Pulls structured fields from upstream parsed content."source": "smart_lookup" to make it a smart-lookup field (resolved from a reference file rather than read from the document), or "source": "lookup_if_missing" to extract it too and let the lookup only fill empty slots; the default is "extraction".
Classify Node
Routes the document to one ofcategories[] based on an LLM verdict. Outgoing edges must set branch to a category id.
Category:
Splitter Node
Partitions a multi-document file into per-rule sub-documents. Each rule fires an outgoing edge whosebranch matches the rule id; the downstream extract node runs once per resulting partition.
Rule:
Validate Node
Runs after anextract node and emits per-rule validation results. Rules are either AI-evaluated (kind="ai" with a natural-language description) or deterministic (kind="deterministic" with a structured check evaluated in pure Python, no model call).
Rule:
check shapes (discriminated on type). Every shape below except expression names its field operands by persistent_id; expression addresses fields by extracted name instead.
subtotal + tax == total, ±1¢):
Edges
Examples
Linear parse → extract
Parse-only with agentic mode
A workflow with just oneparse node and no edges. Produces markdown only — no extraction.
mode: "agentic" and you get the full agentic pipeline. See the Agentic Parse to Markdown recipe for an end-to-end walkthrough.Classify-then-extract (branched)
Each outgoing edge from aclassify (or splitter) sets branch to a category/rule .id on the source node. .name is the display label shown to the LLM and is not accepted as a branch value — using it returns 400. In the example below, cat_invoice is the id used for routing; Invoice is the label the classifier sees.
Smart lookup
Enrich extracted values by matching them against a reference file instead of reading them off the page. Flag the looked-up field with"source": "smart_lookup", attach the reference file (inline as base64 via lookup_file_uploads, or by S3 URI via lookup_files), and optionally describe the join with lookup_suggestion. See Smart Lookup for how matching works and the Studio UI equivalent of these fields. Here the model reads vendor_name from the document, then resolves the canonical vendor_id from a vendor catalog:
lookup_file_uploads[].content is the base64-encoded bytes of the reference file (CSV/text). The lookup field (vendor_id) is returned alongside the extraction fields in the results payload — there is no separate response section for it. An extract node that has a source: smart_lookup/lookup_if_missing field but no reference file is rejected with 400.Topology Rules
The endpoint enforces graph correctness — if any rule is violated, the request returns400 and nothing is persisted.
Response
201 Created returns the workflow resource:
id — you’ll reuse it when uploading documents and fetching results.
Next Steps
Agentic Parse to Markdown
Parse-Only Workflow
Field Types
data_type values for extraction fieldsResponse Formats
parse, extractions, splits, and classifications on the results endpointAuthorizations
API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.
Body
Public-surface workflow create body — typed graph of parse / classify / splitter / extract / validate nodes.
A validate node carries rules; each rule is either AI-evaluated
(kind="ai" + a natural-language description) or deterministic
(kind="deterministic" + a structured check, evaluated in pure
Python with no model call).
Uses PublicNode (public request models with only the fields callers
may set); the domain AnyNode also carries filter (worker-only)
and executor-injected / staff-only fields, so the public bodies pin a
stricter node schema. Call :meth:to_domain before validating topology
or forwarding to the backend.
1"Invoice or receipt"
1- PublicParseNode
- ClassifyNode
- SplitterNode
- PublicExtractNode
- PublicValidateNode
- PublicIfElseNode
- PublicSlackAlertNode
Response
Successful Response
A workflow defines the extraction template — what fields to extract from documents, their types, and validation rules.
Unique identifier of the workflow (UUID).
"0686bb97-8c30-70f0-8000-97669e000eb8"
Human-readable name of the workflow.
"Invoice Processing"
Optional description of what this workflow extracts.
"A workflow for processing invoices and retrieving invoice details."
Timestamp when the workflow was created (ISO 8601).
Timestamp when the workflow was last modified (ISO 8601).
List of extraction field definitions configured for this workflow. null if not yet configured.
