Skip to content

Graphorin API reference v0.7.0


Graphorin API reference / @graphorin/workflow / node / createNode

Function: createNode()

ts
function createNode<TState>(opts): WorkflowNode<TState>;

Defined in: packages/workflow/src/node.ts:24

Construct a WorkflowNode. The wrapper exists to give the engine a stable shape and to keep createWorkflow({...}) callers from instantiating nodes by hand. Carries the optional per-node execution policy (D1 / workflow-03): timeoutMs + retry.

Type Parameters

Type ParameterDefault type
TState extends objectRecord&lt;string, unknown&gt;

Parameters

ParameterType
opts{ name: string; retry?: WorkflowNodeRetryPolicy; run: WorkflowNodeRun&lt;TState&gt;; timeoutMs?: number; }
opts.namestring
opts.retry?WorkflowNodeRetryPolicy
opts.runWorkflowNodeRun&lt;TState&gt;
opts.timeoutMs?number

Returns

WorkflowNode&lt;TState&gt;

Stable