Skip to main content

Workflows Overview

A workflow defines the processing pipeline for a project: which activities run, in what order, and how they are configured. Every transaction in the project is processed by walking its workflow from the first activity to the last.

You design workflows visually in Project Settings → Workflow, where each activity is a node on a canvas. You can enable or disable nodes, reorder them, configure each one, and add branching.

The processing pipeline​

A typical document pipeline looks like this:

Import → OCR → Split → Classify → Extract → Validate → Human Review → Export

Each step consumes the output of the previous one:

StageWhat it produces
ImportNormalized page images from the uploaded files
OCRMachine-readable text (and optional barcodes) per page
SplitPage ranges grouped into documents
ClassifyA document class (type) for each document
ExtractStructured field values for each document
ValidateBusiness-rule results (warnings and errors)
Human ReviewA human decision (accept, reject, or redirect)
Agent ReviewAn agent's decision (accept, reject, or redirect), taken unattended by the built-in agent or by an agent on an integration key; the step fails, down its Failed exit, when no agent decides (Agent Review)
ExportOutput files (PDF, JSON, and more)

Not every project needs every stage. If your documents are already single-page and pre-classified, you can disable Split and Classify and go straight to Extract.

Activity categories​

Activities fall into two groups:

  • Processing activities do the document work: Import, OCR, Split, Classify, Extract, Validate, Transform, Human Review, Agent Review, Export, Notification.
  • Control-flow activities change the path through the workflow: If and Switch.

See the Activities section for one article per activity.

Enabling and disabling activities​

Turn a step on or off with the switch at the top of its settings panel. Import, If Condition and Switch are always on. A step that is off stays on the canvas, dimmed and marked Off, and is skipped when the workflow runs, so you can turn it back on without rebuilding it. This is the quickest way to trim a pipeline for a project that does not need a given stage, or to test the rest of a workflow without one step.

Turning off the OCR step leaves the pages without text. The steps that send OCR text to the model (Split, Classify, Extract and Redact) then show a warning, and so does a Translate step after it, which finds no words to translate. These are warnings: the workflow can still be published.

Steps are moving to the settings panel one at a time. Until a step has moved, Split, Classify and Extract are turned on and off with their Enable setting.

Branching​

Workflows are not limited to a straight line. Use control-flow activities to route transactions:

  • If Condition sends the transaction down a true or false branch based on a condition.
  • Switch routes to one of several named branches based on a value.
  • Human Review and Agent Review can expose accept, reject, and custom send-to exits that jump to other steps.

Branches let you, for example, send high-value invoices to human review while auto-approving the rest.

Every step must be reachable from a step before it. A step that no earlier step leads to can never run: for example, an If Condition whose only incoming connection comes from a Human Review after it. The workflow editor lists it as an error, together with the steps that wait for it, and the project cannot be published until you connect it from an earlier step or remove it. On the canvas the step gets a red outline, and the steps waiting for it a dashed grey one. A loop back to an earlier step through a review exit is fine, because the step it returns to already has a way in. If a published version has such a step, its transactions fail before processing starts, with the same error.

Any step an error or warning is about is marked on the canvas the same way: a red outline for an error, amber for a warning. Hover over the icon on the step to read its messages.

Handling failures​

By default, when an activity fails, the transaction fails and processing stops. You can decide differently per step: every activity except If, Switch, Human Review and Agent Review has an If the step fails choice in the Exits block of its settings panel. Agent Review has its own When no agent decides exit.

If the step failsWhat happens when the activity fails
Fail the transactionThe transaction fails and processing stops. This is how every activity behaves until you choose otherwise.
Go to another stepThe node shows a red Failed handle below its green Success handle. Connect it to the step a failure should go to: the step is still recorded as failed, and the transaction continues from there. Until it is connected, a failure still fails the transaction.
Continue with the next stepThe Failed exit is connected to the same step as Success, so the transaction goes on as if the step had succeeded, but the step is still recorded as failed. It needs exactly one next step. A Human Review step after it always pauses for a reviewer.

On a Redact step, Go to another step and Continue with the next step pass the pages and the data on unredacted when Redact fails. The workflow editor warns about such a step, and so does the check before publishing.

The continue_on_error field a workflow node could have through the API is deprecated. A step that has it runs as Continue with the next step, and its panel shows it so; once you pick a choice there, that choice is the step's setting.

The most useful target is a Human Review step. A transaction that hits a problem then reaches a person, along with everything that did process correctly, instead of stopping. A Human Review step reached through a Failed exit, directly or after other steps such as a Notification, always pauses for a reviewer, even when its policy would otherwise approve the transaction automatically. Some teams put a Notification step in front of the Human Review step so the failure also raises an alert.

