list_executions

list_executions(**kwargs)

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.

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

response = client.list_executions(
    stateMachineArn='string',
    statusFilter='RUNNING'|'SUCCEEDED'|'FAILED'|'TIMED_OUT'|'ABORTED',
    maxResults=123,
    nextToken='string',
    mapRunArn='string'
)
Parameters
  • stateMachineArn (string) --

    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.

  • statusFilter (string) -- If specified, only list the executions whose current execution status matches the given filter.
  • maxResults (integer) --

    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.

  • 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.
  • mapRunArn (string) --

    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.

Return type

dict

Returns

Response Syntax

{
    'executions': [
        {
            'executionArn': 'string',
            'stateMachineArn': 'string',
            'name': 'string',
            'status': 'RUNNING'|'SUCCEEDED'|'FAILED'|'TIMED_OUT'|'ABORTED',
            'startDate': datetime(2015, 1, 1),
            'stopDate': datetime(2015, 1, 1),
            'mapRunArn': 'string',
            'itemCount': 123
        },
    ],
    '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 executed state 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 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.

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

Exceptions

  • SFN.Client.exceptions.InvalidArn
  • SFN.Client.exceptions.InvalidToken
  • SFN.Client.exceptions.StateMachineDoesNotExist
  • SFN.Client.exceptions.StateMachineTypeNotSupported
  • SFN.Client.exceptions.ValidationException
  • SFN.Client.exceptions.ResourceNotFound