Skip to content

Graphorin API reference v0.7.0


Graphorin API reference / @graphorin/workflow / / Directive

Class: Directive<TUpdate, TResume>

Defined in: packages/core/dist/channels/directive.d.ts

Workflow control-flow primitive: a single value handed to Workflow.resume(threadId, directive?) (or returned from a node's pause(...) resolution) carrying any combination of:

  • goto - jump to a named node, bypassing the edge graph. Destructive (workflow-09): the restored frontier is discarded - surviving dynamic tasks, completed-but-unwalked nodes, and every pending pause record (including already-delivered pause answers) are dropped in favour of the single goto task. Use it as an operator escape hatch, not routine control flow.
  • resume - value supplied to the pause(value) call that suspended.
  • update - additional channel writes applied before the next step.

The shape is Graphorin's own design (the name Directive is part of the public API).

Stable

Type Parameters

Type ParameterDefault type
TUpdateRecord<string, unknown>
TResumeunknown

Constructors

Constructor

ts
new Directive<TUpdate, TResume>(opts): Directive<TUpdate, TResume>;

Defined in: packages/core/dist/channels/directive.d.ts

Parameters

ParameterType
optsDirectiveOptions&lt;TUpdate, TResume&gt;

Returns

Directive&lt;TUpdate, TResume&gt;

Properties

PropertyModifierTypeDefined in
goto?readonlystringpackages/core/dist/channels/directive.d.ts
resume?readonlyTResumepackages/core/dist/channels/directive.d.ts
update?readonlyTUpdatepackages/core/dist/channels/directive.d.ts