DispatchOutput
Type, in @jr2/orchestrator/src/effect.ts. It is an export of @jr2/orchestrator, on the Authoring surface page, in Effects.
ts
type DispatchOutput =
| { outcome: "started"; run: string }
| {
outcome: "settled";
run: string;
status: "done" | "failed" | "error" | "cancelled" | "lost" | "drifted" | "live";
output?: unknown;
}
| { outcome: "refused"; status: number; report: string[] }
| { outcome: "unreachable"; reason: string }
| Unknown;The output of a dispatch Effect. Route on outcome:
started: the Orchestrator accepted the new run.runis its id.settled: withwait, the new run ended.statusisdone,failed,error,cancelled,lostordrifted, andoutputis the output of its Machine. Forfailed,outputis the Failure,{ reason, detail? }.statusislivewhen the timeout came first, and the run continues.refused: the Orchestrator started no run.statusis the HTTP status: 400 for an input that the Workflow does not take, 404 for a Workflow that it does not have, 409 for a named Chart that cannot run now, 422 for a Chart that it refuses.reportholds the lines of the refusal.unreachable: the Orchestrator of the target did not answer. No run started.unknown: jr2 cannot tell if a run started.
Forms: it is one of these objects.
Form 1:
outcome,reasonoutcome:"unknown"reason:string
Form 2:
outcome,runoutcome:"started"run:string
Form 3:
outcome,run,status,outputoutcome:"settled"run:stringstatus:"done" | "failed" | "error" | "cancelled" | "lost" | "drifted" | "live"output(optional):unknown
Form 4:
outcome,status,reportoutcome:"refused"status:numberreport:string[]
Form 5:
outcome,reasonoutcome:"unreachable"reason:string
See also