Skip to content

Graphorin API reference v0.1.0


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

Function: createNode()

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

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

Construct a WorkflowNode. The wrapper exists to give the engine a stable shape and to keep createWorkflow({...}) callers from instantiating nodes by hand.

Type Parameters

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

Parameters

ParameterType
opts{ name: string; run: WorkflowNodeRun&lt;TState&gt;; }
opts.namestring
opts.runWorkflowNodeRun&lt;TState&gt;

Returns

WorkflowNode&lt;TState&gt;

Stable