Skip to content
Français

WorkflowEvent

import type { WorkflowEvent } from "@elie-laloum/outpost";
  • executionIdRequired
    string
    Identity of the workflow execution, preserved across checkpoint resumption.
  • workflowRequired
    string
    Name of the workflow that emitted this event.
  • timestampRequired
    string
    ISO timestamp when the workflow event was emitted.
  • typeRequired
    "usage" | "quota" | "decision" | "retry" | "cache" | "input-request" | "input-answer" | "loop" | "start" | "task" | "attempt" | "finish" | "gate" | "checkpoint" | "resume" | "budget-exceeded"
    Event kind: start, resume, task, attempt, retry, usage, checkpoint, finish, budget-exceeded, gate, decision, loop, input-request, input-answer, quota or cache.
  • cacheOptional
    TaskCacheOutcome | undefined
    Task cache outcome on cache events: hit, miss (absent, expired or refresh mode), stored, or failed when the store or an entry was unusable.
  • errorOptional
    string | undefined
    Store or entry error message on failed cache events; the task continues without the cache.
  • resetAtOptional
    string | undefined
    Reported quota reset time on quota events, when the provider supplied one.
  • roundOptional
    number | undefined
    Logical round number on loop phase events.
  • phaseOptional
    "complete" | "attempt" | "check" | undefined
    Saved phase on loop events: attempt, check or complete.
  • keyOptional
    string | undefined
    Stable task key identifying the node within its workflow graph.
  • statusOptional
    TaskStatus | undefined
    Task status on task, quota and input events, or the run status on finish. On quota events, waiting means the task runs again in this start() call and paused means it stays paused.
  • attemptOptional
    number | undefined
    One-based task attempt number.
  • usageOptional
    Usage | undefined
    Reported usage counters; not a currency estimate.
  • durationMsOptional
    number | undefined
    Elapsed execution time in milliseconds.
  • delayMsOptional
    number | undefined
    Selected wait before the next task attempt, present on retry events and on quota events that wait for a reset in process; includes backoff, jitter and any valid server minimum for retries.
export interface WorkflowEvent {
  readonly executionId: string;
  readonly workflow: string;
  readonly timestamp: string;
  readonly type:
    | "cache"
    | "quota"
    | "input-request"
    | "input-answer"
    | "loop"
    | "start"
    | "task"
    | "attempt"
    | "retry"
    | "usage"
    | "finish"
    | "gate"
    | "decision"
    | "checkpoint"
    | "resume"
    | "budget-exceeded";
  readonly cache?: TaskCacheOutcome;
  readonly error?: string;
  readonly resetAt?: string;
  readonly round?: number;
  readonly phase?: "attempt" | "check" | "complete";
  readonly key?: string;
  readonly status?: TaskStatus;
  readonly attempt?: number;
  readonly usage?: Usage;
  readonly durationMs?: number;
  readonly delayMs?: number;
}