Flow Studio
Synchronous Mode
Parent execution suspends until the child workflow completes — how the suspension/resume mechanism works and how child output flows back to the parent.
Execution Timeline
Parent: ──[A]──[B]──[SubWorkflow]──(suspended)────────────────[C]──[D]──▶
│ ▲
│ Starts child │ Resumes with child output
▼ │
Child: ──[X]──[Y]──[Z]──(complete)──────────────┘
The Suspension Mechanism
Synchronous mode uses the same HIL suspension mechanism as human-in-the-loop nodes. When the SubWorkflow executor calls _invoker.InvokeAsync() in sync mode:
- A new child execution is started with its own
ExecutionIdandParentExecutionIdlinking to the parent - The parent execution's
SubWorkflowNoderegisters a resume callback keyed to the childExecutionId - The parent execution transitions to
Suspendedstate — no more nodes run - The child runs independently (may itself include HIL steps, loops, etc.)
- When the child reaches its terminal state (
CompletedorFailed), the engine fires the registered callback - The parent resumes at the SubWorkflow node, which now returns with the child's output
Database-Backed Suspension
The suspension state is persisted to the database, so a server restart does not lose the pending parent. The parent execution record shows:
{
"executionId": "exec-100",
"status": "Suspended",
"suspendedAt": "2026-05-25T10:00:00Z",
"suspendReason": "AwaitingChildExecution",
"pendingChildExecutionId": "exec-101"
}
Timeout in Sync Mode
If the child does not complete within the configured timeout (seconds), the engine:
- Cancels the child execution (transitions it to
Cancelled) - Fires the
timeoutport on the SubWorkflow node in the parent - Resumes the parent with a timeout output:
{ timedOut: true, childExecutionId: "exec-101" }
Long-running children: If the child workflow includes HIL steps (human approvals, form submissions), the child may take hours or days. Set the timeout accordingly or use async mode if the parent does not need the result immediately.