Validation and testing
ArcFlow validates workflow definitions before execution and supports deterministic test mode for CI without live LLM calls. Validation catches schema errors, broken graph references, and missing agent ids early. Test mode simulates step outputs and controlled failures so you can verify retry, fallback, and trace shape cheaply.
Normative schema: workflow schema. Conceptual overview: Workflow specification.
Engine validation
Before a run starts, the engine calls:
| Function | Scope |
|---|---|
validate_workflow | Steps, agent references, mode consistency |
validate_graph | Nodes, edges, join_nodes, step_ref integrity (graph mode) |
Failure surfaces as WorkflowValidationFailed in trace and InvalidWorkflowDefinition error code (HTTP 400 on server).
Common failures:
- Step
agent_idnot present in run agents list - Graph
step_refpointing at missing step id - Join node
wait_forreferencing unknown node ids execution_mode: "graph"withoutgraphobject
CLI validate (CLI validate command)
Status: stub. Full schema validation in the CLI is deferred (CLI validate command, ). Today:
- Use JSON Schema validation in CI against
v1.schema.json - Rely on engine validation at run time
- Use
arcflow runwith test mode for integration checks
Do not document arcflow validate as production-complete until CLI validate command ships.
JSON Schema in CI
Example with a generic validator (adapt to your toolchain):
Validate both workflow and agent bundles before PUT registry publish. See Workflow registry.
Test mode (exec_config.test)
ExecutionConfig.test drives per-step mock behavior without calling providers.
| Field | Behavior |
|---|---|
output | Text returned when step succeeds |
fail_times | Number of attempts that fail before success |
then_output | Output after failures exhausted or on subsequent attempt per engine rules |
Use fail_times to exercise Retry and backoff traces (RetryAttempted, RetryExhausted). Combine with Step fallbacks to assert StepFallbackActivated.
Stub provider
For runs that still invoke the agent loop but need deterministic LLM behavior, set agent provider to stub:
Stub is for tests only. First workflow in five minutes uses stub by default.
Graph validation checklist
For Graph workflows:
- Every
step_refinnodesmatches a stepid entry_nodeexists innodes- All
edges.fromandedges.toreference valid node ids (orto: null) join_nodes[].wait_forlists nodes reachable on parallel pathsmax_iterationsis set to a sane bound
Test routing with test mode outputs that match edge conditions:
Server test run
Poll GET /v1/runs/{run_id}/trace and assert event kinds. Traces are trace data policy safe; see Trace data policy.
Recovery testing
Linear recovery with test mode:
Simulate interrupt mid-run, then resume per Recovery and resume. Graph checkpoint resume is partial (Graph recovery resume); do not treat graph resume tests as release gates until Graph recovery resume closes.
Verification matrix
| Goal | Mechanism | Expected trace |
|---|---|---|
| Happy path | output only | WorkflowCompleted |
| Retry | fail_times: 1, retry config | RetryAttempted |
| Fallback | primary fail + fallback_step_id | StepFallbackActivated |
| Invalid graph | bad step_ref | WorkflowValidationFailed |
| Timeout | low step_timeout_secs | TimeoutEnforced |
Related pages
- Linear workflows
- Graph workflows
- Maturity and known gaps (CLI validate command, Graph recovery resume)
- Install and build