Workflows

Every document you send to Holofin is processed by a workflow: a configured sequence of steps that classify, segment and extract data from it. This page covers nodes, routing, and running a workflow through the API.

What are Workflows?

A workflow is a reusable document processing pipeline that you configure once and execute via a single API call. Instead of calling separate APIs for classification, segmentation, and extraction, you submit a document to a workflow and receive structured results.

A workflow can combine these steps:

  • Classification: identify the document type (bank statement, invoice, tax form)
  • Segmentation: split multi-document PDFs into individual documents
  • Extraction: pull structured data based on document type
  • Validation: optional human review gates for quality control

How Workflows Work

When you submit a document to a workflow, it flows through connected nodes. Each node performs a specific task and routes the document to the next step based on configurable conditions.

Document
Fraud Analysis
Classify
Segment
Extract
Results

A typical workflow: classify the document, segment if needed, extract structured data

Workflow Nodes

Each step in a workflow is called a node. Nodes are connected by edges that define the execution order and routing conditions.

Node TypePurposeExample
Fraud Analyzer
Runs forensic fraud analysis on the documentDetect tampering, metadata anomalies, suspicious edits
Classifier
Categorizes documents into typesIdentify as "Bank Statement" or "Invoice"
Segmenter
Splits multi-document packagesExtract individual forms from a tax package
Extractor
Extracts structured dataPull transactions from a bank statement
Human Review
Pauses for human approvalVerify low-confidence extractions

Conditional Routing

Workflows support branching logic to handle different scenarios. Connect nodes with conditional edges to route documents based on classification results, confidence scores, or other criteria.

Workflow branching logic example showing classifier routing to different paths
Condition TypeDescriptionUse Case
Classification matchRoute based on detected document typeSend invoices to invoice extractor, statements to statement extractor
Confidence thresholdRoute based on AI confidence scoreSend low-confidence results to human review
If/Else branchingSplit flow into multiple pathsProcess single-page vs multi-page documents differently
Default fallbackCatch-all when no conditions matchRoute unrecognized documents to manual processing

Configure routing in the workflow builder by clicking on edges between nodes and setting conditions. No code is required.

Executing a Workflow

To process a document, you create a workflow run via the API. The run tracks the execution state as your document moves through each node.

Create a workflow runPOST
curl -X POST https://app.holofin.ai/api/v1.1/workflow-runs/ \
  -H "X-API-Key: $HOLOFIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow_id": "wf_abc123",
    "document_b64": "JVBERi0xLjQK...",
    "document_name": "mydocument.pdf"
  }'

See the Workflow Runs API for complete documentation on request parameters, response format, and managing workflow executions.

Workflow Status

A workflow run progresses through these states:

pendingrunningcompleted

Runs may also be paused (waiting for approval), failed, or cancelled

Getting Results

Once a workflow run completes, you can retrieve the aggregated results from all extraction nodes:

Get workflow run resultsGET
curl https://app.holofin.ai/api/v1.1/workflow-runs/wr_def456 \
  -H "X-API-Key: $HOLOFIN_API_KEY"

See the Get Workflow Run API for complete response format and result structure.

Using Webhooks

Instead of polling for status, configure a webhook to receive notifications when a workflow run completes. The webhook payload includes the full extraction results.

Next Steps