curl -X PUT 'https://api.anyformat.ai/v2/workflows/550e8400-e29b-41d4-a716-446655440000/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Invoice Processing",
"nodes": [
{"id": "parse_1", "type": "parse"},
{
"id": "extract_1",
"type": "extract",
"extraction_schema": {
"fields": [
{"name": "invoice_number", "description": "The unique invoice identifier", "data_type": "string"},
{"name": "total_amount", "description": "Total invoice amount including tax", "data_type": "float"}
]
}
}
],
"edges": [{"source": "parse_1", "target": "extract_1"}]
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Invoice Processing",
"description": null,
"created_at": "2024-03-24T12:00:00.000Z",
"updated_at": "2025-06-17T09:42:11.000Z",
"fields": [
{"name": "invoice_number", "description": "The unique invoice identifier", "data_type": "string"},
{"name": "total_amount", "description": "Total invoice amount including tax", "data_type": "float"}
]
}
Edit a Workflow
Replace a workflow’s typed graph in a single atomic transaction
curl -X PUT 'https://api.anyformat.ai/v2/workflows/550e8400-e29b-41d4-a716-446655440000/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Invoice Processing",
"nodes": [
{"id": "parse_1", "type": "parse"},
{
"id": "extract_1",
"type": "extract",
"extraction_schema": {
"fields": [
{"name": "invoice_number", "description": "The unique invoice identifier", "data_type": "string"},
{"name": "total_amount", "description": "Total invoice amount including tax", "data_type": "float"}
]
}
}
],
"edges": [{"source": "parse_1", "target": "extract_1"}]
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Invoice Processing",
"description": null,
"created_at": "2024-03-24T12:00:00.000Z",
"updated_at": "2025-06-17T09:42:11.000Z",
"fields": [
{"name": "invoice_number", "description": "The unique invoice identifier", "data_type": "string"},
{"name": "total_amount", "description": "Total invoice amount including tax", "data_type": "float"}
]
}
PUT /v2/workflows/{workflow_id}/ accepts the same typed graph shape as POST /v2/workflows/ and replaces the workflow’s definition atomically. Each call mints a new workflow version; earlier versions remain attached to past runs.
nodes and edges the new version should have. To change one field on a 60-field workflow, re-send the whole graph with that one field swapped.Recipe: change one field’s data type or options
The Python SDK builds the typed graph for you. The example below recreates a one-extract-node workflow and updates thecategory_taxonomy field to be an enum.
from anyformat import Client, Schema
client = Client(api_key="YOUR_API_KEY")
new_options = [
Schema.option("invoice", "Vendor bill or invoice"),
Schema.option("receipt", "Point-of-sale receipt"),
Schema.option("statement", "Account statement"),
]
(
client.workflow("Invoice Processing")
.parse()
.extract([
Schema.string("invoice_number", "The unique invoice identifier"),
Schema.float("total_amount", "Total invoice amount including tax"),
Schema.enum(
"category_taxonomy",
"Document category",
options=new_options,
),
# …the remaining fields, unchanged
])
.update("550e8400-e29b-41d4-a716-446655440000")
)
Request body
The body has the same shape asPOST /v2/workflows/: a typed graph of nodes and edges. The node types are parse, classify, splitter and extract.
| 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 between nodes |
curl -X PUT 'https://api.anyformat.ai/v2/workflows/550e8400-e29b-41d4-a716-446655440000/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Invoice Processing",
"nodes": [
{"id": "parse_1", "type": "parse"},
{
"id": "extract_1",
"type": "extract",
"extraction_schema": {
"fields": [
{"name": "invoice_number", "description": "The unique invoice identifier", "data_type": "string"},
{"name": "total_amount", "description": "Total invoice amount including tax", "data_type": "float"}
]
}
}
],
"edges": [{"source": "parse_1", "target": "extract_1"}]
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Invoice Processing",
"description": null,
"created_at": "2024-03-24T12:00:00.000Z",
"updated_at": "2025-06-17T09:42:11.000Z",
"fields": [
{"name": "invoice_number", "description": "The unique invoice identifier", "data_type": "string"},
{"name": "total_amount", "description": "Total invoice amount including tax", "data_type": "float"}
]
}
Authorizations
API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.
Path Parameters
Body
Public-surface workflow update body — full replacement of the typed graph.
Echo each existing field's persistent_id (from GET) unchanged —
including across renames — to keep the field's identity; omit it for
new fields. Restricts the node union to the public types (see
WorkflowCreateRequest). Call :meth:to_domain before forwarding to
the backend.
1"Invoice or receipt"
1- PublicParseNode
- ClassifyNode
- SplitterNode
- PublicExtractNode
- PublicValidateNode
- PublicIfElseNode
- PublicSlackAlertNode
- PublicEditNode
- KnowledgeNode
Show child attributes
Show child attributes
Show child attributes
Show child attributes
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.

