Dex TypeScript SDK 1.32.0
    Preparing search index...

    Interface StartFlowOptions

    Configures creation of a new Flow execution. All durations use milliseconds.

    To retry one logical start safely, for example after a lost response, set a stable requestId and ignoreAlreadyStarted: true together. Reuse the same values on every retry.

    const status = new Attribute("status", stringCodec);
    const options: StartFlowOptions = {
    timeoutMs: 30 * 60_000,
    idReusePolicy: IdReusePolicy.ALLOW_IF_NOT_RUNNING,
    attributes: [InitialAttribute.of(status, "queued")],
    configOverride: { activeStepSearchMode: ActiveStepSearchMode.ALL },
    };
    const runId = await client.startFlow(orderFlow, `order-${orderId}`, input, {
    ignoreAlreadyStarted: true,
    requestId: `start-order-${orderId}`,
    });
    interface StartFlowOptions {
        attributes?: readonly InitialAttribute<any>[];
        configOverride?: FlowConfig;
        idReusePolicy?: IdReusePolicy;
        ignoreAlreadyStarted?: boolean;
        requestId?: string;
        retryPolicy?: RetryPolicy;
        startDelayMs?: number;
        timeoutHandlerOptions?: FlowTimeoutHandlerOptions;
        timeoutMs?: number;
        timeoutPolicy?: FlowTimeoutPolicy;
    }
    Index

    Properties

    attributes?: readonly InitialAttribute<any>[]

    Initial Attribute writes applied atomically with Flow creation.

    configOverride?: FlowConfig

    Flow configuration applied over registered defaults.

    idReusePolicy?: IdReusePolicy

    Flow ID reuse policy; uses DEFAULT when omitted.

    ignoreAlreadyStarted?: boolean

    Returns the existing run instead of raising an already-started error.

    It applies only when requestId matches the request ID that started the existing run. A different or generated request ID still throws FlowAlreadyStartedError.

    requestId?: string

    Non-empty idempotency key; generates a UUID when omitted.

    A retried start returns the existing run only when ignoreAlreadyStarted is true and this request ID matches the request that started that run. Without that option, the retry throws FlowAlreadyStartedError even when the first attempt created the Flow. The match applies only when the ID reuse policy rejects the start. A policy that permits another run starts a new run instead. Dex compares only request IDs, not input or other options, so never reuse a request ID for a different logical start. See StartFlowOptions for an example that sets both options.

    retryPolicy?: RetryPolicy

    Optional Flow-level retry policy.

    startDelayMs?: number

    Delay before the starting Step becomes eligible, in milliseconds.

    timeoutHandlerOptions?: FlowTimeoutHandlerOptions

    Execution settings for Flow.handleTimeout; valid only with a positive handler-policy timeout.

    timeoutMs?: number

    Dex durable soft timeout in milliseconds; omitted or zero disables it.

    timeoutPolicy?: FlowTimeoutPolicy

    Action taken when a positive timeout expires; defaults from the Flow's hook.