Skip to content
Français

Workflow

import type { Workflow } from "@elie-laloum/outpost";
  • nameRequired
    string
    Name of the workflow definition, included in its execution reports.
  • tasksRequired
    readonly Task<unknown>[]
    Task definitions making up the graph, including every declared dependency.
  • startRequired
    (options?: WorkflowOptions) => Promise<WorkflowResult>
    Run the graph and resolve with a WorkflowResult once no task can run, even when tasks failed. Rejects on invalid options, a stale or invalid answer or decision, or a checkpoint that cannot be read or saved.
  • diagramRequired
    () => string
    Return a Mermaid diagram of task keys and dependency edges without executing tasks.
export interface Workflow {
  readonly name: string;
  readonly tasks: readonly Task[];
  start(options?: WorkflowOptions): Promise<WorkflowResult>;
  diagram(): string;
}