DispatchDefinition
Type, in @jr2/orchestrator/src/dispatch-effect.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.
type DispatchDefinition<S extends z.ZodObject | undefined = undefined> = {
input?: S;
wait?: boolean;
timeout?: Duration;
target?: { url: string; token: NamedSecret } | typeof open;
};The definition of a dispatch Effect (ADR-0071). Every field is optional.
Fields
input(optional):SA zod schema of the run input of the Workflow. It types the
inputof the invoke andfromPick, andjr2 upcompares it with the input that the Workflow declares. Without it, only the Workflow checks the input.wait(optional):booleantrue: end when the new run ends (settled).false, the default: end when the Orchestrator accepts the run (started).timeout(optional):DurationHow long the Effect waits: by default 30s for the start, and 10m with
wait.target(optional):{ url: string; token: NamedSecret; } | typeof openA different Orchestrator:
urlis its origin, andtokenis the secret that holds its Instance token. Oropen, which the composer binds withcustomize(<import>, { effects: { <slot>: { target: { url, token } } } }). Without it, the run starts in this Orchestrator.