AWS Step Functions

2023/11/14 - AWS Step Functions - 1 new 4 updated api methods

Changes  This release adds support to redrive executions in AWS Step Functions with a new RedriveExecution operation.

RedriveExecution (new) Link ¶

Restarts unsuccessful executions of Standard workflows that didn't complete successfully in the last 14 days. These include failed, aborted, or timed out executions. When you redrive an execution, it continues the failed execution from the unsuccessful step and uses the same input. Step Functions preserves the results and execution history of the successful steps, and doesn't rerun these steps when you redrive an execution. Redriven executions use the same state machine definition and execution ARN as the original execution attempt.

For workflows that include an Inline Map or Parallel state, RedriveExecution API action reschedules and redrives only the iterations and branches that failed or aborted.

To redrive a workflow that includes a Distributed Map state with failed child workflow executions, you must redrive the parent workflow . The parent workflow redrives all the unsuccessful states, including Distributed Map.

Note

This API action is not supported by EXPRESS state machines.

However, you can restart the unsuccessful executions of Express child workflows in a Distributed Map by redriving its Map Run. When you redrive a Map Run, the Express child workflows are rerun using the StartExecution API action. For more information, see Redriving Map Runs .

You can redrive executions if your original execution meets the following conditions:

  • The execution status isn't SUCCEEDED .

  • Your workflow execution has not exceeded the redrivable period of 14 days. Redrivable period refers to the time during which you can redrive a given execution. This period starts from the day a state machine completes its execution.

  • The workflow execution has not exceeded the maximum open time of one year. For more information about state machine quotas, see Quotas related to state machine executions .

  • The execution event history count is less than 24,999. Redriven executions append their event history to the existing event history. Make sure your workflow execution contains less than 24,999 events to accommodate the ExecutionRedriven history event and at least one other history event.

See also: AWS API Documentation

Request Syntax

client.redrive_execution(
    executionArn='string',
    clientToken='string'
)
type executionArn

string

param executionArn

[REQUIRED]

The Amazon Resource Name (ARN) of the execution to be redriven.

type clientToken

string

param clientToken

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don’t specify a client token, the Amazon Web Services SDK automatically generates a client token and uses it for the request to ensure idempotency. The API uses one of the last 10 client tokens provided.

This field is autopopulated if not provided.

rtype

dict

returns

Response Syntax

