Validation Step
Validation steps run one or more checks against data produced by earlier workflow steps. Use them to enforce required fields, compare values, assess whether extracted data is plausible, or send a run to a different downstream step when a check fails.
The Validation step described here replaces the legacy formula-based Rule Validation step for new workflows. Existing Rule Validation steps continue to work, but Composer chat does not create or edit them.
How validation works
A Validation step contains an ordered list of blocks. Every block is one of two types:
An unconfigured Validation step has no blocks and passes every run. A code or semantic execution error fails the step instead of treating the block as an ordinary invalid result.
Add and configure a Validation step
- Add a Validation node to the workflow and connect an upstream step to it.
- Connect the If All Valid and If Any Invalid outputs to their downstream steps. For example, send valid runs to a Webhook Response and invalid runs to Human Review.
- Select Configure on the node.
- Add a block, give it a descriptive name, and choose Code or Semantic.
- Use the Variables panel to browse or drag in data from upstream steps.
- Add more blocks as needed and drag them into the order you want. Changes save automatically.
The incoming connection controls when the Validation step runs. A block can reference any supported upstream output, even when that upstream step is not directly connected to the Validation node.
Code blocks
Code blocks run JavaScript in a sandbox with a read-only context object. The editor offers completion and type checking for the variables available at that point in the workflow.
For a single-file workflow, access upstream step data through context.outputs:
You can also read workflow-run metadata through context.metadata. Classification outputs expose label and confidence directly rather than under .value.
When a Validation step runs after a Collect step, context.outputs.<step> is an array with one entry for each file that ran that step. These arrays are not index-aligned with context.files, because routing may skip a step for some files. Use context.outputs.<step> for aggregate checks and context.files[i].outputs.<step> when you need to associate an output with a specific file. A step skipped for a file is undefined, so check for its presence or use optional chaining before reading its fields. The Variables panel reflects the correct shape for the current workflow.
Semantic blocks
Describe what must be true in natural language. Use semantic validation when the decision requires interpretation rather than an exact calculation.
For example:
Type {{ or drag a variable from the Variables panel to insert an upstream value. Variables inside the templates are formatted and queried using JMESPath; they are not the formulas used by legacy Rule Validation steps.
Build validations with Composer chat
Workflow Composer can add the Validation node, connect its pass and fail routes, inspect the fields available from upstream steps, and write or revise individual code and semantic blocks. It can also add, remove, and reorder blocks without replacing the rest of the step.

Be specific about the source step, the condition, and the desired routes. For example:
Composer uses the current workflow’s available variables rather than guessing field names. If the request does not say whether a new check should be deterministic or semantic, include that choice in your prompt.
Select Ask for approval to review the proposed diff before it changes the draft, or Edit automatically to apply changes as Composer works. You can review and undo workflow updates from the chat transcript.
See Composer chat for permissions, approval modes, and chat history.
View run results
Open a completed workflow run and select the Validation step. The result shows the overall pass or fail status, the number of code and semantic checks, and the status or reasoning for each evaluated block. If a code block errors, the run identifies the block that failed so you can inspect its configuration.

