Skip to content

StartExecution

Source: src/AWS/StepFunctions/StartExecution.ts

Runtime binding for states:StartExecution.

Bind this operation to a StateMachine inside a function runtime to get a callable that starts asynchronous executions with the state machine ARN injected automatically.

Start a workflow execution

const startExecution = yield* StepFunctions.StartExecution(machine);
const execution = yield* startExecution({
input: JSON.stringify({ orderId: "123" }),
});
// execution.executionArn identifies the running workflow

Idempotent start via execution name

const execution = yield* startExecution({
name: `order-${orderId}`,
input: JSON.stringify({ orderId }),
});