AWS Step Functions

2023/06/22 - AWS Step Functions - 8 new7 updated api methods

Changes  Update stepfunctions client to latest version

ListStateMachineVersions (new) Link ¶

Lists versions for the specified state machine Amazon Resource Name (ARN).

The results are sorted in descending order of the version creation time.

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.

Related operations:

  • PublishStateMachineVersion

  • DeleteStateMachineVersion

See also: AWS API Documentation

Request Syntax

client.list_state_machine_versions(
    stateMachineArn='string',
    nextToken='string',
    maxResults=123
)
type stateMachineArn:

string

param stateMachineArn:

[REQUIRED]

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

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

rtype:

dict

returns:

Response Syntax

{
    'stateMachineVersions': [
        {
            'stateMachineVersionArn': 'string',
            'creationDate': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • stateMachineVersions (list) --

      Versions for the state machine.

      • (dict) --

        Contains details about a specific state machine version.

        • stateMachineVersionArn (string) --

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

        • creationDate (datetime) --

          The creation date of a state machine version.

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

UpdateStateMachineAlias (new) Link ¶

Updates the configuration of an existing state machine alias by modifying its description or routingConfiguration.

You must specify at least one of the description or routingConfiguration parameters to update a state machine alias.

Related operations:

  • CreateStateMachineAlias

  • DescribeStateMachineAlias

  • ListStateMachineAliases

  • DeleteStateMachineAlias

See also: AWS API Documentation

Request Syntax

client.update_state_machine_alias(
    stateMachineAliasArn='string',
    description='string',
    routingConfiguration=[
        {
            'stateMachineVersionArn': 'string',
            'weight': 123
        },
    ]
)
type stateMachineAliasArn:

string

param stateMachineAliasArn:

[REQUIRED]

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

type description:

string

param description:

A description of the state machine alias.

type routingConfiguration:

list

param routingConfiguration:

The routing configuration of the state machine alias.

An array of RoutingConfig objects that specifies up to two state machine versions that the alias starts executions for.

  • (dict) --

    Contains details about the routing configuration of a state machine alias. In a routing configuration, you define an array of objects that specify up to two state machine versions. You also specify the percentage of traffic to be routed to each version.

    • stateMachineVersionArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) that identifies one or two state machine versions defined in the routing configuration.

      If you specify the ARN of a second version, it must belong to the same state machine as the first version.

    • weight (integer) -- [REQUIRED]

      The percentage of traffic you want to route to the second state machine version. The sum of the weights in the routing configuration must be equal to 100.

rtype:

dict

returns:

Response Syntax

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

Response Structure

  • (dict) --

    • updateDate (datetime) --

      The date and time the state machine alias was updated.

CreateStateMachineAlias (new) Link ¶

Creates an alias for a state machine that points to one or two versions of the same state machine. You can set your application to call StartExecution with an alias and update the version the alias uses without changing the client's code.

You can also map an alias to split StartExecution requests between two versions of a state machine. To do this, add a second RoutingConfig object in the routingConfiguration parameter. You must also specify the percentage of execution run requests each version should receive in both RoutingConfig objects. Step Functions randomly chooses which version runs a given execution based on the percentage you specify.

To create an alias that points to a single version, specify a single RoutingConfig object with a weight set to 100.

You can create up to 100 aliases for each state machine. You must delete unused aliases using the DeleteStateMachineAlias API action.

CreateStateMachineAlias is an idempotent API. Step Functions bases the idempotency check on the stateMachineArn, description, name, and routingConfiguration parameters. Requests that contain the same values for these parameters return a successful idempotent response without creating a duplicate resource.

Related operations:

  • DescribeStateMachineAlias

  • ListStateMachineAliases

  • UpdateStateMachineAlias

  • DeleteStateMachineAlias

See also: AWS API Documentation

Request Syntax

client.create_state_machine_alias(
    description='string',
    name='string',
    routingConfiguration=[
        {
            'stateMachineVersionArn': 'string',
            'weight': 123
        },
    ]
)
type description:

string

param description:

A description for the state machine alias.

type name:

string

param name:

[REQUIRED]

The name of the state machine alias.

To avoid conflict with version ARNs, don't use an integer in the name of the alias.

type routingConfiguration:

list

param routingConfiguration:

[REQUIRED]

The routing configuration of a state machine alias. The routing configuration shifts execution traffic between two state machine versions. routingConfiguration contains an array of RoutingConfig objects that specify up to two state machine versions. Step Functions then randomly choses which version to run an execution with based on the weight assigned to each RoutingConfig.

  • (dict) --

    Contains details about the routing configuration of a state machine alias. In a routing configuration, you define an array of objects that specify up to two state machine versions. You also specify the percentage of traffic to be routed to each version.

    • stateMachineVersionArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) that identifies one or two state machine versions defined in the routing configuration.

      If you specify the ARN of a second version, it must belong to the same state machine as the first version.

    • weight (integer) -- [REQUIRED]

      The percentage of traffic you want to route to the second state machine version. The sum of the weights in the routing configuration must be equal to 100.

rtype:

dict

returns:

Response Syntax

{
    'stateMachineAliasArn': 'string',
    'creationDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • stateMachineAliasArn (string) --

      The Amazon Resource Name (ARN) that identifies the created state machine alias.

    • creationDate (datetime) --

      The date the state machine alias was created.

ListStateMachineAliases (new) Link ¶

Lists aliases for a specified state machine ARN. Results are sorted by time, with the most recently created aliases listed first.

To list aliases that reference a state machine version, you can specify the version ARN in the stateMachineArn parameter.

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.

Related operations:

  • CreateStateMachineAlias

  • DescribeStateMachineAlias

  • UpdateStateMachineAlias

  • DeleteStateMachineAlias

See also: AWS API Documentation

Request Syntax

client.list_state_machine_aliases(
    stateMachineArn='string',
    nextToken='string',
    maxResults=123
)
type stateMachineArn:

string

param stateMachineArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the state machine for which you want to list aliases.

If you specify a state machine version ARN, this API returns a list of aliases for that version.

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

rtype:

dict

returns:

Response Syntax

{
    'stateMachineAliases': [
        {
            'stateMachineAliasArn': 'string',
            'creationDate': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • stateMachineAliases (list) --

      Aliases for the state machine.

      • (dict) --

        Contains details about a specific state machine alias.

        • stateMachineAliasArn (string) --

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

        • creationDate (datetime) --

          The creation date of a state machine alias.

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

DeleteStateMachineVersion (new) Link ¶

Deletes a state machine version. After you delete a version, you can't call StartExecution using that version's ARN or use the version with a state machine alias.

Related operations:

  • PublishStateMachineVersion

  • ListStateMachineVersions

See also: AWS API Documentation

Request Syntax

client.delete_state_machine_version(
    stateMachineVersionArn='string'
)
type stateMachineVersionArn:

string

param stateMachineVersionArn:

[REQUIRED]

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

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

DescribeStateMachineAlias (new) Link ¶

Returns details about a state machine alias.

Related operations:

  • CreateStateMachineAlias

  • ListStateMachineAliases

  • UpdateStateMachineAlias

  • DeleteStateMachineAlias

See also: AWS API Documentation

Request Syntax

client.describe_state_machine_alias(
    stateMachineAliasArn='string'
)
type stateMachineAliasArn:

string

param stateMachineAliasArn:

[REQUIRED]

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

rtype:

dict

returns:

Response Syntax

{
    'stateMachineAliasArn': 'string',
    'name': 'string',
    'description': 'string',
    'routingConfiguration': [
        {
            'stateMachineVersionArn': 'string',
            'weight': 123
        },
    ],
    'creationDate': datetime(2015, 1, 1),
    'updateDate': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • stateMachineAliasArn (string) --

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

    • name (string) --

      The name of the state machine alias.

    • description (string) --

      A description of the alias.

    • routingConfiguration (list) --

      The routing configuration of the alias.

      • (dict) --

        Contains details about the routing configuration of a state machine alias. In a routing configuration, you define an array of objects that specify up to two state machine versions. You also specify the percentage of traffic to be routed to each version.

        • stateMachineVersionArn (string) --

          The Amazon Resource Name (ARN) that identifies one or two state machine versions defined in the routing configuration.

          If you specify the ARN of a second version, it must belong to the same state machine as the first version.

        • weight (integer) --

          The percentage of traffic you want to route to the second state machine version. The sum of the weights in the routing configuration must be equal to 100.

    • creationDate (datetime) --

      The date the state machine alias was created.

    • updateDate (datetime) --

      The date the state machine alias was last updated.

      For a newly created state machine, this is the same as the creation date.

DeleteStateMachineAlias (new) Link ¶

Deletes a state machine alias.

After you delete a state machine alias, you can't use it to start executions. When you delete a state machine alias, Step Functions doesn't delete the state machine versions that alias references.

Related operations:

  • CreateStateMachineAlias

  • DescribeStateMachineAlias

  • ListStateMachineAliases

  • UpdateStateMachineAlias

See also: AWS API Documentation

Request Syntax

client.delete_state_machine_alias(
    stateMachineAliasArn='string'
)
type stateMachineAliasArn:

string

param stateMachineAliasArn:

[REQUIRED]

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

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

PublishStateMachineVersion (new) Link ¶

Creates a version from the current revision of a state machine. Use versions to create immutable snapshots of your state machine. You can start executions from versions either directly or with an alias. To create an alias, use CreateStateMachineAlias.

You can publish up to 1000 versions for each state machine. You must manually delete unused versions using the DeleteStateMachineVersion API action.

PublishStateMachineVersion is an idempotent API. It doesn't create a duplicate state machine version if it already exists for the current revision. Step Functions bases PublishStateMachineVersion's idempotency check on the stateMachineArn, name, and revisionId parameters. Requests with the same parameters return a successful idempotent response. If you don't specify a revisionId, Step Functions checks for a previously published version of the state machine's current revision.

Related operations:

  • DeleteStateMachineVersion

  • ListStateMachineVersions

See also: AWS API Documentation

Request Syntax

client.publish_state_machine_version(
    stateMachineArn='string',
    revisionId='string',
    description='string'
)
type stateMachineArn:

string

param stateMachineArn:

[REQUIRED]

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

type revisionId:

string

param revisionId:

Only publish the state machine version if the current state machine's revision ID matches the specified ID.

Use this option to avoid publishing a version if the state machine changed since you last updated it. If the specified revision ID doesn't match the state machine's current revision ID, the API returns ConflictException.

type description:

string

param description:

An optional description of the state machine version.

rtype:

dict

returns:

Response Syntax

{
    'creationDate': datetime(2015, 1, 1),
    'stateMachineVersionArn': 'string'
}

Response Structure

  • (dict) --

    • creationDate (datetime) --

      The date the version was created.

    • stateMachineVersionArn (string) --

      The Amazon Resource Name (ARN) (ARN) that identifies the state machine version.

CreateStateMachine (updated) Link ¶
Changes (request, response)
Request
{'publish': 'boolean', 'versionDescription': 'string'}
Response
{'stateMachineVersionArn': 'string'}

Creates a state machine. A state machine consists of a collection of states that can do work ( Task states), determine to which states to transition next ( Choice states), stop an execution with an error ( Fail states), and so on. State machines are specified using a JSON-based, structured language. For more information, see Amazon States Language in the Step Functions User Guide.

If you set the publish parameter of this API action to true, it publishes version 1 as the first revision of the state machine.

See also: AWS API Documentation

Request Syntax

client.create_state_machine(
    name='string',
    definition='string',
    roleArn='string',
    type='STANDARD'|'EXPRESS',
    loggingConfiguration={
        'level': 'ALL'|'ERROR'|'FATAL'|'OFF',
        'includeExecutionData': True|False,
        'destinations': [
            {
                'cloudWatchLogsLogGroup': {
                    'logGroupArn': 'string'
                }
            },
        ]
    },
    tags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ],
    tracingConfiguration={
        'enabled': True|False
    },
    publish=True|False,
    versionDescription='string'
)
type name:

string

param name:

[REQUIRED]

The name of the state machine.

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

type definition:

string

param definition:

[REQUIRED]

The Amazon States Language definition of the state machine. See Amazon States Language.

type roleArn:

string

param roleArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the IAM role to use for this state machine.

type type:

string

param type:

Determines whether a Standard or Express state machine is created. The default is STANDARD. You cannot update the type of a state machine once it has been created.

type loggingConfiguration:

dict

param loggingConfiguration:

Defines what execution history events are logged and where they are logged.

  • level (string) --

    Defines which category of execution history events are logged.

  • includeExecutionData (boolean) --

    Determines whether execution data is included in your log. When set to false, data is excluded.

  • destinations (list) --

    An array of objects that describes where your execution history events will be logged. Limited to size 1. Required, if your log level is not set to OFF.

    • (dict) --

      • cloudWatchLogsLogGroup (dict) --

        An object describing a CloudWatch log group. For more information, see AWS::Logs::LogGroup in the CloudFormation User Guide.

        • logGroupArn (string) --

          The ARN of the the CloudWatch log group to which you want your logs emitted to. The ARN must end with :*

type tags:

list

param tags:

Tags to be added when creating a state machine.

An array of key-value pairs. For more information, see Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide, and Controlling Access Using IAM Tags.

Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @.

  • (dict) --

    Tags are key-value pairs that can be associated with Step Functions state machines and activities.

    An array of key-value pairs. For more information, see Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide, and Controlling Access Using IAM Tags.

    Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @.

    • key (string) --

      The key of a tag.

    • value (string) --

      The value of a tag.

type tracingConfiguration:

dict

param tracingConfiguration:

Selects whether X-Ray tracing is enabled.

  • enabled (boolean) --

    When set to true, X-Ray tracing is enabled.

type publish:

boolean

param publish:

Set to true to publish the first version of the state machine during creation. The default is false.

type versionDescription:

string

param versionDescription:

Sets description about the state machine version. You can only set the description if the publish parameter is set to true. Otherwise, if you set versionDescription, but publish to false, this API action throws ValidationException.

rtype:

dict

returns:

Response Syntax

{
    'stateMachineArn': 'string',
    'creationDate': datetime(2015, 1, 1),
    'stateMachineVersionArn': 'string'
}

Response Structure

  • (dict) --

    • stateMachineArn (string) --

      The Amazon Resource Name (ARN) that identifies the created state machine.

    • creationDate (datetime) --

      The date the state machine is created.

    • stateMachineVersionArn (string) --

      The Amazon Resource Name (ARN) that identifies the created state machine version. If you do not set the publish parameter to true, this field returns null value.

DescribeExecution (updated) Link ¶
Changes (response)
{'stateMachineAliasArn': 'string', 'stateMachineVersionArn': 'string'}

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

Executions of an EXPRESS state machinearen'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',
    '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'
}

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.

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

DescribeStateMachine (updated) Link ¶
Changes (response)
{'description': 'string', 'revisionId': 'string'}

Provides information about a state machine's definition, its IAM role Amazon Resource Name (ARN), and configuration.

A qualified state machine ARN can either refer to a Distributed Map state defined within a state machine, a version ARN, or an alias ARN.

The following are some examples of qualified and unqualified state machine ARNs:

  • The following qualified state machine ARN refers to a Distributed Map state with a label mapStateLabel in a state machine named myStateMachine. arn:partition:states:region:account-id:stateMachine:myStateMachine/mapStateLabel

  • The following qualified state machine ARN refers to an alias named PROD. arn:<partition>:states:<region>:<account-id>:stateMachine:<myStateMachine:PROD>

  • The following unqualified state machine ARN refers to a state machine named myStateMachine. arn:<partition>:states:<region>:<account-id>:stateMachine:<myStateMachine>

This API action returns the details for a state machine version if the stateMachineArn you specify is a state machine version ARN.

See also: AWS API Documentation

Request Syntax

client.describe_state_machine(
    stateMachineArn='string'
)
type stateMachineArn:

string

param stateMachineArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the state machine for which you want the information.

If you specify a state machine version ARN, this API returns details about that version. The version ARN is a combination of state machine ARN and the version number separated by a colon (:). For example, stateMachineARN:1.

rtype:

dict

returns:

Response Syntax

{
    'stateMachineArn': 'string',
    'name': 'string',
    'status': 'ACTIVE'|'DELETING',
    'definition': 'string',
    'roleArn': 'string',
    'type': 'STANDARD'|'EXPRESS',
    'creationDate': datetime(2015, 1, 1),
    'loggingConfiguration': {
        'level': 'ALL'|'ERROR'|'FATAL'|'OFF',
        'includeExecutionData': True|False,
        'destinations': [
            {
                'cloudWatchLogsLogGroup': {
                    'logGroupArn': 'string'
                }
            },
        ]
    },
    'tracingConfiguration': {
        'enabled': True|False
    },
    'label': 'string',
    'revisionId': 'string',
    'description': 'string'
}

Response Structure

  • (dict) --

    • stateMachineArn (string) --

      The Amazon Resource Name (ARN) that identifies the state machine.

      If you specified a state machine version ARN in your request, the API returns the version ARN. The version ARN is a combination of state machine ARN and the version number separated by a colon (:). For example, stateMachineARN:1.

    • name (string) --

      The name of the state machine.

      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 state machine.

    • definition (string) --

      The Amazon States Language definition of the state machine. See Amazon States Language.

    • roleArn (string) --

      The Amazon Resource Name (ARN) of the IAM role used when creating this state machine. (The IAM role maintains security by granting Step Functions access to Amazon Web Services resources.)

    • type (string) --

      The type of the state machine ( STANDARD or EXPRESS).

    • creationDate (datetime) --

      The date the state machine is created.

      For a state machine version, creationDate is the date the version was created.

    • loggingConfiguration (dict) --

      The LoggingConfiguration data type is used to set CloudWatch Logs options.

      • level (string) --

        Defines which category of execution history events are logged.

      • includeExecutionData (boolean) --

        Determines whether execution data is included in your log. When set to false, data is excluded.

      • destinations (list) --

        An array of objects that describes where your execution history events will be logged. Limited to size 1. Required, if your log level is not set to OFF.

        • (dict) --

          • cloudWatchLogsLogGroup (dict) --

            An object describing a CloudWatch log group. For more information, see AWS::Logs::LogGroup in the CloudFormation User Guide.

            • logGroupArn (string) --

              The ARN of the the CloudWatch log group to which you want your logs emitted to. The ARN must end with :*

    • tracingConfiguration (dict) --

      Selects whether X-Ray tracing is enabled.

      • enabled (boolean) --

        When set to true, X-Ray tracing is enabled.

    • label (string) --

      A user-defined or an auto-generated string that identifies a Map state. This parameter is present only if the stateMachineArn specified in input is a qualified state machine ARN.

    • revisionId (string) --

      The revision identifier for the state machine.

      Use the revisionId parameter to compare between versions of a state machine configuration used for executions without performing a diff of the properties, such as definition and roleArn.

    • description (string) --

      The description of the state machine version.

DescribeStateMachineForExecution (updated) Link ¶
Changes (response)
{'revisionId': 'string'}

Provides information about a state machine's definition, its execution role ARN, and configuration. If a Map Run dispatched the execution, this action returns the Map Run Amazon Resource Name (ARN) in the response. The state machine returned is the state machine associated with the Map Run.

This API action is not supported by EXPRESS state machines.

See also: AWS API Documentation

Request Syntax

client.describe_state_machine_for_execution(
    executionArn='string'
)
type executionArn:

string

param executionArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the execution you want state machine information for.

rtype:

dict

returns:

Response Syntax

{
    'stateMachineArn': 'string',
    'name': 'string',
    'definition': 'string',
    'roleArn': 'string',
    'updateDate': datetime(2015, 1, 1),
    'loggingConfiguration': {
        'level': 'ALL'|'ERROR'|'FATAL'|'OFF',
        'includeExecutionData': True|False,
        'destinations': [
            {
                'cloudWatchLogsLogGroup': {
                    'logGroupArn': 'string'
                }
            },
        ]
    },
    'tracingConfiguration': {
        'enabled': True|False
    },
    'mapRunArn': 'string',
    'label': 'string',
    'revisionId': 'string'
}

Response Structure

  • (dict) --

    • stateMachineArn (string) --

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

    • name (string) --

      The name of the state machine associated with the execution.

    • definition (string) --

      The Amazon States Language definition of the state machine. See Amazon States Language.

    • roleArn (string) --

      The Amazon Resource Name (ARN) of the IAM role of the State Machine for the execution.

    • updateDate (datetime) --

      The date and time the state machine associated with an execution was updated. For a newly created state machine, this is the creation date.

    • loggingConfiguration (dict) --

      The LoggingConfiguration data type is used to set CloudWatch Logs options.

      • level (string) --

        Defines which category of execution history events are logged.

      • includeExecutionData (boolean) --

        Determines whether execution data is included in your log. When set to false, data is excluded.

      • destinations (list) --

        An array of objects that describes where your execution history events will be logged. Limited to size 1. Required, if your log level is not set to OFF.

        • (dict) --

          • cloudWatchLogsLogGroup (dict) --

            An object describing a CloudWatch log group. For more information, see AWS::Logs::LogGroup in the CloudFormation User Guide.

            • logGroupArn (string) --

              The ARN of the the CloudWatch log group to which you want your logs emitted to. The ARN must end with :*

    • tracingConfiguration (dict) --

      Selects whether X-Ray tracing is enabled.

      • enabled (boolean) --

        When set to true, X-Ray tracing is enabled.

    • mapRunArn (string) --

      The Amazon Resource Name (ARN) of the Map Run that started the child workflow execution. This field is returned only if the executionArn is a child workflow execution that was started by a Distributed Map state.

    • label (string) --

      A user-defined or an auto-generated string that identifies a Map state. This field is returned only if the executionArn is a child workflow execution that was started by a Distributed Map state.

    • revisionId (string) --

      The revision identifier for the state machine. The first revision ID when you create the state machine is null.

      Use the state machine revisionId parameter to compare the revision of a state machine with the configuration of the state machine used for executions without performing a diff of the properties, such as definition and roleArn.

GetExecutionHistory (updated) Link ¶
Changes (response)
{'events': {'executionStartedEventDetails': {'stateMachineAliasArn': 'string',
                                             'stateMachineVersionArn': 'string'}}}

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',
            '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'
            },
            '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'
            }
        },
    ],
    '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.

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

    • 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 (response)
{'executions': {'stateMachineAliasArn': 'string',
                'stateMachineVersionArn': 'string'}}

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.

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.

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',
    maxResults=123,
    nextToken='string',
    mapRunArn='string'
)
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.

