Skip to content
Français

WorkflowBudgetExceeded

import { WorkflowBudgetExceeded } from "@elie-laloum/outpost";

Error recorded in WorkflowResult.errors when a budget limit is reached, which fails the run. An attempts limit cancels the tasks not yet started; a token limit also cancels running tasks.

Complete example and detailed rules.

  • dimensionRequired
    "input" | "cached" | "cacheCreated" | "output" | "attempts"
    Budget dimension whose admission limit was exceeded: attempts or a token counter.
  • limitRequired
    number
    Configured admission threshold for the exceeded budget dimension.
  • observedRequired
    number
    Current cumulative amount observed for the exceeded budget dimension.
  • nameRequired
    string
    Error class name used to distinguish this failure from other JavaScript errors.
  • messageRequired
    string
    Human-readable explanation of the failure.
  • stackOptional
    string | undefined
    JavaScript stack trace for the error, when available.
  • causeOptional
    unknown
    Underlying failure this error wraps; quotaFault() and unavailableFault() follow this chain.
export declare class WorkflowBudgetExceeded extends Error {
  readonly dimension: "attempts" | Exclude<keyof Usage, "complete">;
  readonly limit: number;
  readonly observed: number;
  constructor(
    dimension: "attempts" | Exclude<keyof Usage, "complete">,
    limit: number,
    observed: number,
  );
}