bunqueue v2.8 API referenceall versions · guide
bunqueue
    Preparing search index...

    Interface StepContext<TInput, TSteps>

    Context passed to step handlers

    interface StepContext<
        TInput = unknown,
        TSteps extends Record<string, unknown> = Record<string, unknown>,
    > {
        executionId: string;
        forwardIdempotencyKey?: string;
        idempotencyKey?: string;
        input: TInput;
        signal?: AbortSignal;
        signals: Readonly<Record<string, unknown>>;
        steps: Readonly<TSteps>;
    }

    Type Parameters

    • TInput = unknown
    • TSteps extends Record<string, unknown> = Record<string, unknown>
    Index
    executionId: string

    Current execution ID

    forwardIdempotencyKey?: string

    Compensation only: the key the FORWARD step used. When the forward outcome is in doubt, this is what lets a rollback ask the provider "did this actually happen?" instead of depending on an output that may never have been persisted.

    idempotencyKey?: string

    Idempotency key for THIS execution of the step. Stable across automatic retries and across crash-resume; different for a different run. Pass it straight to the provider so a repeat lands on the same operation instead of a new one.

    input: TInput

    Original workflow input

    signal?: AbortSignal

    Aborted when this handler attempt reaches its timeout.

    Handlers that support cooperative cancellation should pass this signal to downstream I/O so timed-out work does not continue after the workflow moves on.

    signals: Readonly<Record<string, unknown>>

    Signals received via engine.signal()

    steps: Readonly<TSteps>

    Results from completed steps (step name → result)