Skip to content
Français

definePauseTask

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

Define a gate task that holds the run once its dependencies are done until a listed actor submits resume or reject. It takes the same options and validation as defineApprovalTask(); resume makes the WorkflowDecisionRecord the gate’s value.

Complete example and detailed rules.

  • optionsRequired
    WorkflowGateOptions
    Gate key, dependencies, prompt, actors allowed to resume or reject, and the optional signed authentication.
  • options.authenticationOptional
    "signed" | undefined
    Set to signed to require a verified Ed25519 proof on every decision for this gate. Stored in the gate and in checkpoint identity.
  • options.keyRequired
    string
    Task key of the gate, unique in the workflow and named by each decision. Letters, digits, dot, underscore and hyphen, starting with a letter or digit.
  • options.afterOptional
    readonly Task<unknown>[] | undefined
    Tasks that must be done before the gate pauses. If one fails or is skipped, cancelled or rejected, the gate is skipped.
  • options.promptRequired
    string
    Question put to the actors, copied into the pending request. A blank prompt throws.
  • options.actorsRequired
    readonly string[]
    Names allowed to decide the gate: at least one, unique and nonblank. Outpost trusts the actor your application submits unless the gate is signed.

Task<WorkflowDecisionRecord>

export declare function definePauseTask(
  options: WorkflowGateOptions,
): Task<WorkflowDecisionRecord>;