Graphorin API reference v0.7.0
Graphorin API reference / @graphorin/workflow / / WorkflowConfig
Interface: WorkflowConfig<TState>
Defined in: packages/workflow/src/types.ts:280
Configuration accepted by createWorkflow. The shape is the single point of contact between a consumer's workflow definition and the runtime - every other public type derives from it.
Stable
Type Parameters
| Type Parameter | Default type |
|---|---|
TState extends object | Record<string, unknown> |
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
cancelGraceMs? | readonly | number | Grace window (in milliseconds) applied after AbortSignal.abort() before in-flight task promises are considered orphaned. Default: 100 ms. | packages/workflow/src/types.ts:314 |
channels | readonly | Readonly<{ [K in keyof TState]: Channel<TState[K]> }> | - | packages/workflow/src/types.ts:284 |
checkpointStore | readonly | CheckpointStore | - | packages/workflow/src/types.ts:288 |
durability? | readonly | DurabilityMode | Default durability mode. Defaults to sync. | packages/workflow/src/types.ts:290 |
edges | readonly | readonly WorkflowEdge<TState>[] | - | packages/workflow/src/types.ts:283 |
initialState? | readonly | Partial<TState> | Optional initial state - merged with the input on execute(...). | packages/workflow/src/types.ts:286 |
journalSteps? | readonly | boolean | Step-result journaling (D1 / workflow-04, opt-in). When true, the engine journals a step-intent record plus each completed task's channel writes against the PARENT checkpoint as tasks finish, so a crash between task completion and the step checkpoint no longer re-runs completed side effects: crash recovery replays the journaled writes and re-runs only the unfinished tasks. Default false (one extra store write per completed task when on). | packages/workflow/src/types.ts:353 |
maxConcurrentTasks? | readonly | number | Cap on tasks executing concurrently within one step (D1 / workflow-10). Planned tasks beyond the cap queue and start as slots free up; Dispatch fan-outs are bounded the same way. Absent ⇒ unbounded (the pre-D1 behaviour). | packages/workflow/src/types.ts:335 |
maxSteps? | readonly | number | Maximum number of execution steps before the engine bails out - an infinite-loop safeguard that surfaces as a structured error. W-122: counted PER INVOCATION of execute/resume/retry/tick - a durable thread that cycles through timers and approvals for months never trips it, and a capped-out invocation is retryable (retry starts a fresh counter). Default: 200. | packages/workflow/src/types.ts:301 |
maxTotalSteps? | readonly | number | W-122: opt-in LIFETIME quota over the cumulative step number across every invocation of the thread. Default: undefined (no lifetime cap). Fails with the same max-steps-exceeded code but a distinct message. | packages/workflow/src/types.ts:308 |
name | readonly | string | - | packages/workflow/src/types.ts:281 |
nodeDefaults? | readonly | { retry?: WorkflowNodeRetryPolicy; timeoutMs?: number; } | Default per-node execution policy (D1 / workflow-03), overridden by the same fields on an individual WorkflowNode. | packages/workflow/src/types.ts:325 |
nodeDefaults.retry? | readonly | WorkflowNodeRetryPolicy | - | packages/workflow/src/types.ts:327 |
nodeDefaults.timeoutMs? | readonly | number | - | packages/workflow/src/types.ts:326 |
nodes | readonly | Readonly<Record<string, WorkflowNode<TState>>> | - | packages/workflow/src/types.ts:282 |
pauseAt? | readonly | WorkflowPauseAt | - | packages/workflow/src/types.ts:287 |
tracer? | readonly | Tracer | Optional tracer; defaults to the framework's NOOP_TRACER. | packages/workflow/src/types.ts:292 |
validateState? | readonly | (state) => void | Optional state validator. When provided, the engine calls it after applying every step's writes; any thrown error produces a state-validation-failed workflow error and aborts the run. | packages/workflow/src/types.ts:320 |
version? | readonly | string | Workflow definition version pin (D1 / workflow-14). Stamped into every persisted frontier; a resume whose stored version differs fails loudly with workflow-version-mismatch (opt out per call via WorkflowResumeOptions.allowVersionMismatch). Absent ⇒ no pinning. | packages/workflow/src/types.ts:343 |