Skip to content
Français

WorkflowResult

import type { WorkflowResult } from "@elie-laloum/outpost";
  • inputRequestsRequired
    readonly WorkflowInputRequest[]
    Immutable pending questions from tasks in waiting-input; empty when no human input is pending.
  • executionIdRequired
    string
    Identity of the workflow execution, preserved across checkpoint resumption.
  • nameRequired
    string
    Name of the workflow definition, included in its execution reports.
  • statusRequired
    "failed" | "done" | "cancelled" | "waiting-input" | "paused"
    Run outcome: done, paused (gate or quota), waiting-input, failed or cancelled. Precedence is cancelled, then failed, then waiting-input, then paused; an expired timeoutMs gives failed.
  • tasksRequired
    readonly Readonly<TaskRecord>[]
    One frozen record per task, in list order, with status, attempts, timestamps and error.
  • errorsRequired
    readonly unknown[]
    Errors that failed the run: task failures, gate rejections, budget errors and the abort or timeout reason.
  • observerErrorsRequired
    readonly unknown[]
    Exceptions thrown by telemetry and observe callbacks, collected independently without changing workflow status or task errors.
  • usageRequired
    WorkflowUsage
    Cumulative admitted attempts and observed token usage, including restored accounting.
  • valueRequired
    <T>(task: Task<T>) => T
    Return a task’s output from this run or its restored checkpoint; throws when the task has no done value.
  • unwrapRequired
    () => void
    Return when status is done; otherwise throw WorkflowFailure.
export interface WorkflowResult {
  readonly inputRequests: readonly WorkflowInputRequest[];
  readonly executionId: string;
  readonly name: string;
  readonly status: "done" | "failed" | "cancelled" | "paused" | "waiting-input";
  readonly tasks: readonly Readonly<TaskRecord>[];
  readonly errors: readonly unknown[];
  readonly observerErrors: readonly unknown[];
  readonly usage: WorkflowUsage;
  value<T>(task: Task<T>): T;
  unwrap(): void;
}