Skip to main content
PUT
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.
Today’s update is a full replacement — send the complete nodes and edges you want the new version to have, not a delta. To change one field on a 60-field workflow, re-send the full graph with that one field swapped. A round-trippable GET-then-PUT helper is on the SDK roadmap.

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 the category_taxonomy field to be an enum.
Python (anyformat SDK)

Request body

Same shape as POST /v2/workflows/ — a typed graph of nodes (parse / classify / splitter / extract) and edges.

Authorizations

Authorization
string
header
required

API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.

Path Parameters

workflow_id
string
required

Body

application/json

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 validating topology or forwarding to the backend.

name
string
required
Minimum string length: 1
Example:

"Invoice or receipt"

nodes
(PublicParseNode · object | ClassifyNode · object | SplitterNode · object | PublicExtractNode · object | PublicValidateNode · object | PublicIfElseNode · object)[]
required
Minimum array length: 1
description
string | null
default:""
edges
Edge · object[]

Response

Successful Response

A workflow defines the extraction template — what fields to extract from documents, their types, and validation rules.

id
string
required

Unique identifier of the workflow (UUID).

Example:

"0686bb97-8c30-70f0-8000-97669e000eb8"

name
string
required

Human-readable name of the workflow.

Example:

"Invoice Processing"

description
string | null

Optional description of what this workflow extracts.

Example:

"A workflow for processing invoices and retrieving invoice details."

created_at
string<date-time> | null

Timestamp when the workflow was created (ISO 8601).

updated_at
string<date-time> | null

Timestamp when the workflow was last modified (ISO 8601).

fields
Fields · object[] | null

List of extraction field definitions configured for this workflow. null if not yet configured.