Type Alias Eventstate

A workflow state that waits for one or more CloudEvents, then consumes them and invokes one or more actions sequentially or in parallel.

type Eventstate = {
    compensatedBy?: string;
    end?: tasks.End;
    exclusive?: boolean;
    name?: string;
    onEvents?: tasks.Onevents[];
    timeouts?: {
        actionExecTimeout?: tasks.ActionExecTimeout;
        eventTimeout?: tasks.EventTimeout;
        stateExecTimeout?: tasks.StateExecTimeout;
    };
    type?: "EVENT";
}
Index
compensatedBy?: string

The unique name of a workflow state responsible for compensating this state if it fails.

end?: tasks.End

Marks this state as a terminal state in the workflow.

exclusive?: boolean

When true, consuming any one of the defined events causes its associated actions to execute. When false, all defined events must be consumed before actions are performed.

name?: string

The name of this state, unique within the workflow.

onEvents?: tasks.Onevents[]

The events to consume and the optional actions to perform when they are received.

timeouts?: {
    actionExecTimeout?: tasks.ActionExecTimeout;
    eventTimeout?: tasks.EventTimeout;
    stateExecTimeout?: tasks.StateExecTimeout;
}

State-specific timeout durations.

Type Declaration

  • OptionalactionExecTimeout?: tasks.ActionExecTimeout

    The maximum duration for executing a single action, expressed as an ISO 8601 duration string or an expression that evaluates to one.

  • OptionaleventTimeout?: tasks.EventTimeout

    The maximum duration to wait for the defined events to be received, expressed as an ISO 8601 duration string or an expression that evaluates to one.

  • OptionalstateExecTimeout?: tasks.StateExecTimeout

    The maximum duration for executing this state, expressed as an ISO 8601 duration string or an expression that evaluates to one.

type?: "EVENT"

The state type. Must be EVENT for event-driven states.