Timeouts
Timeouts cap how long a workflow or individual step may run before the engine terminates with TimeoutEnforced traces and Timeout error code (HTTP 408 on server). Human-in-the-loop steps use a separate approval window via HitlConfig.timeout_seconds.
Control plane: Execution model. Works alongside Retry and backoff (retries consume time within the same timeout budget per engine rules).
Workflow timeout
Set on exec_config:
| Field | Scope |
|---|---|
workflow_timeout_secs | Entire run from start to terminal status |
step_timeout_secs | Each step execution ceiling |
Example server run:
Trace event: TimeoutEnforced
Workflow timeout
Step timeout
Terminal status: Failed with error_code: "Timeout".
HITL timeout
Attach to step:
Requires exec_config.recovery_enabled: true so interrupt state persists in Postgres.
When approver does not act within timeout_seconds:
- Run fails with
HumanTimeouterror code (HTTP 408) - Distinct from workflow/step execution timeouts
Approve flow (no timeout):
Reject:
Yields HumanRejected (HTTP 422).
Choosing limits
| Workload | Suggested starting point |
|---|---|
| Chat single agent | step_timeout_secs: 60-120 |
| Multi-step research | step_timeout_secs: 180, workflow_timeout_secs: 900 |
| HITL business approval | timeout_seconds: 86400 (24h) or policy-driven |
| Graph parallel branches | Workflow timeout covers longest parallel path |
Graph runs: Graph workflows. Join nodes wait for branches; workflow timeout applies to wall-clock elapsed time.
Interaction with retry
Retries extend step duration. If fail_times retries each approach step_timeout_secs, you may hit step timeout before RetryExhausted. Tune both in Validation and testing:
Provider timeouts
Provider HTTP clients may fail with ProviderError before ArcFlow step timeout fires. Traces show ProviderError vs TimeoutEnforced separately.
SDK usage
Python:
TypeScript equivalent on workflow.run() options object. See Python quickstart and TypeScript quickstart.
Cancellation vs timeout
ExecutionStatus::Cancelled is explicit abort. Timeout is engine-enforced failure with Timeout code. Recovery may persist state for both depending on when interruption occurred; see Recovery and resume.