start_execution

SFN.Client.start_execution(**kwargs)

Starts a state machine execution. If the given state machine Amazon Resource Name (ARN) is a qualified state machine ARN, it will fail with ValidationException.

A qualified state machine ARN refers to a Distributed Map state defined within a state machine. For example, the qualified state machine ARN arn:partition:states:region:account-id:stateMachine:stateMachineName/mapStateLabel refers to a Distributed Map state with a label mapStateLabel in the state machine named stateMachineName .

Note

StartExecution is idempotent for STANDARD workflows. For a STANDARD workflow, if StartExecution is called with the same name and input as a running execution, the call will succeed and return the same response as the original request. If the execution is closed or if the input is different, it will return a 400 ExecutionAlreadyExists error. Names can be reused after 90 days.

StartExecution is not idempotent for EXPRESS workflows.

See also: AWS API Documentation

Request Syntax

response = client.start_execution(
    stateMachineArn='string',
    name='string',
    input='string',
    traceHeader='string'
)
Parameters
  • stateMachineArn (string) --

    [REQUIRED]

    The Amazon Resource Name (ARN) of the state machine to execute.

  • name (string) --

    The name of the execution. This name must be unique for your Amazon Web Services account, region, and state machine for 90 days. For more information, see Limits Related to State Machine Executions in the Step Functions Developer Guide .

    A name must not contain:

    • white space
    • brackets < > { } [ ]
    • wildcard characters ? *
    • special characters " # % \ ^ | ~ ` $ & , ; : /
    • control characters ( U+0000-001F , U+007F-009F )

    To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _.

  • input (string) --

    The string that contains the JSON input data for the execution, for example:

    "input": "{\"first_name\" : \"test\"}"

    Note

    If you don't include any JSON input data, you still must include the two braces, for example: "input": "{}"

    Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

  • traceHeader (string) -- Passes the X-Ray trace header. The trace header can also be passed in the request payload.
Return type

dict

Returns

Response Syntax

{
    'executionArn': 'string',
    'startDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • executionArn (string) --

      The Amazon Resource Name (ARN) that identifies the execution.

    • startDate (datetime) --

      The date the execution is started.

Exceptions

  • SFN.Client.exceptions.ExecutionLimitExceeded
  • SFN.Client.exceptions.ExecutionAlreadyExists
  • SFN.Client.exceptions.InvalidArn
  • SFN.Client.exceptions.InvalidExecutionInput
  • SFN.Client.exceptions.InvalidName
  • SFN.Client.exceptions.StateMachineDoesNotExist
  • SFN.Client.exceptions.StateMachineDeleting
  • SFN.Client.exceptions.ValidationException