Flow Studio
Timeout and Escalation
Configure a deadline for the approval. If consensus is not reached by the deadline, the engine takes one of three configurable actions: escalate to a senior actor, auto-decide, or fail the workflow.
Timeout Configuration Fields
| Field | Type | Example | Description |
|---|---|---|---|
timeoutDuration | ISO 8601 duration | PT4H, P1D, P3D | Time from suspension until timeout fires |
timeoutBehavior | enum | Escalate | What happens on timeout: Escalate / AutoApprove / AutoReject / Fail |
escalationActorId | string | user-ceo | Actor to reassign to on Escalate — required if behavior is Escalate |
Escalation Flow
1
HILTimeoutJob detects expired row
Background job scans Process_SuspendedExecutions for rows where ExpiresAt < UtcNow.
2
Escalation actor assigned
HILEscalationService creates a new HIL task for the escalationActorId. Remaining original tasks are cancelled. ExpiresAt is reset (escalation gets a fresh deadline).
3
Escalation actor decides
Escalation actor's decision is evaluated against the original strategy.
Auto-Decision on Timeout
// timeoutBehavior: "AutoApprove" — engine injects a synthetic Approved decision
// timeoutBehavior: "AutoReject" — engine injects a synthetic Rejected decision
// The synthetic decision is recorded in Process_ApprovalDecisions as:
{
"actorId" : "SYSTEM:AutoDecide",
"decision" : "Approved", // or Rejected
"comment" : "Auto-decided on timeout",
"decidedAt": "..."
}
Fail on Timeout
If timeoutBehavior = "Fail", the engine throws a HILTimeoutException, which causes the workflow to fail with a TimeoutError state. The rejected port is NOT used — the workflow fails entirely.
Timeout on the timeout port: If
timeoutBehavior = "Escalate" and the escalation actor also times out, the timeout port on the node fires. Connect the timeout port to a fallback node if you want to handle double-timeout gracefully.