Interface WorkflowInstance<W>
interface WorkflowInstance<W extends Workflow = Workflow> {
descriptor: WorkflowDescriptor;
initialData: ReadonlyMap<string, Value>;
journeyId: JourneyId;
workflow: W;
takeGlobalMetadata(): ReadonlyMap<string, Value>;
takeReporters(): readonly Reporter[];
}
descriptor: WorkflowDescriptor;
initialData: ReadonlyMap<string, Value>;
journeyId: JourneyId;
workflow: W;
takeGlobalMetadata(): ReadonlyMap<string, Value>;
takeReporters(): readonly Reporter[];
}
Type Parameters
Properties
Readonlydescriptor
How the workflow is described to the executor.
Readonlyinitial Data
The initial content of the data bag, as given.
Readonlyjourney Id
The journey ID, made when the instance was created.
Readonlyworkflow
The workflow object, which the descriptor's calls are given.
One instance of a workflow, for one journey: what the executor is given to run. It holds the workflow descriptor and the workflow object side by side, and what belongs to this journey alone.
Only
instance()on a workflow object makes one: an object written by hand, with the same members, is not a workflow instance and does not compile where one is expected, andrunrejects with aTypeErrorone that a cast lets through.