Dex TypeScript SDK 1.30.0
    Preparing search index...

    Interface Step<Input>

    Defines one typed unit of durable Flow application logic.

    class Confirm implements Step<{ id: string }> {
    public getStepType(): string { return "Confirm"; }
    public waitFor(): Wait { return Wait.until(Timer.byDuration(1_000)); }
    public execute(_context: Context, input: { id: string }): StepDecision {
    return forceComplete(input);
    }
    }
    interface Step<Input> {
        execute: StepHandler<Input, StepDecision>;
        inputCodec?: Codec<Input>;
        waitFor?: StepHandler<
            Input,
            Readonly<
                {
                    combinations: readonly ConditionCombination[];
                    conditions: readonly Condition[];
                    kind: "skipImmediately"
                    | "allOf"
                    | "anyOf"
                    | "anyCombinationOf";
                },
            >,
        >;
        getStepOptions?(): StepOptions | undefined;
        getStepType(): string;
    }

    Type Parameters

    • Input

      Value passed by an incoming Step movement.

    Index

    Properties

    execute: StepHandler<Input, StepDecision>

    Runs application logic and produces the next durable decision. Async handlers that record heartbeats must accept AsyncContext and return a Promise.

    Current execution metadata and persistence operations.

    Decoded Step input.

    A StepDecision or promise resolving to one.

    inputCodec?: Codec<Input>

    Codec used for every incoming input value.

    Omit this for JSON objects. Scalar wire kinds still need stringCodec, booleanCodec, int64Codec, doubleCodec, or bytesCodec.

    waitFor?: StepHandler<
        Input,
        Readonly<
            {
                combinations: readonly ConditionCombination[];
                conditions: readonly Condition[];
                kind: "skipImmediately"
                | "allOf"
                | "anyOf"
                | "anyCombinationOf";
            },
        >,
    >

    Describes durable conditions required before execution. Async handlers that record heartbeats must accept AsyncContext and return a Promise.

    Current execution metadata and persistence operations.

    Decoded Step input.

    A Wait or promise resolving to one.

    Methods

    • Returns this Step's static options.

      Returns StepOptions | undefined

      Static options, or undefined for Flow and server defaults.

    • Returns the protocol Step type.

      Returns string

      A non-empty Step type unique within the containing Flow.