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
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Workflow name |
description | string | No | Optional description |
nodes | Node[] | Yes | At least one node; exactly one must be type="parse" |
edges | Edge[] | No | Directed edges; empty for parse-only workflows |
Parse Node
The entry-point node. Exactly one per workflow.| Field | Type | Default | Description |
|---|---|---|---|
id | string | — | Stable identifier (e.g. "parse_1") |
type | "parse" | — | Discriminator |
mode | "standard" | "agentic" | "standard" | Use "agentic" for per-block LLM routing through typed strategies (text/table/figure) |
prompt_hint | string | null | Domain hint shown to the parser (e.g. “medical lab report, preserve numerics exactly”) |
figure_enhancement | boolean | false | Extract structured descriptions of charts and images (extra LLM cost) |
Extract Node
Pulls structured fields from upstream parsed content.| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Stable identifier |
type | "extract" | Yes | Discriminator |
extraction_schema | object | Yes | { "fields": [...] } — at least one field |
use_images | boolean | No (default false) | Pass rendered page images to the extraction model |
Classify / Splitter Nodes
Branch routing nodes — see Field Types and the splitter cookbook recipes.Edges
| Field | Type | Required | Description |
|---|---|---|---|
source | string | Yes | Source node id |
target | string | Yes | Target node id |
branch | string | Conditional | Required when leaving a classify (category id) or splitter (rule id) node; forbidden otherwise |
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)
Topology Rules
The endpoint enforces graph correctness — if any rule is violated, the request returns400 and nothing is persisted.
| Rule | Message |
|---|---|
| Exactly one parse node | workflow must contain exactly one \parse` node` |
| Unique node ids | duplicate node ids: [...] |
| Edges reference existing nodes | edge source X not in nodes / edge target Y not in nodes |
| Edge predecessor compatibility | extract does not accept extract as predecessor |
| Branch routing | edge from classify X requires \branch` to be set` |
| No fan-out from non-routers | node Y (extract) has 3 outgoing edges; only classify and splitter may fan out |
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/settings. Send as Authorization: Bearer <key>.
Body
Public-surface workflow create body — typed graph of parse / classify / splitter / extract nodes.
Defined as a thin subclass so the FastAPI-generated OpenAPI components
entry is named WorkflowCreateRequest (FastAPI uses the model's
__name__). Behaviour is fully inherited from
WorkflowDefinition in anyformat.workflow.
1"Invoice or receipt"
1- ParseNode
- ClassifyNode
- SplitterNode
- ExtractNode
- ValidateNode
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.
