Skip to content

WorkflowEvent ​

Type, in @jr2/orchestrator/src/setup.ts. The signature of an export, or a type that it names, names this type. The Authoring surface page lists each export. This type is not an export of @jr2/orchestrator, so a workflow module does not import it by name.

ts
type WorkflowEvent<TDefs extends readonly EventDef[]> =
  | (EventFrom<TDefs[number]> & { readonly sender?: Sender })
  | MechanismEvent;

The type of event in a Machine that jr2Setup makes: each workflow event in its events, and each Mechanism event. A workflow event that an Agent or a Gate sent has event.sender. An event that the Machine sent to itself (raise, sendTo) has no sender.

Forms: it is one of these objects.

  • Form 1: type, sender

    • type: N
    • sender (optional): Sender
  • Form 2: type, instanceId, reason

    • type: "agent.fault"

    • instanceId: string

      The Instance ID of the Agent's conversation that failed: the same id on each Turn that continues it.

    • reason: string

      Why the Turn failed, as text for a person or a log: the Harness's error, or that the Agent ended its Turns without a pick after every nudge. Route on the event, not on this text.

  • Form 3: type, reason, message

    • type: "workspace.lost"

    • reason (optional): string

      Why the Sandbox is gone, for a person or a log: the pod's reason (Evicted, NodeShutdown), the operator's (PodDeleted, NodeLost), or Deleted. A body can act without it.

    • message (optional): string

      More text about the loss, when jr2 has it.

The docs of Kit version 0.5.1. Each page is also at its .md URL.