Connect a failure exit to a step that only failures reach. An exit back to an earlier step, such as from Validate back to OCR, or to a step that runs anyway, is reported as an error. To have a document processed again, connect the failure exit to a Human Review step and connect the reviewer's decision back to the step to repeat. To return to a step the transaction has already passed, go through a Human Review step's decision; a plain connection from the failure branch back to such a step is reported as an error.

If several steps share one Human Review step for their failures, and after the reviewer sends the transaction on to a later step another of them fails, the transaction fails and says why. Sending the transaction back to the step that failed lets the Human Review take its next failure.

What counts as a failure​

The failure exit is for problems that will not resolve on their own:

  • A step that keeps failing on the content or the configuration, after its retries are used up.
  • A Transform script that deliberately calls fail().
  • A Classify pre- or post-classification rule that cannot run, for example because a regular expression in it does not compile.
  • A Validate business rule that cannot run, for example because it throws an error. Validation errors that rules report are not failures: they go to review.

It does not fire while the system is waiting. Pauses for model capacity, rate limits or a budget limit are not failures: the transaction waits and then carries on by itself. Retries always run first, so a step only takes the failure exit once it has genuinely given up. A licensing problem always fails the transaction, because nothing further can be processed.

Reading the result​

A routed failure is still a failure in the record. The step shows as failed with its error, the Activity Log names it and says where it was routed, and any document that could not be processed carries its own error. Nothing is quietly turned into a success.

Reading the Activity Log​

The transaction's Activity Log records each step as it runs, and says what the step did, not only that it finished:

  • Validate shows how many checks ran, how many passed, and how many warnings and errors the rules reported.
  • Human Review and Agent Review get an Issues to review entry when the transaction reaches them. It counts what they found by kind, for example "3 validation errors, 1 unconfirmed split", or says there was nothing to review. The decision that ends a review is a Review entry of its own, naming the exit taken.
  • A step that is turned off says so. It is passed over without running, so it is not a step that ran and found nothing.
  • A step with several exits, such as an If, a Switch, or a review step that passed on Approved without a review, names the exit taken.
  • A step that called a model lists, per model, its calls and its input, cached and output tokens, and how long its answers were against the length it asked for, for example "answer 13,656 of 65,536 tokens", or how many answers were cut at that length.
  • Each document's Classify and Extract entries also say how many pages of text and page images were sent to the model, out of the document's pages, and what that document's call used in tokens.

The settings panel​

Click a step on the canvas to open its settings panel on the right. Every step's panel has the same parts, so a person who has set up one step knows where to look on the next. The Import, OCR, Translate, Split, Classify, Extract, Validate, Transform, Redact, If, Switch and Export steps use this layout; the other steps move to it one at a time.

  • The header names the step (click the name to change it) and its type, and says whether the step can run: Ready, a number of warnings to check or errors to fix, Cannot run when it waits for another step that has an error, or Off. Hover over the status to see what it is about, as you would the workflow's count above the canvas, and click it to open the part of the panel the first one concerns. The switch beside it turns the step on or off.
  • Ask the assistant sets the step up from a sentence, or explains how it is set up. It stays folded once you fold it.
  • The blocks hold the settings, grouped by what they are about. A folded block shows a summary of its values: grey for a value a new step starts with, black for one that was changed. One block is open at a time; opening another folds it. A block whose settings cause a warning or an error reads Needs attention or Needs fixing; hover over its icon to read why. Settings that do not fit in the panel, such as a list of fields, open in a dialog, and the block shows what the dialog holds.
  • Exits, the last block, says where the transaction goes next and holds the failure exit.
  • The footer says whether your changes are saved, opens the step's settings as JSON (every setting, including those the panel has no control for), and shows the step's id, which you can copy for support or the API.

Where settings live​

Each step's panel holds that step's settings: its model, inputs, page limits, threshold, discovery and whether it is on. Two Extract steps can therefore run on different models, for example one for standard documents and one for hard ones behind a Switch.

The document classes, fields and guidelines belong to the project, and every step reads them. A step can use some of them only (the tick boxes in its settings dialog), or send its own text for one of them where another step reads it too, marked on the class or field, with Use the shared description to go back. See Project Settings.

A project upgraded from an earlier version moves its step settings onto its steps the first time it is changed; nothing about how its steps run changes.

How the engine runs a workflow​

The workflow engine:

  1. Picks up transactions from the job queue.
  2. Runs each enabled activity in order, following any branches.
  3. Tracks status and duration per activity.
  4. Retries transient failures (for example, a temporary model rate limit).
  5. Reports completion, or stops on a terminal failure, unless that step has a connected failure exit to follow.

Monitoring progress​

Open a transaction to watch its workflow. Each activity shows its status (pending, running, completed, or failed), its duration, and any error detail if it stopped. See Troubleshooting when a step fails.

Next steps​