rtype:

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,
            'stateMachineVersionArn': 'string',
            'stateMachineAliasArn': 'string'
        },
    ],
    '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.

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

UpdateStateMachine (updated) Link ¶
Changes (request, response)
Request
{'publish': 'boolean', 'versionDescription': 'string'}
Response
{'revisionId': 'string', 'stateMachineVersionArn': 'string'}

Updates an existing state machine by modifying its definition, roleArn, or loggingConfiguration. Running executions will continue to use the previous definition and roleArn. You must include at least one of definition or roleArn or you will receive a MissingRequiredParameter error.

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.

A qualified state machine ARN can either refer to a Distributed Map state defined within a state machine, a version ARN, or an alias ARN.

The following are some examples of qualified and unqualified state machine ARNs:

  • The following qualified state machine ARN refers to a Distributed Map state with a label mapStateLabel in a state machine named myStateMachine. arn:partition:states:region:account-id:stateMachine:myStateMachine/mapStateLabel

  • The following qualified state machine ARN refers to an alias named PROD. arn:<partition>:states:<region>:<account-id>:stateMachine:<myStateMachine:PROD>

  • The following unqualified state machine ARN refers to a state machine named myStateMachine. arn:<partition>:states:<region>:<account-id>:stateMachine:<myStateMachine>