{
    'redriveDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • redriveDate (datetime) --

      The date the execution was last redriven.

DescribeExecution (updated) Link ¶
Changes (response)
{'redriveCount': 'integer',
 'redriveDate': 'timestamp',
 'redriveStatus': 'REDRIVABLE | NOT_REDRIVABLE | REDRIVABLE_BY_MAP_RUN',
 'redriveStatusReason': 'string',
 'status': {'PENDING_REDRIVE'}}

Provides information about a state machine execution, such as the state machine associated with the execution, the execution input and output, and relevant execution metadata. If you've redriven an execution, you can use this API action to return information about the redrives of that execution. In addition, you can use this API action to return the Map Run Amazon Resource Name (ARN) if the execution was dispatched by a Map Run.

If you specify a version or alias ARN when you call the StartExecution API action, DescribeExecution returns that ARN.

Note

This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.

Executions of an EXPRESS state machine aren't supported by DescribeExecution unless a Map Run dispatched them.

See also: AWS API Documentation

Request Syntax

client.describe_execution(
    executionArn='string'
)
type executionArn

string

param executionArn

[REQUIRED]

The Amazon Resource Name (ARN) of the execution to describe.

rtype

dict

returns

Response Syntax

{
    'executionArn': 'string',
    'stateMachineArn': 'string',
    'name': 'string',
    'status': 'RUNNING'|'SUCCEEDED'|'FAILED'|'TIMED_OUT'|'ABORTED'|'PENDING_REDRIVE',
    'startDate': datetime(2015, 1, 1),
    'stopDate': datetime(2015, 1, 1),
    'input': 'string',
    'inputDetails': {
        'included': True|False
    },
    'output': 'string',
    'outputDetails': {
        'included': True|False
    },
    'traceHeader': 'string',
    'mapRunArn': 'string',
    'error': 'string',
    'cause': 'string',
    'stateMachineVersionArn': 'string',
    'stateMachineAliasArn': 'string',
    'redriveCount': 123,
    'redriveDate': datetime(2015, 1, 1),
    'redriveStatus': 'REDRIVABLE'|'NOT_REDRIVABLE'|'REDRIVABLE_BY_MAP_RUN',
    'redriveStatusReason': 'string'
}

Response Structure

  • (dict) --

    • executionArn (string) --

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

    • stateMachineArn (string) --

      The Amazon Resource Name (ARN) of the executed stated machine.

    • name (string) --

      The name of the execution.

      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 _.

    • status (string) --

      The current status of the execution.

    • startDate (datetime) --

      The date the execution is started.

    • stopDate (datetime) --

      If the execution ended, the date the execution stopped.

    • input (string) --

      The string that contains the JSON input data of the execution. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

    • inputDetails (dict) --

      Provides details about execution input or output.

      • included (boolean) --

        Indicates whether input or output was included in the response. Always true for API calls.

    • output (string) --

      The JSON output data of the execution. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

      Note

      This field is set only if the execution succeeds. If the execution fails, this field is null.

    • outputDetails (dict) --

      Provides details about execution input or output.

      • included (boolean) --

        Indicates whether input or output was included in the response. Always true for API calls.

    • traceHeader (string) --

      The X-Ray trace header that was passed to the execution.

    • mapRunArn (string) --

      The Amazon Resource Name (ARN) that identifies a Map Run, which dispatched this execution.

    • error (string) --

      The error string if the state machine execution failed.

    • cause (string) --

      The cause string if the state machine execution failed.

    • stateMachineVersionArn (string) --

      The Amazon Resource Name (ARN) of the state machine version associated with the execution. The version ARN is a combination of state machine ARN and the version number separated by a colon (:). For example, stateMachineARN:1 .

      If you start an execution from a StartExecution request without specifying a state machine version or alias ARN, Step Functions returns a null value.

    • stateMachineAliasArn (string) --

      The Amazon Resource Name (ARN) of the state machine alias associated with the execution. The alias ARN is a combination of state machine ARN and the alias name separated by a colon (:). For example, stateMachineARN:PROD .

      If you start an execution from a StartExecution request with a state machine version ARN, this field will be null.

    • redriveCount (integer) --

      The number of times you've redriven an execution. If you have not yet redriven an execution, the redriveCount is 0. This count is not updated for redrives that failed to start or are pending to be redriven.

    • redriveDate (datetime) --

      The date the execution was last redriven. If you have not yet redriven an execution, the redriveDate is null.

      The redriveDate is unavailable if you redrive a Map Run that starts child workflow executions of type EXPRESS .

    • redriveStatus (string) --

      Indicates whether or not an execution can be redriven at a given point in time.

      • For executions of type STANDARD , redriveStatus is NOT_REDRIVABLE if calling the RedriveExecution API action would return the ExecutionNotRedrivable error.

      • For a Distributed Map that includes child workflows of type STANDARD , redriveStatus indicates whether or not the Map Run can redrive child workflow executions.

      • For a Distributed Map that includes child workflows of type EXPRESS , redriveStatus indicates whether or not the Map Run can redrive child workflow executions. You can redrive failed or timed out EXPRESS workflows only if they're a part of a Map Run. When you redrive the Map Run, these workflows are restarted using the StartExecution API action.

    • redriveStatusReason (string) --

      When redriveStatus is NOT_REDRIVABLE , redriveStatusReason specifies the reason why an execution cannot be redriven.

      • For executions of type STANDARD , or for a Distributed Map that includes child workflows of type STANDARD , redriveStatusReason can include one of the following reasons:

        • State machine is in DELETING status .

        • Execution is RUNNING and cannot be redriven .

        • Execution is SUCCEEDED and cannot be redriven .

        • Execution was started before the launch of RedriveExecution .

        • Execution history event limit exceeded .

        • Execution has exceeded the max execution time .

        • Execution redrivable period exceeded .

      • For a Distributed Map that includes child workflows of type EXPRESS , redriveStatusReason is only returned if the child workflows are not redrivable. This happens when the child workflow executions have completed successfully.

DescribeMapRun (updated) Link ¶
Changes (response)
{'executionCounts': {'failuresNotRedrivable': 'long', 'pendingRedrive': 'long'},
 'itemCounts': {'failuresNotRedrivable': 'long', 'pendingRedrive': 'long'},
 'redriveCount': 'integer',
 'redriveDate': 'timestamp'}

Provides information about a Map Run's configuration, progress, and results. If you've redriven a Map Run, this API action also returns information about the redrives of that Map Run. For more information, see Examining Map Run in the Step Functions Developer Guide .

See also: AWS API Documentation

Request Syntax

client.describe_map_run(
    mapRunArn='string'
)
type mapRunArn

string

param mapRunArn

[REQUIRED]

The Amazon Resource Name (ARN) that identifies a Map Run.

rtype

dict

returns

Response Syntax

{
    'mapRunArn': 'string',
    'executionArn': 'string',
    'status': 'RUNNING'|'SUCCEEDED'|'FAILED'|'ABORTED',
    'startDate': datetime(2015, 1, 1),
    'stopDate': datetime(2015, 1, 1),
    'maxConcurrency': 123,
    'toleratedFailurePercentage': ...,
    'toleratedFailureCount': 123,
    'itemCounts': {
        'pending': 123,
        'running': 123,
        'succeeded': 123,
        'failed': 123,
        'timedOut': 123,
        'aborted': 123,
        'total': 123,
        'resultsWritten': 123,
        'failuresNotRedrivable': 123,
        'pendingRedrive': 123
    },
    'executionCounts': {
        'pending': 123,
        'running': 123,
        'succeeded': 123,
        'failed': 123,
        'timedOut': 123,
        'aborted': 123,
        'total': 123,
        'resultsWritten': 123,
        'failuresNotRedrivable': 123,
        'pendingRedrive': 123
    },
    'redriveCount': 123,
    'redriveDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • mapRunArn (string) --

      The Amazon Resource Name (ARN) that identifies a Map Run.

    • executionArn (string) --

      The Amazon Resource Name (ARN) that identifies the execution in which the Map Run was started.

    • status (string) --

      The current status of the Map Run.

    • startDate (datetime) --

      The date when the Map Run was started.

    • stopDate (datetime) --

      The date when the Map Run was stopped.

    • maxConcurrency (integer) --

      The maximum number of child workflow executions configured to run in parallel for the Map Run at the same time.

    • toleratedFailurePercentage (float) --

      The maximum percentage of failed child workflow executions before the Map Run fails.

    • toleratedFailureCount (integer) --

      The maximum number of failed child workflow executions before the Map Run fails.

    • itemCounts (dict) --

      A JSON object that contains information about the total number of items, and the item count for each processing status, such as pending and failed .

      • pending (integer) --

        The total number of items to process in child workflow executions that haven't started running yet.

      • running (integer) --

        The total number of items being processed in child workflow executions that are currently in-progress.

      • succeeded (integer) --

        The total number of items processed in child workflow executions that have completed successfully.

      • failed (integer) --

        The total number of items processed in child workflow executions that have failed.

      • timedOut (integer) --

        The total number of items processed in child workflow executions that have timed out.

      • aborted (integer) --

        The total number of items processed in child workflow executions that were either stopped by the user or by Step Functions, because the Map Run failed.

      • total (integer) --

        The total number of items processed in all the child workflow executions started by a Map Run.

      • resultsWritten (integer) --

        Returns the count of items whose results were written by ResultWriter . For more information, see ResultWriter in the Step Functions Developer Guide .

      • failuresNotRedrivable (integer) --

        The number of FAILED , ABORTED , or TIMED_OUT items in child workflow executions that cannot be redriven because the execution status of those child workflows is terminal. For example, if your execution event history contains 25,000 entries, or the toleratedFailureCount or toleratedFailurePercentage for the Distributed Map has exceeded.

      • pendingRedrive (integer) --

        The number of unsuccessful items in child workflow executions currently waiting to be redriven.

    • executionCounts (dict) --

      A JSON object that contains information about the total number of child workflow executions for the Map Run, and the count of child workflow executions for each status, such as failed and succeeded .

      • pending (integer) --

        The total number of child workflow executions that were started by a Map Run, but haven't started executing yet.

      • running (integer) --

        The total number of child workflow executions that were started by a Map Run and are currently in-progress.

      • succeeded (integer) --

        The total number of child workflow executions that were started by a Map Run and have completed successfully.

      • failed (integer) --

        The total number of child workflow executions that were started by a Map Run, but have failed.

      • timedOut (integer) --

        The total number of child workflow executions that were started by a Map Run and have timed out.

      • aborted (integer) --

        The total number of child workflow executions that were started by a Map Run and were running, but were either stopped by the user or by Step Functions because the Map Run failed.

      • total (integer) --

        The total number of child workflow executions that were started by a Map Run.

      • resultsWritten (integer) --

        Returns the count of child workflow executions whose results were written by ResultWriter . For more information, see ResultWriter in the Step Functions Developer Guide .

      • failuresNotRedrivable (integer) --

        The number of FAILED , ABORTED , or TIMED_OUT child workflow executions that cannot be redriven because their execution status is terminal. For example, if your execution event history contains 25,000 entries, or the toleratedFailureCount or toleratedFailurePercentage for the Distributed Map has exceeded.

      • pendingRedrive (integer) --

        The number of unsuccessful child workflow executions currently waiting to be redriven. The status of these child workflow executions could be FAILED , ABORTED , or TIMED_OUT in the original execution attempt or a previous redrive attempt.

    • redriveCount (integer) --

      The number of times you've redriven a Map Run. If you have not yet redriven a Map Run, the redriveCount is 0. This count is not updated for redrives that failed to start or are pending to be redriven.

    • redriveDate (datetime) --

      The date a Map Run was last redriven. If you have not yet redriven a Map Run, the redriveDate is null.

GetExecutionHistory (updated) Link ¶
Changes (response)
{'events': {'executionRedrivenEventDetails': {'redriveCount': 'integer'},
            'mapRunRedrivenEventDetails': {'mapRunArn': 'string',
                                           'redriveCount': 'integer'},
            'type': {'ExecutionRedriven', 'MapRunRedriven'}}}

Returns the history of the specified execution as a list of events. By default, the results are returned in ascending order of the timeStamp of the events. Use the reverseOrder parameter to get the latest events first.

If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

This API action is not supported by EXPRESS state machines.

See also: AWS API Documentation

Request Syntax

client.get_execution_history(
    executionArn='string',
    maxResults=123,
    reverseOrder=True|False,
    nextToken='string',
    includeExecutionData=True|False
)
type executionArn

string

param executionArn

[REQUIRED]

The Amazon Resource Name (ARN) of the execution.

type maxResults

integer

param maxResults

The maximum number of results that are returned per call. You can use nextToken to obtain further pages of results. The default is 100 and the maximum allowed page size is 1000. A value of 0 uses the default.

This is only an upper limit. The actual number of results returned per call might be fewer than the specified maximum.

type reverseOrder

boolean

param reverseOrder

Lists events in descending order of their timeStamp .

type nextToken

string

param nextToken

If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

type includeExecutionData

boolean

param includeExecutionData

You can select whether execution data (input or output of a history event) is returned. The default is true .

rtype

dict

returns

Response Syntax

{
    'events': [
        {
            'timestamp': datetime(2015, 1, 1),
            'type': 'ActivityFailed'|'ActivityScheduled'|'ActivityScheduleFailed'|'ActivityStarted'|'ActivitySucceeded'|'ActivityTimedOut'|'ChoiceStateEntered'|'ChoiceStateExited'|'ExecutionAborted'|'ExecutionFailed'|'ExecutionStarted'|'ExecutionSucceeded'|'ExecutionTimedOut'|'FailStateEntered'|'LambdaFunctionFailed'|'LambdaFunctionScheduled'|'LambdaFunctionScheduleFailed'|'LambdaFunctionStarted'|'LambdaFunctionStartFailed'|'LambdaFunctionSucceeded'|'LambdaFunctionTimedOut'|'MapIterationAborted'|'MapIterationFailed'|'MapIterationStarted'|'MapIterationSucceeded'|'MapStateAborted'|'MapStateEntered'|'MapStateExited'|'MapStateFailed'|'MapStateStarted'|'MapStateSucceeded'|'ParallelStateAborted'|'ParallelStateEntered'|'ParallelStateExited'|'ParallelStateFailed'|'ParallelStateStarted'|'ParallelStateSucceeded'|'PassStateEntered'|'PassStateExited'|'SucceedStateEntered'|'SucceedStateExited'|'TaskFailed'|'TaskScheduled'|'TaskStarted'|'TaskStartFailed'|'TaskStateAborted'|'TaskStateEntered'|'TaskStateExited'|'TaskSubmitFailed'|'TaskSubmitted'|'TaskSucceeded'|'TaskTimedOut'|'WaitStateAborted'|'WaitStateEntered'|'WaitStateExited'|'MapRunAborted'|'MapRunFailed'|'MapRunStarted'|'MapRunSucceeded'|'ExecutionRedriven'|'MapRunRedriven',
            'id': 123,
            'previousEventId': 123,
            'activityFailedEventDetails': {
                'error': 'string',
                'cause': 'string'
            },
            'activityScheduleFailedEventDetails': {
                'error': 'string',
                'cause': 'string'
            },
            'activityScheduledEventDetails': {
                'resource': 'string',
                'input': 'string',
                'inputDetails': {
                    'truncated': True|False
                },
                'timeoutInSeconds': 123,
                'heartbeatInSeconds': 123
            },
            'activityStartedEventDetails': {
                'workerName': 'string'
            },
            'activitySucceededEventDetails': {
                'output': 'string',
                'outputDetails': {
                    'truncated': True|False
                }
            },
            'activityTimedOutEventDetails': {
                'error': 'string',
                'cause': 'string'
            },
            'taskFailedEventDetails': {
                'resourceType': 'string',
                'resource': 'string',
                'error': 'string',
                'cause': 'string'
            },
            'taskScheduledEventDetails': {
                'resourceType': 'string',
                'resource': 'string',
                'region': 'string',
                'parameters': 'string',
                'timeoutInSeconds': 123,
                'heartbeatInSeconds': 123,
                'taskCredentials': {
                    'roleArn': 'string'
                }
            },
            'taskStartFailedEventDetails': {
                'resourceType': 'string',
                'resource': 'string',
                'error': 'string',
                'cause': 'string'
            },
            'taskStartedEventDetails': {
                'resourceType': 'string',
                'resource': 'string'
            },
            'taskSubmitFailedEventDetails': {
                'resourceType': 'string',
                'resource': 'string',
                'error': 'string',
                'cause': 'string'
            },
            'taskSubmittedEventDetails': {
                'resourceType': 'string',
                'resource': 'string',
                'output': 'string',
                'outputDetails': {
                    'truncated': True|False
                }
            },
            'taskSucceededEventDetails': {
                'resourceType': 'string',
                'resource': 'string',
                'output': 'string',
                'outputDetails': {
                    'truncated': True|False
                }
            },
            'taskTimedOutEventDetails': {
                'resourceType': 'string',
                'resource': 'string',
                'error': 'string',
                'cause': 'string'
            },
            'executionFailedEventDetails': {
                'error': 'string',
                'cause': 'string'
            },
            'executionStartedEventDetails': {
                'input': 'string',
                'inputDetails': {
                    'truncated': True|False
                },
                'roleArn': 'string',
                'stateMachineAliasArn': 'string',
                'stateMachineVersionArn': 'string'
            },
            'executionSucceededEventDetails': {
                'output': 'string',
                'outputDetails': {
                    'truncated': True|False
                }
            },
            'executionAbortedEventDetails': {
                'error': 'string',
                'cause': 'string'
            },
            'executionTimedOutEventDetails': {
                'error': 'string',
                'cause': 'string'
            },
            'executionRedrivenEventDetails': {
                'redriveCount': 123
            },
            'mapStateStartedEventDetails': {
                'length': 123
            },
            'mapIterationStartedEventDetails': {
                'name': 'string',
                'index': 123
            },
            'mapIterationSucceededEventDetails': {
                'name': 'string',
                'index': 123
            },
            'mapIterationFailedEventDetails': {
                'name': 'string',
                'index': 123
            },
            'mapIterationAbortedEventDetails': {
                'name': 'string',
                'index': 123
            },
            'lambdaFunctionFailedEventDetails': {
                'error': 'string',
                'cause': 'string'
            },
            'lambdaFunctionScheduleFailedEventDetails': {
                'error': 'string',
                'cause': 'string'
            },
            'lambdaFunctionScheduledEventDetails': {
                'resource': 'string',
                'input': 'string',
                'inputDetails': {
                    'truncated': True|False
                },
                'timeoutInSeconds': 123,
                'taskCredentials': {
                    'roleArn': 'string'
                }
            },
            'lambdaFunctionStartFailedEventDetails': {
                'error': 'string',
                'cause': 'string'
            },
            'lambdaFunctionSucceededEventDetails': {
                'output': 'string',
                'outputDetails': {
                    'truncated': True|False
                }
            },
            'lambdaFunctionTimedOutEventDetails': {
                'error': 'string',
                'cause': 'string'
            },
            'stateEnteredEventDetails': {
                'name': 'string',
                'input': 'string',
                'inputDetails': {
                    'truncated': True|False
                }
            },
            'stateExitedEventDetails': {
                'name': 'string',
                'output': 'string',
                'outputDetails': {
                    'truncated': True|False
                }
            },
            'mapRunStartedEventDetails': {
                'mapRunArn': 'string'
            },
            'mapRunFailedEventDetails': {
                'error': 'string',
                'cause': 'string'
            },
            'mapRunRedrivenEventDetails': {
                'mapRunArn': 'string',
                'redriveCount': 123
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • events (list) --

      The list of events that occurred in the execution.

      • (dict) --

        Contains details about the events of an execution.

        • timestamp (datetime) --

          The date and time the event occurred.

        • type (string) --

          The type of the event.

        • id (integer) --

          The id of the event. Events are numbered sequentially, starting at one.

        • previousEventId (integer) --

          The id of the previous event.

        • activityFailedEventDetails (dict) --

          Contains details about an activity that failed during an execution.

          • error (string) --

            The error code of the failure.

          • cause (string) --

            A more detailed explanation of the cause of the failure.

        • activityScheduleFailedEventDetails (dict) --

          Contains details about an activity schedule event that failed during an execution.

          • error (string) --

            The error code of the failure.

          • cause (string) --

            A more detailed explanation of the cause of the failure.

        • activityScheduledEventDetails (dict) --

          Contains details about an activity scheduled during an execution.

          • resource (string) --

            The Amazon Resource Name (ARN) of the scheduled activity.

          • input (string) --

            The JSON data input to the activity task. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

          • inputDetails (dict) --

            Contains details about the input for an execution history event.

            • truncated (boolean) --

              Indicates whether input or output was truncated in the response. Always false for API calls.

          • timeoutInSeconds (integer) --

            The maximum allowed duration of the activity task.

          • heartbeatInSeconds (integer) --

            The maximum allowed duration between two heartbeats for the activity task.

        • activityStartedEventDetails (dict) --

          Contains details about the start of an activity during an execution.

          • workerName (string) --

            The name of the worker that the task is assigned to. These names are provided by the workers when calling GetActivityTask .

        • activitySucceededEventDetails (dict) --

          Contains details about an activity that successfully terminated during an execution.

          • output (string) --

            The JSON data output by the activity task. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

          • outputDetails (dict) --

            Contains details about the output of an execution history event.

            • truncated (boolean) --

              Indicates whether input or output was truncated in the response. Always false for API calls.

        • activityTimedOutEventDetails (dict) --

          Contains details about an activity timeout that occurred during an execution.

          • error (string) --

            The error code of the failure.

          • cause (string) --

            A more detailed explanation of the cause of the timeout.

        • taskFailedEventDetails (dict) --

          Contains details about the failure of a task.

          • resourceType (string) --

            The service name of the resource in a task state.

          • resource (string) --

            The action of the resource called by a task state.

          • error (string) --

            The error code of the failure.

          • cause (string) --

            A more detailed explanation of the cause of the failure.

        • taskScheduledEventDetails (dict) --

          Contains details about a task that was scheduled.

          • resourceType (string) --

            The service name of the resource in a task state.

          • resource (string) --

            The action of the resource called by a task state.

          • region (string) --

            The region of the scheduled task

          • parameters (string) --

            The JSON data passed to the resource referenced in a task state. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

          • timeoutInSeconds (integer) --

            The maximum allowed duration of the task.

          • heartbeatInSeconds (integer) --

            The maximum allowed duration between two heartbeats for the task.

          • taskCredentials (dict) --

            The credentials that Step Functions uses for the task.

            • roleArn (string) --

              The ARN of an IAM role that Step Functions assumes for the task. The role can allow cross-account access to resources.

        • taskStartFailedEventDetails (dict) --

          Contains details about a task that failed to start.

          • resourceType (string) --

            The service name of the resource in a task state.

          • resource (string) --

            The action of the resource called by a task state.

          • error (string) --

            The error code of the failure.

          • cause (string) --

            A more detailed explanation of the cause of the failure.

        • taskStartedEventDetails (dict) --

          Contains details about a task that was started.

          • resourceType (string) --

            The service name of the resource in a task state.

          • resource (string) --

            The action of the resource called by a task state.

        • taskSubmitFailedEventDetails (dict) --

          Contains details about a task that where the submit failed.

          • resourceType (string) --

            The service name of the resource in a task state.

          • resource (string) --

            The action of the resource called by a task state.

          • error (string) --

            The error code of the failure.

          • cause (string) --

            A more detailed explanation of the cause of the failure.

        • taskSubmittedEventDetails (dict) --

          Contains details about a submitted task.

          • resourceType (string) --

            The service name of the resource in a task state.

          • resource (string) --

            The action of the resource called by a task state.

          • output (string) --

            The response from a resource when a task has started. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

          • outputDetails (dict) --

            Contains details about the output of an execution history event.

            • truncated (boolean) --

              Indicates whether input or output was truncated in the response. Always false for API calls.

        • taskSucceededEventDetails (dict) --

          Contains details about a task that succeeded.

          • resourceType (string) --

            The service name of the resource in a task state.

          • resource (string) --

            The action of the resource called by a task state.

          • output (string) --

            The full JSON response from a resource when a task has succeeded. This response becomes the output of the related task. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

          • outputDetails (dict) --

            Contains details about the output of an execution history event.

            • truncated (boolean) --

              Indicates whether input or output was truncated in the response. Always false for API calls.

        • taskTimedOutEventDetails (dict) --

          Contains details about a task that timed out.

          • resourceType (string) --

            The service name of the resource in a task state.

          • resource (string) --

            The action of the resource called by a task state.

          • error (string) --

            The error code of the failure.

          • cause (string) --

            A more detailed explanation of the cause of the failure.

        • executionFailedEventDetails (dict) --

          Contains details about an execution failure event.

          • error (string) --

            The error code of the failure.

          • cause (string) --

            A more detailed explanation of the cause of the failure.

        • executionStartedEventDetails (dict) --

          Contains details about the start of the execution.

          • input (string) --

            The JSON data input to the execution. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

          • inputDetails (dict) --

            Contains details about the input for an execution history event.

            • truncated (boolean) --

              Indicates whether input or output was truncated in the response. Always false for API calls.

          • roleArn (string) --

            The Amazon Resource Name (ARN) of the IAM role used for executing Lambda tasks.

          • stateMachineAliasArn (string) --

            The Amazon Resource Name (ARN) that identifies a state machine alias used for starting the state machine execution.

          • stateMachineVersionArn (string) --

            The Amazon Resource Name (ARN) that identifies a state machine version used for starting the state machine execution.

        • executionSucceededEventDetails (dict) --

          Contains details about the successful termination of the execution.

          • output (string) --

            The JSON data output by the execution. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

          • outputDetails (dict) --

            Contains details about the output of an execution history event.

            • truncated (boolean) --

              Indicates whether input or output was truncated in the response. Always false for API calls.

        • executionAbortedEventDetails (dict) --

          Contains details about an abort of an execution.

          • error (string) --

            The error code of the failure.

          • cause (string) --

            A more detailed explanation of the cause of the failure.

        • executionTimedOutEventDetails (dict) --

          Contains details about the execution timeout that occurred during the execution.

          • error (string) --

            The error code of the failure.

          • cause (string) --

            A more detailed explanation of the cause of the timeout.

        • executionRedrivenEventDetails (dict) --

          Contains details about the redrive attempt of an execution.

          • redriveCount (integer) --

            The number of times you've redriven an execution. If you have not yet redriven an execution, the redriveCount is 0. This count is not updated for redrives that failed to start or are pending to be redriven.

        • mapStateStartedEventDetails (dict) --

          Contains details about Map state that was started.

          • length (integer) --

            The size of the array for Map state iterations.

        • mapIterationStartedEventDetails (dict) --

          Contains details about an iteration of a Map state that was started.

          • name (string) --

            The name of the iteration’s parent Map state.

          • index (integer) --

            The index of the array belonging to the Map state iteration.

        • mapIterationSucceededEventDetails (dict) --

          Contains details about an iteration of a Map state that succeeded.

          • name (string) --

            The name of the iteration’s parent Map state.

          • index (integer) --

            The index of the array belonging to the Map state iteration.

        • mapIterationFailedEventDetails (dict) --

          Contains details about an iteration of a Map state that failed.

          • name (string) --

            The name of the iteration’s parent Map state.

          • index (integer) --

            The index of the array belonging to the Map state iteration.

        • mapIterationAbortedEventDetails (dict) --

          Contains details about an iteration of a Map state that was aborted.

          • name (string) --

            The name of the iteration’s parent Map state.

          • index (integer) --

            The index of the array belonging to the Map state iteration.

        • lambdaFunctionFailedEventDetails (dict) --

          Contains details about a Lambda function that failed during an execution.

          • error (string) --

            The error code of the failure.

          • cause (string) --

            A more detailed explanation of the cause of the failure.

        • lambdaFunctionScheduleFailedEventDetails (dict) --

          Contains details about a failed Lambda function schedule event that occurred during an execution.

          • error (string) --

            The error code of the failure.

          • cause (string) --

            A more detailed explanation of the cause of the failure.

        • lambdaFunctionScheduledEventDetails (dict) --

          Contains details about a Lambda function scheduled during an execution.

          • resource (string) --

            The Amazon Resource Name (ARN) of the scheduled Lambda function.

          • input (string) --

            The JSON data input to the Lambda function. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

          • inputDetails (dict) --

            Contains details about input for an execution history event.

            • truncated (boolean) --

              Indicates whether input or output was truncated in the response. Always false for API calls.

          • timeoutInSeconds (integer) --

            The maximum allowed duration of the Lambda function.

          • taskCredentials (dict) --

            The credentials that Step Functions uses for the task.

            • roleArn (string) --

              The ARN of an IAM role that Step Functions assumes for the task. The role can allow cross-account access to resources.

        • lambdaFunctionStartFailedEventDetails (dict) --

          Contains details about a lambda function that failed to start during an execution.

          • error (string) --

            The error code of the failure.

          • cause (string) --

            A more detailed explanation of the cause of the failure.

        • lambdaFunctionSucceededEventDetails (dict) --

          Contains details about a Lambda function that terminated successfully during an execution.

          • output (string) --

            The JSON data output by the Lambda function. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

          • outputDetails (dict) --

            Contains details about the output of an execution history event.

            • truncated (boolean) --

              Indicates whether input or output was truncated in the response. Always false for API calls.

        • lambdaFunctionTimedOutEventDetails (dict) --

          Contains details about a Lambda function timeout that occurred during an execution.

          • error (string) --

            The error code of the failure.

          • cause (string) --

            A more detailed explanation of the cause of the timeout.

        • stateEnteredEventDetails (dict) --

          Contains details about a state entered during an execution.

          • name (string) --

            The name of the state.

          • input (string) --

            The string that contains the JSON input data for the state. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

          • inputDetails (dict) --

            Contains details about the input for an execution history event.

            • truncated (boolean) --

              Indicates whether input or output was truncated in the response. Always false for API calls.

        • stateExitedEventDetails (dict) --

          Contains details about an exit from a state during an execution.

          • name (string) --

            The name of the state.

            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 _.

          • output (string) --

            The JSON output data of the state. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding.

          • outputDetails (dict) --

            Contains details about the output of an execution history event.

            • truncated (boolean) --

              Indicates whether input or output was truncated in the response. Always false for API calls.

        • mapRunStartedEventDetails (dict) --

          Contains details, such as mapRunArn , and the start date and time of a Map Run. mapRunArn is the Amazon Resource Name (ARN) of the Map Run that was started.

          • mapRunArn (string) --

            The Amazon Resource Name (ARN) of a Map Run that was started.

        • mapRunFailedEventDetails (dict) --

          Contains error and cause details about a Map Run that failed.

          • error (string) --

            The error code of the Map Run failure.

          • cause (string) --

            A more detailed explanation of the cause of the failure.

        • mapRunRedrivenEventDetails (dict) --

          Contains details about the redrive attempt of a Map Run.

          • mapRunArn (string) --

            The Amazon Resource Name (ARN) of a Map Run that was redriven.

          • redriveCount (integer) --

            The number of times the Map Run has been redriven at this point in the execution's history including this event. The redrive count for a redriven Map Run is always greater than 0.

    • nextToken (string) --

      If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

ListExecutions (updated) Link ¶
Changes (request, response)
Request
{'redriveFilter': 'REDRIVEN | NOT_REDRIVEN',
 'statusFilter': {'PENDING_REDRIVE'}}
Response
{'executions': {'redriveCount': 'integer',
                'redriveDate': 'timestamp',
                'status': {'PENDING_REDRIVE'}}}

Lists all executions of a state machine or a Map Run. You can list all executions related to a state machine by specifying a state machine Amazon Resource Name (ARN), or those related to a Map Run by specifying a Map Run ARN. Using this API action, you can also list all redriven executions.

You can also provide a state machine alias ARN or version ARN to list the executions associated with a specific alias or version.

Results are sorted by time, with the most recent execution first.

If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

Note

This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes.

This API action is not supported by EXPRESS state machines.

See also: AWS API Documentation

Request Syntax

client.list_executions(
    stateMachineArn='string',
    statusFilter='RUNNING'|'SUCCEEDED'|'FAILED'|'TIMED_OUT'|'ABORTED'|'PENDING_REDRIVE',
    maxResults=123,
    nextToken='string',
    mapRunArn='string',
    redriveFilter='REDRIVEN'|'NOT_REDRIVEN'
)
type stateMachineArn

string

param stateMachineArn

The Amazon Resource Name (ARN) of the state machine whose executions is listed.

You can specify either a mapRunArn or a stateMachineArn , but not both.

You can also return a list of executions associated with a specific alias or version , by specifying an alias ARN or a version ARN in the stateMachineArn parameter.

type statusFilter

string

param statusFilter

If specified, only list the executions whose current execution status matches the given filter.

type maxResults

integer

param maxResults

The maximum number of results that are returned per call. You can use nextToken to obtain further pages of results. The default is 100 and the maximum allowed page size is 1000. A value of 0 uses the default.

This is only an upper limit. The actual number of results returned per call might be fewer than the specified maximum.

type nextToken

string

param nextToken

If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.

type mapRunArn

string

param mapRunArn

The Amazon Resource Name (ARN) of the Map Run that started the child workflow executions. If the mapRunArn field is specified, a list of all of the child workflow executions started by a Map Run is returned. For more information, see Examining Map Run in the Step Functions Developer Guide .

You can specify either a mapRunArn or a stateMachineArn , but not both.

type redriveFilter

string

param redriveFilter

Sets a filter to list executions based on whether or not they have been redriven.

For a Distributed Map, redriveFilter sets a filter to list child workflow executions based on whether or not they have been redriven.

If you do not provide a redriveFilter , Step Functions returns a list of both redriven and non-redriven executions.

If you provide a state machine ARN in redriveFilter , the API returns a validation exception.

rtype

dict

returns

Response Syntax

{
    'executions': [
        {
            'executionArn': 'string',
            'stateMachineArn': 'string',
            'name': 'string',
            'status': 'RUNNING'|'SUCCEEDED'|'FAILED'|'TIMED_OUT'|'ABORTED'|'PENDING_REDRIVE',
            'startDate': datetime(2015, 1, 1),
            'stopDate': datetime(2015, 1, 1),
            'mapRunArn': 'string',
            'itemCount': 123,
            'stateMachineVersionArn': 'string',
            'stateMachineAliasArn': 'string',
            'redriveCount': 123,
            'redriveDate': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • executions (list) --

      The list of matching executions.

      • (dict) --

        Contains details about an execution.

        • executionArn (string) --

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

        • stateMachineArn (string) --

          The Amazon Resource Name (ARN) of the state machine that ran the execution.

        • name (string) --

          The name of the execution.

          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 _.

        • status (string) --

          The current status of the execution.

        • startDate (datetime) --

          The date the execution started.

        • stopDate (datetime) --

          If the execution already ended, the date the execution stopped.

        • mapRunArn (string) --

          The Amazon Resource Name (ARN) of a Map Run. This field is returned only if mapRunArn was specified in the ListExecutions API action. If stateMachineArn was specified in ListExecutions , the mapRunArn isn't returned.

        • itemCount (integer) --

          The total number of items processed in a child workflow execution. This field is returned only if mapRunArn was specified in the ListExecutions API action. If stateMachineArn was specified in ListExecutions , the itemCount field isn't returned.

        • stateMachineVersionArn (string) --

          The Amazon Resource Name (ARN) of the state machine version associated with the execution.

          If the state machine execution was started with an unqualified ARN, it returns null.

          If the execution was started using a stateMachineAliasArn , both the stateMachineAliasArn and stateMachineVersionArn parameters contain the respective values.

        • stateMachineAliasArn (string) --

          The Amazon Resource Name (ARN) of the state machine alias used to start an execution.

          If the state machine execution was started with an unqualified ARN or a version ARN, it returns null.

        • redriveCount (integer) --

          The number of times you've redriven an execution. If you have not yet redriven an execution, the redriveCount is 0. This count is not updated for redrives that failed to start or are pending to be redriven.

        • redriveDate (datetime) --

          The date the execution was last redriven.

    • nextToken (string) --

      If nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return an HTTP 400 InvalidToken error.