Skip to content

Graphorin API reference v0.7.0


Graphorin API reference / @graphorin/workflow / / WorkflowNode

Interface: WorkflowNode<TState>

Defined in: packages/workflow/src/types.ts:168

Pure node contract. The runtime invokes run(state, ctx) exactly once per scheduled task; the return value is converted into channel writes by the engine.

Returning a single Dispatch or an array of dispatches schedules new tasks instead of writing to channels.

Stable

Type Parameters

Type ParameterDefault type
TState extends objectRecord<string, unknown>

Properties

PropertyModifierTypeDescriptionDefined in
namereadonlystring-packages/workflow/src/types.ts:169
retry?readonlyWorkflowNodeRetryPolicyPer-node bounded retry policy (D1 / workflow-03). Retries fire only for thrown failures - never for pause(...) suspensions or aborts - with exponential backoff. Overrides WorkflowConfig.nodeDefaults. Absent ⇒ no retries.packages/workflow/src/types.ts:184
runreadonlyWorkflowNodeRun<TState>-packages/workflow/src/types.ts:170
timeoutMs?readonlynumberPer-node wall-clock budget in milliseconds (D1 / workflow-03). When the body exceeds it, the task's ctx.signal aborts and the task fails with a node-timeout error. Overrides WorkflowConfig.nodeDefaults. Absent ⇒ no timeout.packages/workflow/src/types.ts:177