After you update your state machine, you can set the publish parameter to true in the same action to publish a new version. This way, you can opt-in to strict versioning of your state machine.

See also: AWS API Documentation

Request Syntax

client.update_state_machine(
    stateMachineArn='string',
    definition='string',
    roleArn='string',
    loggingConfiguration={
        'level': 'ALL'|'ERROR'|'FATAL'|'OFF',
        'includeExecutionData': True|False,
        'destinations': [
            {
                'cloudWatchLogsLogGroup': {
                    'logGroupArn': 'string'
                }
            },
        ]
    },
    tracingConfiguration={
        'enabled': True|False
    },
    publish=True|False,
    versionDescription='string'
)
type stateMachineArn:

string

param stateMachineArn:

[REQUIRED]

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

type definition:

string

param definition:

The Amazon States Language definition of the state machine. See Amazon States Language.

type roleArn:

string

param roleArn:

The Amazon Resource Name (ARN) of the IAM role of the state machine.

type loggingConfiguration:

dict

param loggingConfiguration:

Use the LoggingConfiguration data type to set CloudWatch Logs options.

  • level (string) --

    Defines which category of execution history events are logged.

  • includeExecutionData (boolean) --

    Determines whether execution data is included in your log. When set to false, data is excluded.

  • destinations (list) --

    An array of objects that describes where your execution history events will be logged. Limited to size 1. Required, if your log level is not set to OFF.

    • (dict) --

      • cloudWatchLogsLogGroup (dict) --

        An object describing a CloudWatch log group. For more information, see AWS::Logs::LogGroup in the CloudFormation User Guide.

        • logGroupArn (string) --

          The ARN of the the CloudWatch log group to which you want your logs emitted to. The ARN must end with :*

type tracingConfiguration:

dict

param tracingConfiguration:

Selects whether X-Ray tracing is enabled.

  • enabled (boolean) --

    When set to true, X-Ray tracing is enabled.

type publish:

boolean

param publish:

Specifies whether the state machine version is published. The default is false. To publish a version after updating the state machine, set publish to true.

type versionDescription:

string

param versionDescription:

An optional description of the state machine version to publish.

You can only specify the versionDescription parameter if you've set publish to true.

rtype:

dict

returns:

Response Syntax

{
    'updateDate': datetime(2015, 1, 1),
    'revisionId': 'string',
    'stateMachineVersionArn': 'string'
}

Response Structure

  • (dict) --

    • updateDate (datetime) --

      The date and time the state machine was updated.

    • revisionId (string) --

      The revision identifier for the updated state machine.

    • stateMachineVersionArn (string) --

      The Amazon Resource Name (ARN) of the published state machine version.

      If the publish parameter isn't set to true, this field returns null.