SFN *** Client ====== class SFN.Client A low-level client representing AWS Step Functions (SFN) With Step Functions, you can create workflows, also called *state machines*, to build distributed applications, automate processes, orchestrate microservices, and create data and machine learning pipelines. Through the Step Functions API, you can create, list, update, and delete state machines, activities, and other data types. You can start, stop, and redrive your state machines. Your activity workers can send task success, heartbeat, and failure responses. With API calls, you can also manage other aspects of your workflow, such as tags, versions, and aliases. For more information about developing solutions with Step Functions, see the Step Functions Developer Guide . Warning: If you use the Step Functions API actions using Amazon Web Services SDK integrations, make sure the API actions are in camel case and parameter names are in Pascal case. For example, you might use Step Functions API action "startSyncExecution" and specify its parameter as "StateMachineArn". import boto3 client = boto3.client('stepfunctions') These are the available methods: * can_paginate * close * create_activity * create_state_machine * create_state_machine_alias * delete_activity * delete_state_machine * delete_state_machine_alias * delete_state_machine_version * describe_activity * describe_execution * describe_map_run * describe_state_machine * describe_state_machine_alias * describe_state_machine_for_execution * get_activity_task * get_execution_history * get_paginator * get_waiter * list_activities * list_executions * list_map_runs * list_state_machine_aliases * list_state_machine_versions * list_state_machines * list_tags_for_resource * publish_state_machine_version * redrive_execution * send_task_failure * send_task_heartbeat * send_task_success * start_execution * start_sync_execution * stop_execution * tag_resource * test_state * untag_resource * update_map_run * update_state_machine * update_state_machine_alias * validate_state_machine_definition Paginators ========== Paginators are available on a client instance via the "get_paginator" method. For more detailed instructions and examples on the usage of paginators, see the paginators user guide. The available paginators are: * GetExecutionHistory * ListActivities * ListExecutions * ListMapRuns * ListStateMachines SFN / Paginator / ListActivities ListActivities ************** class SFN.Paginator.ListActivities paginator = client.get_paginator('list_activities') paginate(**kwargs) Creates an iterator that will paginate through responses from "SFN.Client.list_activities()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max- items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'activities': [ { 'activityArn': 'string', 'name': 'string', 'creationDate': datetime(2015, 1, 1) }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **activities** *(list) --* The list of activities. * *(dict) --* Contains details about an activity. * **activityArn** *(string) --* The Amazon Resource Name (ARN) that identifies the activity. * **name** *(string) --* The name of the activity. A name must *not* contain: * white space * brackets "< > { } [ ]" * wildcard characters "? *" * special characters "" # % \ ^ | ~ ` $ & , ; : /" * control characters ( "U+0000-001F", "U+007F-009F", "U+FFFE-FFFF") * surrogates ( "U+D800-DFFF") * invalid characters ( `` U+10FFFF``) To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. * **creationDate** *(datetime) --* The date the activity is created. * **NextToken** *(string) --* A token to resume pagination. SFN / Paginator / ListExecutions ListExecutions ************** class SFN.Paginator.ListExecutions paginator = client.get_paginator('list_executions') paginate(**kwargs) Creates an iterator that will paginate through responses from "SFN.Client.list_executions()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( stateMachineArn='string', statusFilter='RUNNING'|'SUCCEEDED'|'FAILED'|'TIMED_OUT'|'ABORTED'|'PENDING_REDRIVE', mapRunArn='string', redriveFilter='REDRIVEN'|'NOT_REDRIVEN', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': '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. 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. * **statusFilter** (*string*) -- If specified, only list the executions whose current execution status matches the given filter. If you provide a "PENDING_REDRIVE" statusFilter, you must specify "mapRunArn". For more information, see Child workflow execution redrive behaviour in the *Step Functions Developer Guide*. If you provide a stateMachineArn and a "PENDING_REDRIVE" statusFilter, the API returns a validation exception. * **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. * **redriveFilter** (*string*) -- 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. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: 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", "U+FFFE-FFFF") * surrogates ( "U+D800-DFFF") * invalid characters ( `` U+10FFFF``) 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 only updated when you successfully redrive an execution. * **redriveDate** *(datetime) --* The date the execution was last redriven. * **NextToken** *(string) --* A token to resume pagination. SFN / Paginator / ListStateMachines ListStateMachines ***************** class SFN.Paginator.ListStateMachines paginator = client.get_paginator('list_state_machines') paginate(**kwargs) Creates an iterator that will paginate through responses from "SFN.Client.list_state_machines()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max- items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'stateMachines': [ { 'stateMachineArn': 'string', 'name': 'string', 'type': 'STANDARD'|'EXPRESS', 'creationDate': datetime(2015, 1, 1) }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **stateMachines** *(list) --* * *(dict) --* Contains details about the state machine. * **stateMachineArn** *(string) --* The Amazon Resource Name (ARN) that identifies the state machine. * **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", "U+FFFE-FFFF") * surrogates ( "U+D800-DFFF") * invalid characters ( `` U+10FFFF``) To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. * **type** *(string) --* * **creationDate** *(datetime) --* The date the state machine is created. * **NextToken** *(string) --* A token to resume pagination. SFN / Paginator / ListMapRuns ListMapRuns *********** class SFN.Paginator.ListMapRuns paginator = client.get_paginator('list_map_runs') paginate(**kwargs) Creates an iterator that will paginate through responses from "SFN.Client.list_map_runs()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( executionArn='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **executionArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the execution for which the Map Runs must be listed. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'mapRuns': [ { 'executionArn': 'string', 'mapRunArn': 'string', 'stateMachineArn': 'string', 'startDate': datetime(2015, 1, 1), 'stopDate': datetime(2015, 1, 1) }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **mapRuns** *(list) --* An array that lists information related to a Map Run, such as the Amazon Resource Name (ARN) of the Map Run and the ARN of the state machine that started the Map Run. * *(dict) --* Contains details about a specific Map Run. * **executionArn** *(string) --* The "executionArn" of the execution from which the Map Run was started. * **mapRunArn** *(string) --* The Amazon Resource Name (ARN) of the Map Run. * **stateMachineArn** *(string) --* The Amazon Resource Name (ARN) of the executed state machine. * **startDate** *(datetime) --* The date on which the Map Run started. * **stopDate** *(datetime) --* The date on which the Map Run stopped. * **NextToken** *(string) --* A token to resume pagination. SFN / Paginator / GetExecutionHistory GetExecutionHistory ******************* class SFN.Paginator.GetExecutionHistory paginator = client.get_paginator('get_execution_history') paginate(**kwargs) Creates an iterator that will paginate through responses from "SFN.Client.get_execution_history()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( executionArn='string', reverseOrder=True|False, includeExecutionData=True|False, PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **executionArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the execution. * **reverseOrder** (*boolean*) -- Lists events in descending order of their "timeStamp". * **includeExecutionData** (*boolean*) -- You can select whether execution data (input or output of a history event) is returned. The default is "true". * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: 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'|'EvaluationFailed', '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 }, 'assignedVariables': { 'string': 'string' }, 'assignedVariablesDetails': { 'truncated': True|False } }, 'mapRunStartedEventDetails': { 'mapRunArn': 'string' }, 'mapRunFailedEventDetails': { 'error': 'string', 'cause': 'string' }, 'mapRunRedrivenEventDetails': { 'mapRunArn': 'string', 'redriveCount': 123 }, 'evaluationFailedEventDetails': { 'error': 'string', 'cause': 'string', 'location': 'string', 'state': '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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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", "U+FFFE-FFFF") * surrogates ( "U+D800-DFFF") * invalid characters ( `` U+10FFFF``) 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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **assignedVariables** *(dict) --* Map of variable name and value as a serialized JSON representation. * *(string) --* * *(string) --* * **assignedVariablesDetails** *(dict) --* Provides details about input or output in an execution history event. * **truncated** *(boolean) --* Indicates whether assigned variables were truncated in the response. Always "false" for API calls. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. * **evaluationFailedEventDetails** *(dict) --* Contains details about an evaluation failure that occurred while processing a state. * **error** *(string) --* The error code of the failure. * **cause** *(string) --* A more detailed explanation of the cause of the failure. * **location** *(string) --* The location of the field in the state in which the evaluation error occurred. * **state** *(string) --* The name of the state in which the evaluation error occurred. * **NextToken** *(string) --* A token to resume pagination. SFN / Client / describe_state_machine_alias describe_state_machine_alias **************************** SFN.Client.describe_state_machine_alias(**kwargs) Returns details about a state machine alias. **Related operations:** * CreateStateMachineAlias * ListStateMachineAliases * UpdateStateMachineAlias * DeleteStateMachineAlias See also: AWS API Documentation **Request Syntax** response = client.describe_state_machine_alias( stateMachineAliasArn='string' ) Parameters: **stateMachineAliasArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the state machine alias. Return type: 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 a 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. **Exceptions** * "SFN.Client.exceptions.ValidationException" * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.ResourceNotFound" SFN / Client / get_paginator get_paginator ************* SFN.Client.get_paginator(operation_name) Create a paginator for an operation. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Raises: **OperationNotPageableError** -- Raised if the operation is not pageable. You can use the "client.can_paginate" method to check if an operation is pageable. Return type: "botocore.paginate.Paginator" Returns: A paginator object. SFN / Client / describe_state_machine describe_state_machine ********************** SFN.Client.describe_state_machine(**kwargs) 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" Note: If you provide a qualified state machine ARN that refers to a *Distributed Map state*, the request fails with "ValidationException". * The following qualified state machine ARN refers to an alias named "PROD". "arn::states:::stateMachine:" Note: If you provide a qualified state machine ARN that refers to a version ARN or an alias ARN, the request starts execution for that version or alias. * The following unqualified state machine ARN refers to a state machine named "myStateMachine". "arn::states:::stateMachine:" This API action returns the details for a state machine version if the "stateMachineArn" you specify is a state machine version ARN. Note: This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes. See also: AWS API Documentation **Request Syntax** response = client.describe_state_machine( stateMachineArn='string', includedData='ALL_DATA'|'METADATA_ONLY' ) Parameters: * **stateMachineArn** (*string*) -- **[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". * **includedData** (*string*) -- If your state machine definition is encrypted with a KMS key, callers must have "kms:Decrypt" permission to decrypt the definition. Alternatively, you can call the API with "includedData = METADATA_ONLY" to get a successful response without the encrypted definition. Note: When calling a labelled ARN for an encrypted state machine, the "includedData = METADATA_ONLY" parameter will not apply because Step Functions needs to decrypt the entire state machine definition to get the Distributed Map state’s definition. In this case, the API caller needs to have "kms:Decrypt" permission. Return type: 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', 'encryptionConfiguration': { 'kmsKeyId': 'string', 'kmsDataKeyReusePeriodSeconds': 123, 'type': 'AWS_OWNED_KEY'|'CUSTOMER_MANAGED_KMS_KEY' }, 'variableReferences': { 'string': [ '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", "U +FFFE-FFFF") * surrogates ( "U+D800-DFFF") * invalid characters ( `` U+10FFFF``) 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. If called with "includedData = METADATA_ONLY", the returned definition will be "{}". * **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. * **encryptionConfiguration** *(dict) --* Settings to configure server-side encryption. * **kmsKeyId** *(string) --* An alias, alias ARN, key ID, or key ARN of a symmetric encryption KMS key to encrypt data. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN. * **kmsDataKeyReusePeriodSeconds** *(integer) --* Maximum duration that Step Functions will reuse data keys. When the period expires, Step Functions will call "GenerateDataKey". Only applies to customer managed keys. * **type** *(string) --* Encryption type * **variableReferences** *(dict) --* A map of **state name** to a list of variables referenced by that state. States that do not use variable references will not be shown in the response. * *(string) --* * *(list) --* * *(string) --* **Exceptions** * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.StateMachineDoesNotExist" * "SFN.Client.exceptions.KmsAccessDeniedException" * "SFN.Client.exceptions.KmsInvalidStateException" * "SFN.Client.exceptions.KmsThrottlingException" SFN / Client / update_map_run update_map_run ************** SFN.Client.update_map_run(**kwargs) Updates an in-progress Map Run's configuration to include changes to the settings that control maximum concurrency and Map Run failure. See also: AWS API Documentation **Request Syntax** response = client.update_map_run( mapRunArn='string', maxConcurrency=123, toleratedFailurePercentage=..., toleratedFailureCount=123 ) Parameters: * **mapRunArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of a Map Run. * **maxConcurrency** (*integer*) -- The maximum number of child workflow executions that can be specified to run in parallel for the Map Run at the same time. * **toleratedFailurePercentage** (*float*) -- The maximum percentage of failed items before the Map Run fails. * **toleratedFailureCount** (*integer*) -- The maximum number of failed items before the Map Run fails. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "SFN.Client.exceptions.ResourceNotFound" * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.ValidationException" SFN / Client / can_paginate can_paginate ************ SFN.Client.can_paginate(operation_name) Check if an operation can be paginated. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Returns: "True" if the operation can be paginated, "False" otherwise. SFN / Client / list_activities list_activities *************** SFN.Client.list_activities(**kwargs) Lists the existing activities. 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. See also: AWS API Documentation **Request Syntax** response = client.list_activities( maxResults=123, nextToken='string' ) Parameters: * **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. Return type: dict Returns: **Response Syntax** { 'activities': [ { 'activityArn': 'string', 'name': 'string', 'creationDate': datetime(2015, 1, 1) }, ], 'nextToken': 'string' } **Response Structure** * *(dict) --* * **activities** *(list) --* The list of activities. * *(dict) --* Contains details about an activity. * **activityArn** *(string) --* The Amazon Resource Name (ARN) that identifies the activity. * **name** *(string) --* The name of the activity. A name must *not* contain: * white space * brackets "< > { } [ ]" * wildcard characters "? *" * special characters "" # % \ ^ | ~ ` $ & , ; : /" * control characters ( "U+0000-001F", "U+007F-009F", "U +FFFE-FFFF") * surrogates ( "U+D800-DFFF") * invalid characters ( `` U+10FFFF``) To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. * **creationDate** *(datetime) --* The date the activity is created. * **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.InvalidToken" SFN / Client / delete_state_machine_alias delete_state_machine_alias ************************** SFN.Client.delete_state_machine_alias(**kwargs) 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** response = client.delete_state_machine_alias( stateMachineAliasArn='string' ) Parameters: **stateMachineAliasArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the state machine alias to delete. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "SFN.Client.exceptions.ValidationException" * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.ResourceNotFound" * "SFN.Client.exceptions.ConflictException" SFN / Client / list_state_machines list_state_machines ******************* SFN.Client.list_state_machines(**kwargs) Lists the existing state machines. 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. See also: AWS API Documentation **Request Syntax** response = client.list_state_machines( maxResults=123, nextToken='string' ) Parameters: * **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. Return type: dict Returns: **Response Syntax** { 'stateMachines': [ { 'stateMachineArn': 'string', 'name': 'string', 'type': 'STANDARD'|'EXPRESS', 'creationDate': datetime(2015, 1, 1) }, ], 'nextToken': 'string' } **Response Structure** * *(dict) --* * **stateMachines** *(list) --* * *(dict) --* Contains details about the state machine. * **stateMachineArn** *(string) --* The Amazon Resource Name (ARN) that identifies the state machine. * **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", "U +FFFE-FFFF") * surrogates ( "U+D800-DFFF") * invalid characters ( `` U+10FFFF``) To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. * **type** *(string) --* * **creationDate** *(datetime) --* The date the state machine is created. * **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.InvalidToken" SFN / Client / validate_state_machine_definition validate_state_machine_definition ********************************* SFN.Client.validate_state_machine_definition(**kwargs) Validates the syntax of a state machine definition specified in Amazon States Language (ASL), a JSON-based, structured language. You can validate that a state machine definition is correct without creating a state machine resource. Suggested uses for "ValidateStateMachineDefinition": * Integrate automated checks into your code review or Continuous Integration (CI) process to check state machine definitions before starting deployments. * Run validation from a Git pre-commit hook to verify the definition before committing to your source repository. Validation will look for problems in your state machine definition and return a **result** and a list of **diagnostic elements**. The **result** value will be "OK" when your workflow definition can be successfully created or updated. Note the result can be "OK" even when diagnostic warnings are present in the response. The **result** value will be "FAIL" when the workflow definition contains errors that would prevent you from creating or updating your state machine. The list of ValidateStateMachineDefinitionDiagnostic data elements can contain zero or more **WARNING** and/or **ERROR** elements. Note: The **ValidateStateMachineDefinition API** might add new diagnostics in the future, adjust diagnostic codes, or change the message wording. Your automated processes should only rely on the value of the **result** field value (OK, FAIL). Do **not** rely on the exact order, count, or wording of diagnostic messages. See also: AWS API Documentation **Request Syntax** response = client.validate_state_machine_definition( definition='string', type='STANDARD'|'EXPRESS', severity='ERROR'|'WARNING', maxResults=123 ) Parameters: * **definition** (*string*) -- **[REQUIRED]** The Amazon States Language definition of the state machine. For more information, see Amazon States Language (ASL). * **type** (*string*) -- The target type of state machine for this definition. The default is "STANDARD". * **severity** (*string*) -- Minimum level of diagnostics to return. "ERROR" returns only "ERROR" diagnostics, whereas "WARNING" returns both "WARNING" and "ERROR" diagnostics. The default is "ERROR". * **maxResults** (*integer*) -- The maximum number of diagnostics that are returned per call. The default and maximum value is 100. Setting the value to 0 will also use the default of 100. If the number of diagnostics returned in the response exceeds "maxResults", the value of the "truncated" field in the response will be set to "true". Return type: dict Returns: **Response Syntax** { 'result': 'OK'|'FAIL', 'diagnostics': [ { 'severity': 'ERROR'|'WARNING', 'code': 'string', 'message': 'string', 'location': 'string' }, ], 'truncated': True|False } **Response Structure** * *(dict) --* * **result** *(string) --* The result value will be "OK" when no syntax errors are found, or "FAIL" if the workflow definition does not pass verification. * **diagnostics** *(list) --* An array of diagnostic errors and warnings found during validation of the state machine definition. Since **warnings** do not prevent deploying your workflow definition, the **result** value could be "OK" even when warning diagnostics are present in the response. * *(dict) --* Describes potential issues found during state machine validation. Rather than raise an exception, validation will return a list of **diagnostic elements** containing diagnostic information. Note: The ValidateStateMachineDefinitionlAPI might add new diagnostics in the future, adjust diagnostic codes, or change the message wording. Your automated processes should only rely on the value of the **result** field value (OK, FAIL). Do **not** rely on the exact order, count, or wording of diagnostic messages. **List of warning codes** NO_DOLLAR No ".$" on a field that appears to be a JSONPath or Intrinsic Function. NO_PATH Field value looks like a path, but field name does not end with 'Path'. PASS_RESULT_IS_STATIC Attempt to use a path in the result of a pass state. **List of error codes** INVALID_JSON_DESCRIPTION JSON syntax problem found. MISSING_DESCRIPTION Received a null or empty workflow input. SCHEMA_VALIDATION_FAILED Schema validation reported errors. INVALID_RESOURCE The value of a Task-state resource field is invalid. MISSING_END_STATE The workflow does not have a terminal state. DUPLICATE_STATE_NAME The same state name appears more than once. INVALID_STATE_NAME The state name does not follow the naming convention. STATE_MACHINE_NAME_EMPTY The state machine name has not been specified. STATE_MACHINE_NAME_INVALID The state machine name does not follow the naming convention. STATE_MACHINE_NAME_TOO_LONG The state name exceeds the allowed length. STATE_MACHINE_NAME_ALREADY_EXISTS The state name already exists. DUPLICATE_LABEL_NAME A label name appears more than once. INVALID_LABEL_NAME You have provided an invalid label name. MISSING_TRANSITION_TARGET The value of "Next" field doesn't match a known state name. TOO_DEEPLY_NESTED The states are too deeply nested. * **severity** *(string) --* A value of "ERROR" means that you cannot create or update a state machine with this definition. "WARNING" level diagnostics alert you to potential issues, but they will not prevent you from creating or updating your state machine. * **code** *(string) --* Identifying code for the diagnostic. * **message** *(string) --* Message describing the diagnostic condition. * **location** *(string) --* Location of the issue in the state machine, if available. For errors specific to a field, the location could be in the format: "/States//", for example: "/States/FailState/ErrorPath". * **truncated** *(boolean) --* The result value will be "true" if the number of diagnostics found in the workflow definition exceeds "maxResults". When all diagnostics results are returned, the value will be "false". **Exceptions** * "SFN.Client.exceptions.ValidationException" SFN / Client / describe_execution describe_execution ****************** SFN.Client.describe_execution(**kwargs) 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** response = client.describe_execution( executionArn='string', includedData='ALL_DATA'|'METADATA_ONLY' ) Parameters: * **executionArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the execution to describe. * **includedData** (*string*) -- If your state machine definition is encrypted with a KMS key, callers must have "kms:Decrypt" permission to decrypt the definition. Alternatively, you can call DescribeStateMachine API with "includedData = METADATA_ONLY" to get a successful response without the encrypted definition. Return type: 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", "U +FFFE-FFFF") * surrogates ( "U+D800-DFFF") * invalid characters ( `` U+10FFFF``) 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. Note: For X-Ray traces, all Amazon Web Services services use the "X-Amzn-Trace-Id" header from the HTTP request. Using the header is the preferred mechanism to identify a trace. "StartExecution" and "StartSyncExecution" API operations can also use "traceHeader" from the body of the request payload. If **both** sources are provided, Step Functions will use the **header value** (preferred) over the value in the request body. * **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 only updated if you successfully redrive an execution. * **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. **Exceptions** * "SFN.Client.exceptions.ExecutionDoesNotExist" * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.KmsAccessDeniedException" * "SFN.Client.exceptions.KmsInvalidStateException" * "SFN.Client.exceptions.KmsThrottlingException" SFN / Client / stop_execution stop_execution ************** SFN.Client.stop_execution(**kwargs) Stops an execution. This API action is not supported by "EXPRESS" state machines. For an execution with encryption enabled, Step Functions will encrypt the error and cause fields using the KMS key for the execution role. A caller can stop an execution without using any KMS permissions in the execution role if the caller provides a null value for both "error" and "cause" fields because no data needs to be encrypted. See also: AWS API Documentation **Request Syntax** response = client.stop_execution( executionArn='string', error='string', cause='string' ) Parameters: * **executionArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the execution to stop. * **error** (*string*) -- The error code of the failure. * **cause** (*string*) -- A more detailed explanation of the cause of the failure. Return type: dict Returns: **Response Syntax** { 'stopDate': datetime(2015, 1, 1) } **Response Structure** * *(dict) --* * **stopDate** *(datetime) --* The date the execution is stopped. **Exceptions** * "SFN.Client.exceptions.ExecutionDoesNotExist" * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.ValidationException" * "SFN.Client.exceptions.KmsAccessDeniedException" * "SFN.Client.exceptions.KmsInvalidStateException" * "SFN.Client.exceptions.KmsThrottlingException" SFN / Client / create_state_machine create_state_machine ******************** SFN.Client.create_state_machine(**kwargs) 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. For additional control over security, you can encrypt your data using a **customer-managed key** for Step Functions state machines. You can configure a symmetric KMS key and data key reuse period when creating or updating a **State Machine**. The execution history and state machine definition will be encrypted with the key applied to the State Machine. Note: This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes. Note: "CreateStateMachine" is an idempotent API. Subsequent requests won’t create a duplicate resource if it was already created. "CreateStateMachine"'s idempotency check is based on the state machine "name", "definition", "type", "LoggingConfiguration", "TracingConfiguration", and "EncryptionConfiguration" The check is also based on the "publish" and "versionDescription" parameters. If a following request has a different "roleArn" or "tags", Step Functions will ignore these differences and treat it as an idempotent request of the previous. In this case, "roleArn" and "tags" will not be updated, even if they are different. See also: AWS API Documentation **Request Syntax** response = 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', encryptionConfiguration={ 'kmsKeyId': 'string', 'kmsDataKeyReusePeriodSeconds': 123, 'type': 'AWS_OWNED_KEY'|'CUSTOMER_MANAGED_KMS_KEY' } ) Parameters: * **name** (*string*) -- **[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", "U+FFFE- FFFF") * surrogates ( "U+D800-DFFF") * invalid characters ( `` U+10FFFF``) To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. * **definition** (*string*) -- **[REQUIRED]** The Amazon States Language definition of the state machine. See Amazon States Language. * **roleArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the IAM role to use for this state machine. * **type** (*string*) -- 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. * **loggingConfiguration** (*dict*) -- Defines what execution history events are logged and where they are logged. Note: By default, the "level" is set to "OFF". For more information see Log Levels in the Step Functions User Guide. * **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 ":*" * **tags** (*list*) -- 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. * **tracingConfiguration** (*dict*) -- Selects whether X-Ray tracing is enabled. * **enabled** *(boolean) --* When set to "true", X-Ray tracing is enabled. * **publish** (*boolean*) -- Set to "true" to publish the first version of the state machine during creation. The default is "false". * **versionDescription** (*string*) -- 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". * **encryptionConfiguration** (*dict*) -- Settings to configure server-side encryption. * **kmsKeyId** *(string) --* An alias, alias ARN, key ID, or key ARN of a symmetric encryption KMS key to encrypt data. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN. * **kmsDataKeyReusePeriodSeconds** *(integer) --* Maximum duration that Step Functions will reuse data keys. When the period expires, Step Functions will call "GenerateDataKey". Only applies to customer managed keys. * **type** *(string) --* **[REQUIRED]** Encryption type Return type: 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. **Exceptions** * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.InvalidDefinition" * "SFN.Client.exceptions.InvalidName" * "SFN.Client.exceptions.InvalidLoggingConfiguration" * "SFN.Client.exceptions.InvalidTracingConfiguration" * "SFN.Client.exceptions.StateMachineAlreadyExists" * "SFN.Client.exceptions.StateMachineDeleting" * "SFN.Client.exceptions.StateMachineLimitExceeded" * "SFN.Client.exceptions.StateMachineTypeNotSupported" * "SFN.Client.exceptions.TooManyTags" * "SFN.Client.exceptions.ValidationException" * "SFN.Client.exceptions.ConflictException" * "SFN.Client.exceptions.InvalidEncryptionConfiguration" * "SFN.Client.exceptions.KmsAccessDeniedException" * "SFN.Client.exceptions.KmsThrottlingException" SFN / Client / publish_state_machine_version publish_state_machine_version ***************************** SFN.Client.publish_state_machine_version(**kwargs) 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** response = client.publish_state_machine_version( stateMachineArn='string', revisionId='string', description='string' ) Parameters: * **stateMachineArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the state machine. * **revisionId** (*string*) -- 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". Note: To specify an initial revision ID for a state machine with no revision ID assigned, specify the string "INITIAL" for the "revisionId" parameter. For example, you can specify a "revisionID" of "INITIAL" when you create a state machine using the CreateStateMachine API action. * **description** (*string*) -- An optional description of the state machine version. Return type: 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. **Exceptions** * "SFN.Client.exceptions.ValidationException" * "SFN.Client.exceptions.StateMachineDeleting" * "SFN.Client.exceptions.StateMachineDoesNotExist" * "SFN.Client.exceptions.ServiceQuotaExceededException" * "SFN.Client.exceptions.ConflictException" * "SFN.Client.exceptions.InvalidArn" SFN / Client / test_state test_state ********** SFN.Client.test_state(**kwargs) Accepts the definition of a single state and executes it. You can test a state without creating a state machine or updating an existing state machine. Using this API, you can test the following: * A state's input and output processing data flow * An Amazon Web Services service integration request and response * An HTTP Task request and response You can call this API on only one state at a time. The states that you can test include the following: * All Task types except Activity * Pass * Wait * Choice * Succeed * Fail The "TestState" API assumes an IAM role which must contain the required IAM permissions for the resources your state is accessing. For information about the permissions a state might need, see IAM permissions to test a state. The "TestState" API can run for up to five minutes. If the execution of a state exceeds this duration, it fails with the "States.Timeout" error. "TestState" doesn't support Activity tasks, ".sync" or ".waitForTaskToken" service integration patterns, Parallel, or Map states. See also: AWS API Documentation **Request Syntax** response = client.test_state( definition='string', roleArn='string', input='string', inspectionLevel='INFO'|'DEBUG'|'TRACE', revealSecrets=True|False, variables='string' ) Parameters: * **definition** (*string*) -- **[REQUIRED]** The Amazon States Language (ASL) definition of the state. * **roleArn** (*string*) -- The Amazon Resource Name (ARN) of the execution role with the required IAM permissions for the state. * **input** (*string*) -- A string that contains the JSON input data for the state. * **inspectionLevel** (*string*) -- Determines the values to return when a state is tested. You can specify one of the following types: * "INFO": Shows the final state output. By default, Step Functions sets "inspectionLevel" to "INFO" if you don't specify a level. * "DEBUG": Shows the final state output along with the input and output data processing result. * "TRACE": Shows the HTTP request and response for an HTTP Task. This level also shows the final state output along with the input and output data processing result. Each of these levels also provide information about the status of the state execution and the next state to transition to. * **revealSecrets** (*boolean*) -- Specifies whether or not to include secret information in the test result. For HTTP Tasks, a secret includes the data that an EventBridge connection adds to modify the HTTP request headers, query parameters, and body. Step Functions doesn't omit any information included in the state definition or the HTTP response. If you set "revealSecrets" to "true", you must make sure that the IAM user that calls the "TestState" API has permission for the "states:RevealSecrets" action. For an example of IAM policy that sets the "states:RevealSecrets" permission, see IAM permissions to test a state. Without this permission, Step Functions throws an access denied error. By default, "revealSecrets" is set to "false". * **variables** (*string*) -- JSON object literal that sets variables used in the state under test. Object keys are the variable names and values are the variable values. Return type: dict Returns: **Response Syntax** { 'output': 'string', 'error': 'string', 'cause': 'string', 'inspectionData': { 'input': 'string', 'afterArguments': 'string', 'afterInputPath': 'string', 'afterParameters': 'string', 'result': 'string', 'afterResultSelector': 'string', 'afterResultPath': 'string', 'request': { 'protocol': 'string', 'method': 'string', 'url': 'string', 'headers': 'string', 'body': 'string' }, 'response': { 'protocol': 'string', 'statusCode': 'string', 'statusMessage': 'string', 'headers': 'string', 'body': 'string' }, 'variables': 'string' }, 'nextState': 'string', 'status': 'SUCCEEDED'|'FAILED'|'RETRIABLE'|'CAUGHT_ERROR' } **Response Structure** * *(dict) --* * **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. * **error** *(string) --* The error returned when the execution of a state fails. * **cause** *(string) --* A detailed explanation of the cause for the error when the execution of a state fails. * **inspectionData** *(dict) --* Returns additional details about the state's execution, including its input and output data processing flow, and HTTP request and response information. The "inspectionLevel" request parameter specifies which details are returned. * **input** *(string) --* The raw state input. * **afterArguments** *(string) --* The input after Step Functions applies an Arguments filter. This event will only be present when QueryLanguage for the state machine or individual states is set to JSONata. For more info, see Transforming data with Step Functions. * **afterInputPath** *(string) --* The input after Step Functions applies the InputPath filter. Not populated when QueryLanguage is JSONata. * **afterParameters** *(string) --* The effective input after Step Functions applies the Parameters filter. Not populated when QueryLanguage is JSONata. * **result** *(string) --* The state's raw result. * **afterResultSelector** *(string) --* The effective result after Step Functions applies the ResultSelector filter. Not populated when QueryLanguage is JSONata. * **afterResultPath** *(string) --* The effective result combined with the raw state input after Step Functions applies the ResultPath filter. Not populated when QueryLanguage is JSONata. * **request** *(dict) --* The raw HTTP request that is sent when you test an HTTP Task. * **protocol** *(string) --* The protocol used to make the HTTP request. * **method** *(string) --* The HTTP method used for the HTTP request. * **url** *(string) --* The API endpoint used for the HTTP request. * **headers** *(string) --* The request headers associated with the HTTP request. * **body** *(string) --* The request body for the HTTP request. * **response** *(dict) --* The raw HTTP response that is returned when you test an HTTP Task. * **protocol** *(string) --* The protocol used to return the HTTP response. * **statusCode** *(string) --* The HTTP response status code for the HTTP response. * **statusMessage** *(string) --* The message associated with the HTTP status code. * **headers** *(string) --* The response headers associated with the HTTP response. * **body** *(string) --* The HTTP response returned. * **variables** *(string) --* JSON string that contains the set of workflow variables after execution of the state. The set will include variables assigned in the state and variables set up as test state input. * **nextState** *(string) --* The name of the next state to transition to. If you haven't defined a next state in your definition or if the execution of the state fails, this field doesn't contain a value. * **status** *(string) --* The execution status of the state. **Exceptions** * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.InvalidDefinition" * "SFN.Client.exceptions.InvalidExecutionInput" * "SFN.Client.exceptions.ValidationException" SFN / Client / list_tags_for_resource list_tags_for_resource ********************** SFN.Client.list_tags_for_resource(**kwargs) List tags for a given resource. Tags may only contain Unicode letters, digits, white space, or these symbols: "_ . : / = + - @". See also: AWS API Documentation **Request Syntax** response = client.list_tags_for_resource( resourceArn='string' ) Parameters: **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) for the Step Functions state machine or activity. Return type: dict Returns: **Response Syntax** { 'tags': [ { 'key': 'string', 'value': 'string' }, ] } **Response Structure** * *(dict) --* * **tags** *(list) --* An array of tags associated with the resource. * *(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. **Exceptions** * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.ResourceNotFound" SFN / Client / untag_resource untag_resource ************** SFN.Client.untag_resource(**kwargs) Remove a tag from a Step Functions resource See also: AWS API Documentation **Request Syntax** response = client.untag_resource( resourceArn='string', tagKeys=[ 'string', ] ) Parameters: * **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) for the Step Functions state machine or activity. * **tagKeys** (*list*) -- **[REQUIRED]** The list of tags to remove from the resource. * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.ResourceNotFound" SFN / Client / get_waiter get_waiter ********** SFN.Client.get_waiter(waiter_name) Returns an object that can wait for some condition. Parameters: **waiter_name** (*str*) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters. Returns: The specified waiter object. Return type: "botocore.waiter.Waiter" SFN / Client / start_execution start_execution *************** SFN.Client.start_execution(**kwargs) Starts a state machine execution. 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" Note: If you provide a qualified state machine ARN that refers to a *Distributed Map state*, the request fails with "ValidationException". * The following qualified state machine ARN refers to an alias named "PROD". "arn::states:::stateMachine:" Note: If you provide a qualified state machine ARN that refers to a version ARN or an alias ARN, the request starts execution for that version or alias. * The following unqualified state machine ARN refers to a state machine named "myStateMachine". "arn::states:::stateMachine:" If you start an execution with an unqualified state machine ARN, Step Functions uses the latest revision of the state machine for the execution. To start executions of a state machine version, call "StartExecution" and provide the version ARN or the ARN of an alias that points to the version. Note: "StartExecution" is idempotent for "STANDARD" workflows. For a "STANDARD" workflow, if you call "StartExecution" with the same name and input as a running execution, the call succeeds and return the same response as the original request. If the execution is closed or if the input is different, it returns a "400 ExecutionAlreadyExists" error. You can reuse names after 90 days."StartExecution" isn't idempotent for "EXPRESS" workflows. See also: AWS API Documentation **Request Syntax** response = client.start_execution( stateMachineArn='string', name='string', input='string', traceHeader='string' ) Parameters: * **stateMachineArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the state machine to execute. The "stateMachineArn" parameter accepts one of the following inputs: * **An unqualified state machine ARN** – Refers to a state machine ARN that isn't qualified with a version or alias ARN. The following is an example of an unqualified state machine ARN. "arn::states:::stateMachine:" Step Functions doesn't associate state machine executions that you start with an unqualified ARN with a version. This is true even if that version uses the same revision that the execution used. * **A state machine version ARN** – Refers to a version ARN, which is a combination of state machine ARN and the version number separated by a colon (:). The following is an example of the ARN for version 10. "arn::states:::stateMachine::10" Step Functions doesn't associate executions that you start with a version ARN with any aliases that point to that version. * **A state machine alias ARN** – Refers to an alias ARN, which is a combination of state machine ARN and the alias name separated by a colon (:). The following is an example of the ARN for an alias named "PROD". "arn::states:::stateMachine:" Step Functions associates executions that you start with an alias ARN with that alias and the state machine version used for that execution. * **name** (*string*) -- Optional name of the execution. This name must be unique for your Amazon Web Services account, Region, and state machine for 90 days. For more information, see Limits Related to State Machine Executions in the *Step Functions Developer Guide*. If you don't provide a name for the execution, Step Functions automatically generates a universally unique identifier (UUID) as the execution name. A name must *not* contain: * white space * brackets "< > { } [ ]" * wildcard characters "? *" * special characters "" # % \ ^ | ~ ` $ & , ; : /" * control characters ( "U+0000-001F", "U+007F-009F", "U+FFFE- FFFF") * surrogates ( "U+D800-DFFF") * invalid characters ( `` U+10FFFF``) To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. * **input** (*string*) -- The string that contains the JSON input data for the execution, for example: ""{\"first_name\" : \"Alejandro\"}"" Note: If you don't include any JSON input data, you still must include the two braces, for example: ""{}"" Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding. * **traceHeader** (*string*) -- Passes the X-Ray trace header. The trace header can also be passed in the request payload. Note: For X-Ray traces, all Amazon Web Services services use the "X-Amzn-Trace-Id" header from the HTTP request. Using the header is the preferred mechanism to identify a trace. "StartExecution" and "StartSyncExecution" API operations can also use "traceHeader" from the body of the request payload. If **both** sources are provided, Step Functions will use the **header value** (preferred) over the value in the request body. Return type: dict Returns: **Response Syntax** { 'executionArn': 'string', 'startDate': datetime(2015, 1, 1) } **Response Structure** * *(dict) --* * **executionArn** *(string) --* The Amazon Resource Name (ARN) that identifies the execution. * **startDate** *(datetime) --* The date the execution is started. **Exceptions** * "SFN.Client.exceptions.ExecutionLimitExceeded" * "SFN.Client.exceptions.ExecutionAlreadyExists" * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.InvalidExecutionInput" * "SFN.Client.exceptions.InvalidName" * "SFN.Client.exceptions.StateMachineDoesNotExist" * "SFN.Client.exceptions.StateMachineDeleting" * "SFN.Client.exceptions.ValidationException" * "SFN.Client.exceptions.KmsAccessDeniedException" * "SFN.Client.exceptions.KmsInvalidStateException" * "SFN.Client.exceptions.KmsThrottlingException" SFN / Client / send_task_heartbeat send_task_heartbeat ******************* SFN.Client.send_task_heartbeat(**kwargs) Used by activity workers and Task states using the callback pattern, and optionally Task states using the job run pattern to report to Step Functions that the task represented by the specified "taskToken" is still making progress. This action resets the "Heartbeat" clock. The "Heartbeat" threshold is specified in the state machine's Amazon States Language definition ( "HeartbeatSeconds"). This action does not in itself create an event in the execution history. However, if the task times out, the execution history contains an "ActivityTimedOut" entry for activities, or a "TaskTimedOut" entry for tasks using the job run or callback pattern. Note: The "Timeout" of a task, defined in the state machine's Amazon States Language definition, is its maximum allowed duration, regardless of the number of SendTaskHeartbeat requests received. Use "HeartbeatSeconds" to configure the timeout interval for heartbeats. See also: AWS API Documentation **Request Syntax** response = client.send_task_heartbeat( taskToken='string' ) Parameters: **taskToken** (*string*) -- **[REQUIRED]** The token that represents this task. Task tokens are generated by Step Functions when tasks are assigned to a worker, or in the context object when a workflow enters a task state. See GetActivityTaskOutput$taskToken. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "SFN.Client.exceptions.TaskDoesNotExist" * "SFN.Client.exceptions.InvalidToken" * "SFN.Client.exceptions.TaskTimedOut" SFN / Client / list_executions list_executions *************** SFN.Client.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. 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** response = client.list_executions( stateMachineArn='string', statusFilter='RUNNING'|'SUCCEEDED'|'FAILED'|'TIMED_OUT'|'ABORTED'|'PENDING_REDRIVE', maxResults=123, nextToken='string', mapRunArn='string', redriveFilter='REDRIVEN'|'NOT_REDRIVEN' ) 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. 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. * **statusFilter** (*string*) -- If specified, only list the executions whose current execution status matches the given filter. If you provide a "PENDING_REDRIVE" statusFilter, you must specify "mapRunArn". For more information, see Child workflow execution redrive behaviour in the *Step Functions Developer Guide*. If you provide a stateMachineArn and a "PENDING_REDRIVE" statusFilter, the API returns a validation exception. * **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. * **redriveFilter** (*string*) -- 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. Return type: 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", "U +FFFE-FFFF") * surrogates ( "U+D800-DFFF") * invalid characters ( `` U+10FFFF``) 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 only updated when you successfully redrive an execution. * **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. **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" SFN / Client / delete_activity delete_activity *************** SFN.Client.delete_activity(**kwargs) Deletes an activity. See also: AWS API Documentation **Request Syntax** response = client.delete_activity( activityArn='string' ) Parameters: **activityArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the activity to delete. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "SFN.Client.exceptions.InvalidArn" SFN / Client / redrive_execution redrive_execution ***************** SFN.Client.redrive_execution(**kwargs) 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 whose Map Run failed, you must redrive the parent workflow. The parent workflow redrives all the unsuccessful states, including a failed Map Run. If a Map Run was not started in the original execution attempt, the redriven parent workflow starts the Map Run. 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** response = client.redrive_execution( executionArn='string', clientToken='string' ) Parameters: * **executionArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the execution to be redriven. * **clientToken** (*string*) -- 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 will return idempotent responses for the last 10 client tokens used to successfully redrive the execution. These client tokens are valid for up to 15 minutes after they are first used. This field is autopopulated if not provided. Return type: dict Returns: **Response Syntax** { 'redriveDate': datetime(2015, 1, 1) } **Response Structure** * *(dict) --* * **redriveDate** *(datetime) --* The date the execution was last redriven. **Exceptions** * "SFN.Client.exceptions.ExecutionDoesNotExist" * "SFN.Client.exceptions.ExecutionNotRedrivable" * "SFN.Client.exceptions.ExecutionLimitExceeded" * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.ValidationException" SFN / Client / list_state_machine_aliases list_state_machine_aliases ************************** SFN.Client.list_state_machine_aliases(**kwargs) 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** response = client.list_state_machine_aliases( stateMachineArn='string', nextToken='string', maxResults=123 ) Parameters: * **stateMachineArn** (*string*) -- **[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. * **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. * **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. Return type: 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. **Exceptions** * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.InvalidToken" * "SFN.Client.exceptions.ResourceNotFound" * "SFN.Client.exceptions.StateMachineDoesNotExist" * "SFN.Client.exceptions.StateMachineDeleting" SFN / Client / describe_map_run describe_map_run **************** SFN.Client.describe_map_run(**kwargs) 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** response = client.describe_map_run( mapRunArn='string' ) Parameters: **mapRunArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) that identifies a Map Run. Return type: 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, child workflows with an execution status of "FAILED", "ABORTED", or "TIMED_OUT" and a "redriveStatus" of "NOT_REDRIVABLE". * **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, child workflows with an execution status of "FAILED", "ABORTED", or "TIMED_OUT" and a "redriveStatus" of "NOT_REDRIVABLE". * **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 only updated if you successfully redrive a Map Run. * **redriveDate** *(datetime) --* The date a Map Run was last redriven. If you have not yet redriven a Map Run, the "redriveDate" is null. **Exceptions** * "SFN.Client.exceptions.ResourceNotFound" * "SFN.Client.exceptions.InvalidArn" SFN / Client / send_task_failure send_task_failure ***************** SFN.Client.send_task_failure(**kwargs) Used by activity workers, Task states using the callback pattern, and optionally Task states using the job run pattern to report that the task identified by the "taskToken" failed. For an execution with encryption enabled, Step Functions will encrypt the error and cause fields using the KMS key for the execution role. A caller can mark a task as fail without using any KMS permissions in the execution role if the caller provides a null value for both "error" and "cause" fields because no data needs to be encrypted. See also: AWS API Documentation **Request Syntax** response = client.send_task_failure( taskToken='string', error='string', cause='string' ) Parameters: * **taskToken** (*string*) -- **[REQUIRED]** The token that represents this task. Task tokens are generated by Step Functions when tasks are assigned to a worker, or in the context object when a workflow enters a task state. See GetActivityTaskOutput$taskToken. * **error** (*string*) -- The error code of the failure. * **cause** (*string*) -- A more detailed explanation of the cause of the failure. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "SFN.Client.exceptions.TaskDoesNotExist" * "SFN.Client.exceptions.InvalidToken" * "SFN.Client.exceptions.TaskTimedOut" * "SFN.Client.exceptions.KmsAccessDeniedException" * "SFN.Client.exceptions.KmsInvalidStateException" * "SFN.Client.exceptions.KmsThrottlingException" SFN / Client / start_sync_execution start_sync_execution ******************** SFN.Client.start_sync_execution(**kwargs) Starts a Synchronous Express state machine execution. "StartSyncExecution" is not available for "STANDARD" workflows. Note: "StartSyncExecution" will return a "200 OK" response, even if your execution fails, because the status code in the API response doesn't reflect function errors. Error codes are reserved for errors that prevent your execution from running, such as permissions errors, limit errors, or issues with your state machine code and configuration. Note: This API action isn't logged in CloudTrail. See also: AWS API Documentation **Request Syntax** response = client.start_sync_execution( stateMachineArn='string', name='string', input='string', traceHeader='string', includedData='ALL_DATA'|'METADATA_ONLY' ) Parameters: * **stateMachineArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the state machine to execute. * **name** (*string*) -- The name of the execution. * **input** (*string*) -- The string that contains the JSON input data for the execution, for example: ""{\"first_name\" : \"Alejandro\"}"" Note: If you don't include any JSON input data, you still must include the two braces, for example: ""{}"" Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding. * **traceHeader** (*string*) -- Passes the X-Ray trace header. The trace header can also be passed in the request payload. Note: For X-Ray traces, all Amazon Web Services services use the "X-Amzn-Trace-Id" header from the HTTP request. Using the header is the preferred mechanism to identify a trace. "StartExecution" and "StartSyncExecution" API operations can also use "traceHeader" from the body of the request payload. If **both** sources are provided, Step Functions will use the **header value** (preferred) over the value in the request body. * **includedData** (*string*) -- If your state machine definition is encrypted with a KMS key, callers must have "kms:Decrypt" permission to decrypt the definition. Alternatively, you can call the API with "includedData = METADATA_ONLY" to get a successful response without the encrypted definition. Return type: dict Returns: **Response Syntax** { 'executionArn': 'string', 'stateMachineArn': 'string', 'name': 'string', 'startDate': datetime(2015, 1, 1), 'stopDate': datetime(2015, 1, 1), 'status': 'SUCCEEDED'|'FAILED'|'TIMED_OUT', 'error': 'string', 'cause': 'string', 'input': 'string', 'inputDetails': { 'included': True|False }, 'output': 'string', 'outputDetails': { 'included': True|False }, 'traceHeader': 'string', 'billingDetails': { 'billedMemoryUsedInMB': 123, 'billedDurationInMilliseconds': 123 } } **Response Structure** * *(dict) --* * **executionArn** *(string) --* The Amazon Resource Name (ARN) that identifies the execution. * **stateMachineArn** *(string) --* The Amazon Resource Name (ARN) that identifies the state machine. * **name** *(string) --* The name of the execution. * **startDate** *(datetime) --* The date the execution is started. * **stopDate** *(datetime) --* If the execution has already ended, the date the execution stopped. * **status** *(string) --* The current status of the execution. * **error** *(string) --* The error code of the failure. * **cause** *(string) --* A more detailed explanation of the cause of the failure. * **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. Note: For X-Ray traces, all Amazon Web Services services use the "X-Amzn-Trace-Id" header from the HTTP request. Using the header is the preferred mechanism to identify a trace. "StartExecution" and "StartSyncExecution" API operations can also use "traceHeader" from the body of the request payload. If **both** sources are provided, Step Functions will use the **header value** (preferred) over the value in the request body. * **billingDetails** *(dict) --* An object that describes workflow billing details, including billed duration and memory use. * **billedMemoryUsedInMB** *(integer) --* Billed memory consumption of your workflow, in MB. * **billedDurationInMilliseconds** *(integer) --* Billed duration of your workflow, in milliseconds. **Exceptions** * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.InvalidExecutionInput" * "SFN.Client.exceptions.InvalidName" * "SFN.Client.exceptions.StateMachineDoesNotExist" * "SFN.Client.exceptions.StateMachineDeleting" * "SFN.Client.exceptions.StateMachineTypeNotSupported" * "SFN.Client.exceptions.KmsAccessDeniedException" * "SFN.Client.exceptions.KmsInvalidStateException" * "SFN.Client.exceptions.KmsThrottlingException" SFN / Client / update_state_machine_alias update_state_machine_alias ************************** SFN.Client.update_state_machine_alias(**kwargs) 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. Note: "UpdateStateMachineAlias" is an idempotent API. Step Functions bases the idempotency check on the "stateMachineAliasArn", "description", and "routingConfiguration" parameters. Requests with the same parameters return an idempotent response. Note: This operation is eventually consistent. All StartExecution requests made within a few seconds use the latest alias configuration. Executions started immediately after calling "UpdateStateMachineAlias" may use the previous routing configuration. **Related operations:** * CreateStateMachineAlias * DescribeStateMachineAlias * ListStateMachineAliases * DeleteStateMachineAlias See also: AWS API Documentation **Request Syntax** response = client.update_state_machine_alias( stateMachineAliasArn='string', description='string', routingConfiguration=[ { 'stateMachineVersionArn': 'string', 'weight': 123 }, ] ) Parameters: * **stateMachineAliasArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the state machine alias. * **description** (*string*) -- A description of the state machine alias. * **routingConfiguration** (*list*) -- 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 a state machine version. The sum of the weights in the routing configuration must be equal to 100. Return type: dict Returns: **Response Syntax** { 'updateDate': datetime(2015, 1, 1) } **Response Structure** * *(dict) --* * **updateDate** *(datetime) --* The date and time the state machine alias was updated. **Exceptions** * "SFN.Client.exceptions.ValidationException" * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.ResourceNotFound" * "SFN.Client.exceptions.ConflictException" * "SFN.Client.exceptions.StateMachineDeleting" SFN / Client / close close ***** SFN.Client.close() Closes underlying endpoint connections. SFN / Client / list_map_runs list_map_runs ************* SFN.Client.list_map_runs(**kwargs) Lists all Map Runs that were started by a given state machine execution. Use this API action to obtain Map Run ARNs, and then call "DescribeMapRun" to obtain more information, if needed. See also: AWS API Documentation **Request Syntax** response = client.list_map_runs( executionArn='string', maxResults=123, nextToken='string' ) Parameters: * **executionArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the execution for which the Map Runs must be listed. * **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. Return type: dict Returns: **Response Syntax** { 'mapRuns': [ { 'executionArn': 'string', 'mapRunArn': 'string', 'stateMachineArn': 'string', 'startDate': datetime(2015, 1, 1), 'stopDate': datetime(2015, 1, 1) }, ], 'nextToken': 'string' } **Response Structure** * *(dict) --* * **mapRuns** *(list) --* An array that lists information related to a Map Run, such as the Amazon Resource Name (ARN) of the Map Run and the ARN of the state machine that started the Map Run. * *(dict) --* Contains details about a specific Map Run. * **executionArn** *(string) --* The "executionArn" of the execution from which the Map Run was started. * **mapRunArn** *(string) --* The Amazon Resource Name (ARN) of the Map Run. * **stateMachineArn** *(string) --* The Amazon Resource Name (ARN) of the executed state machine. * **startDate** *(datetime) --* The date on which the Map Run started. * **stopDate** *(datetime) --* The date on which the Map Run stopped. * **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.ExecutionDoesNotExist" * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.InvalidToken" SFN / Client / get_activity_task get_activity_task ***************** SFN.Client.get_activity_task(**kwargs) Used by workers to retrieve a task (with the specified activity ARN) which has been scheduled for execution by a running state machine. This initiates a long poll, where the service holds the HTTP connection open and responds as soon as a task becomes available (i.e. an execution of a task of this type is needed.) The maximum time the service holds on to the request before responding is 60 seconds. If no task is available within 60 seconds, the poll returns a "taskToken" with a null string. Note: This API action isn't logged in CloudTrail. Warning: Workers should set their client side socket timeout to at least 65 seconds (5 seconds higher than the maximum time the service may hold the poll request).Polling with "GetActivityTask" can cause latency in some implementations. See Avoid Latency When Polling for Activity Tasks in the Step Functions Developer Guide. See also: AWS API Documentation **Request Syntax** response = client.get_activity_task( activityArn='string', workerName='string' ) Parameters: * **activityArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the activity to retrieve tasks from (assigned when you create the task using CreateActivity.) * **workerName** (*string*) -- You can provide an arbitrary name in order to identify the worker that the task is assigned to. This name is used when it is logged in the execution history. Return type: dict Returns: **Response Syntax** { 'taskToken': 'string', 'input': 'string' } **Response Structure** * *(dict) --* * **taskToken** *(string) --* A token that identifies the scheduled task. This token must be copied and included in subsequent calls to SendTaskHeartbeat, SendTaskSuccess or SendTaskFailure in order to report the progress or completion of the task. * **input** *(string) --* The string that contains the JSON input data for the task. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding. **Exceptions** * "SFN.Client.exceptions.ActivityDoesNotExist" * "SFN.Client.exceptions.ActivityWorkerLimitExceeded" * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.KmsAccessDeniedException" * "SFN.Client.exceptions.KmsInvalidStateException" * "SFN.Client.exceptions.KmsThrottlingException" SFN / Client / update_state_machine update_state_machine ******************** SFN.Client.update_state_machine(**kwargs) Updates an existing state machine by modifying its "definition", "roleArn", "loggingConfiguration", or "EncryptionConfiguration". 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" Note: If you provide a qualified state machine ARN that refers to a *Distributed Map state*, the request fails with "ValidationException". * The following qualified state machine ARN refers to an alias named "PROD". "arn::states:::stateMachine:" Note: If you provide a qualified state machine ARN that refers to a version ARN or an alias ARN, the request starts execution for that version or alias. * The following unqualified state machine ARN refers to a state machine named "myStateMachine". "arn::states:::stateMachine:" 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. Note: Step Functions assigns monotonically increasing integers for state machine versions, starting at version number 1. Note: All "StartExecution" calls within a few seconds use the updated "definition" and "roleArn". Executions started immediately after you call "UpdateStateMachine" may use the previous state machine "definition" and "roleArn". See also: AWS API Documentation **Request Syntax** response = 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', encryptionConfiguration={ 'kmsKeyId': 'string', 'kmsDataKeyReusePeriodSeconds': 123, 'type': 'AWS_OWNED_KEY'|'CUSTOMER_MANAGED_KMS_KEY' } ) Parameters: * **stateMachineArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) 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 of the state machine. * **loggingConfiguration** (*dict*) -- 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 ":*" * **tracingConfiguration** (*dict*) -- Selects whether X-Ray tracing is enabled. * **enabled** *(boolean) --* When set to "true", X-Ray tracing is enabled. * **publish** (*boolean*) -- 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". * **versionDescription** (*string*) -- An optional description of the state machine version to publish. You can only specify the "versionDescription" parameter if you've set "publish" to "true". * **encryptionConfiguration** (*dict*) -- Settings to configure server-side encryption. * **kmsKeyId** *(string) --* An alias, alias ARN, key ID, or key ARN of a symmetric encryption KMS key to encrypt data. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN. * **kmsDataKeyReusePeriodSeconds** *(integer) --* Maximum duration that Step Functions will reuse data keys. When the period expires, Step Functions will call "GenerateDataKey". Only applies to customer managed keys. * **type** *(string) --* **[REQUIRED]** Encryption type Return type: 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. **Exceptions** * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.InvalidDefinition" * "SFN.Client.exceptions.InvalidLoggingConfiguration" * "SFN.Client.exceptions.InvalidTracingConfiguration" * "SFN.Client.exceptions.MissingRequiredParameter" * "SFN.Client.exceptions.StateMachineDeleting" * "SFN.Client.exceptions.StateMachineDoesNotExist" * "SFN.Client.exceptions.ServiceQuotaExceededException" * "SFN.Client.exceptions.ConflictException" * "SFN.Client.exceptions.ValidationException" * "SFN.Client.exceptions.InvalidEncryptionConfiguration" * "SFN.Client.exceptions.KmsAccessDeniedException" * "SFN.Client.exceptions.KmsThrottlingException" SFN / Client / create_state_machine_alias create_state_machine_alias ************************** SFN.Client.create_state_machine_alias(**kwargs) 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** response = client.create_state_machine_alias( description='string', name='string', routingConfiguration=[ { 'stateMachineVersionArn': 'string', 'weight': 123 }, ] ) Parameters: * **description** (*string*) -- A description for the state machine alias. * **name** (*string*) -- **[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. * **routingConfiguration** (*list*) -- **[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 a state machine version. The sum of the weights in the routing configuration must be equal to 100. Return type: 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. **Exceptions** * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.InvalidName" * "SFN.Client.exceptions.ValidationException" * "SFN.Client.exceptions.StateMachineDeleting" * "SFN.Client.exceptions.ResourceNotFound" * "SFN.Client.exceptions.ConflictException" * "SFN.Client.exceptions.ServiceQuotaExceededException" SFN / Client / describe_activity describe_activity ***************** SFN.Client.describe_activity(**kwargs) Describes an activity. Note: This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes. See also: AWS API Documentation **Request Syntax** response = client.describe_activity( activityArn='string' ) Parameters: **activityArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the activity to describe. Return type: dict Returns: **Response Syntax** { 'activityArn': 'string', 'name': 'string', 'creationDate': datetime(2015, 1, 1), 'encryptionConfiguration': { 'kmsKeyId': 'string', 'kmsDataKeyReusePeriodSeconds': 123, 'type': 'AWS_OWNED_KEY'|'CUSTOMER_MANAGED_KMS_KEY' } } **Response Structure** * *(dict) --* * **activityArn** *(string) --* The Amazon Resource Name (ARN) that identifies the activity. * **name** *(string) --* The name of the activity. A name must *not* contain: * white space * brackets "< > { } [ ]" * wildcard characters "? *" * special characters "" # % \ ^ | ~ ` $ & , ; : /" * control characters ( "U+0000-001F", "U+007F-009F", "U +FFFE-FFFF") * surrogates ( "U+D800-DFFF") * invalid characters ( `` U+10FFFF``) To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. * **creationDate** *(datetime) --* The date the activity is created. * **encryptionConfiguration** *(dict) --* Settings for configured server-side encryption. * **kmsKeyId** *(string) --* An alias, alias ARN, key ID, or key ARN of a symmetric encryption KMS key to encrypt data. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN. * **kmsDataKeyReusePeriodSeconds** *(integer) --* Maximum duration that Step Functions will reuse data keys. When the period expires, Step Functions will call "GenerateDataKey". Only applies to customer managed keys. * **type** *(string) --* Encryption type **Exceptions** * "SFN.Client.exceptions.ActivityDoesNotExist" * "SFN.Client.exceptions.InvalidArn" SFN / Client / describe_state_machine_for_execution describe_state_machine_for_execution ************************************ SFN.Client.describe_state_machine_for_execution(**kwargs) 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. 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.describe_state_machine_for_execution( executionArn='string', includedData='ALL_DATA'|'METADATA_ONLY' ) Parameters: * **executionArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the execution you want state machine information for. * **includedData** (*string*) -- If your state machine definition is encrypted with a KMS key, callers must have "kms:Decrypt" permission to decrypt the definition. Alternatively, you can call the API with "includedData = METADATA_ONLY" to get a successful response without the encrypted definition. Return type: 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', 'encryptionConfiguration': { 'kmsKeyId': 'string', 'kmsDataKeyReusePeriodSeconds': 123, 'type': 'AWS_OWNED_KEY'|'CUSTOMER_MANAGED_KMS_KEY' }, 'variableReferences': { 'string': [ '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". * **encryptionConfiguration** *(dict) --* Settings to configure server-side encryption. * **kmsKeyId** *(string) --* An alias, alias ARN, key ID, or key ARN of a symmetric encryption KMS key to encrypt data. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN. * **kmsDataKeyReusePeriodSeconds** *(integer) --* Maximum duration that Step Functions will reuse data keys. When the period expires, Step Functions will call "GenerateDataKey". Only applies to customer managed keys. * **type** *(string) --* Encryption type * **variableReferences** *(dict) --* A map of **state name** to a list of variables referenced by that state. States that do not use variable references will not be shown in the response. * *(string) --* * *(list) --* * *(string) --* **Exceptions** * "SFN.Client.exceptions.ExecutionDoesNotExist" * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.KmsAccessDeniedException" * "SFN.Client.exceptions.KmsInvalidStateException" * "SFN.Client.exceptions.KmsThrottlingException" SFN / Client / tag_resource tag_resource ************ SFN.Client.tag_resource(**kwargs) Add a tag to a Step Functions resource. 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: "_ . : / = + - @". See also: AWS API Documentation **Request Syntax** response = client.tag_resource( resourceArn='string', tags=[ { 'key': 'string', 'value': 'string' }, ] ) Parameters: * **resourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) for the Step Functions state machine or activity. * **tags** (*list*) -- **[REQUIRED]** The list of tags to add to a resource. 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. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.ResourceNotFound" * "SFN.Client.exceptions.TooManyTags" SFN / Client / delete_state_machine delete_state_machine ******************** SFN.Client.delete_state_machine(**kwargs) Deletes a state machine. This is an asynchronous operation. It sets the state machine's status to "DELETING" and begins the deletion process. A state machine is deleted only when all its executions are completed. On the next state transition, the state machine's executions are terminated. 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" Note: If you provide a qualified state machine ARN that refers to a *Distributed Map state*, the request fails with "ValidationException". * The following unqualified state machine ARN refers to a state machine named "myStateMachine". "arn:partition:states:region :account-id:stateMachine:myStateMachine" This API action also deletes all versions and aliases associated with a state machine. Note: For "EXPRESS" state machines, the deletion happens eventually (usually in less than a minute). Running executions may emit logs after "DeleteStateMachine" API is called. See also: AWS API Documentation **Request Syntax** response = client.delete_state_machine( stateMachineArn='string' ) Parameters: **stateMachineArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the state machine to delete. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.ValidationException" SFN / Client / send_task_success send_task_success ***************** SFN.Client.send_task_success(**kwargs) Used by activity workers, Task states using the callback pattern, and optionally Task states using the job run pattern to report that the task identified by the "taskToken" completed successfully. See also: AWS API Documentation **Request Syntax** response = client.send_task_success( taskToken='string', output='string' ) Parameters: * **taskToken** (*string*) -- **[REQUIRED]** The token that represents this task. Task tokens are generated by Step Functions when tasks are assigned to a worker, or in the context object when a workflow enters a task state. See GetActivityTaskOutput$taskToken. * **output** (*string*) -- **[REQUIRED]** The JSON output of the task. Length constraints apply to the payload size, and are expressed as bytes in UTF-8 encoding. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "SFN.Client.exceptions.TaskDoesNotExist" * "SFN.Client.exceptions.InvalidOutput" * "SFN.Client.exceptions.InvalidToken" * "SFN.Client.exceptions.TaskTimedOut" * "SFN.Client.exceptions.KmsAccessDeniedException" * "SFN.Client.exceptions.KmsInvalidStateException" * "SFN.Client.exceptions.KmsThrottlingException" SFN / Client / create_activity create_activity *************** SFN.Client.create_activity(**kwargs) Creates an activity. An activity is a task that you write in any programming language and host on any machine that has access to Step Functions. Activities must poll Step Functions using the "GetActivityTask" API action and respond using "SendTask*" API actions. This function lets Step Functions know the existence of your activity and returns an identifier for use in a state machine and when polling from the activity. Note: This operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes. Note: "CreateActivity" is an idempotent API. Subsequent requests won’t create a duplicate resource if it was already created. "CreateActivity"'s idempotency check is based on the activity "name". If a following request has different "tags" values, Step Functions will ignore these differences and treat it as an idempotent request of the previous. In this case, "tags" will not be updated, even if they are different. See also: AWS API Documentation **Request Syntax** response = client.create_activity( name='string', tags=[ { 'key': 'string', 'value': 'string' }, ], encryptionConfiguration={ 'kmsKeyId': 'string', 'kmsDataKeyReusePeriodSeconds': 123, 'type': 'AWS_OWNED_KEY'|'CUSTOMER_MANAGED_KMS_KEY' } ) Parameters: * **name** (*string*) -- **[REQUIRED]** The name of the activity to create. This name must be unique for your Amazon Web Services account and region for 90 days. For more information, see Limits Related to State Machine Executions in the *Step Functions Developer Guide*. A name must *not* contain: * white space * brackets "< > { } [ ]" * wildcard characters "? *" * special characters "" # % \ ^ | ~ ` $ & , ; : /" * control characters ( "U+0000-001F", "U+007F-009F", "U+FFFE- FFFF") * surrogates ( "U+D800-DFFF") * invalid characters ( `` U+10FFFF``) To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z, a-z, - and _. * **tags** (*list*) -- The list of tags to add to a resource. 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. * **encryptionConfiguration** (*dict*) -- Settings to configure server-side encryption. * **kmsKeyId** *(string) --* An alias, alias ARN, key ID, or key ARN of a symmetric encryption KMS key to encrypt data. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN. * **kmsDataKeyReusePeriodSeconds** *(integer) --* Maximum duration that Step Functions will reuse data keys. When the period expires, Step Functions will call "GenerateDataKey". Only applies to customer managed keys. * **type** *(string) --* **[REQUIRED]** Encryption type Return type: dict Returns: **Response Syntax** { 'activityArn': 'string', 'creationDate': datetime(2015, 1, 1) } **Response Structure** * *(dict) --* * **activityArn** *(string) --* The Amazon Resource Name (ARN) that identifies the created activity. * **creationDate** *(datetime) --* The date the activity is created. **Exceptions** * "SFN.Client.exceptions.ActivityLimitExceeded" * "SFN.Client.exceptions.ActivityAlreadyExists" * "SFN.Client.exceptions.InvalidName" * "SFN.Client.exceptions.TooManyTags" * "SFN.Client.exceptions.InvalidEncryptionConfiguration" * "SFN.Client.exceptions.KmsAccessDeniedException" * "SFN.Client.exceptions.KmsThrottlingException" SFN / Client / delete_state_machine_version delete_state_machine_version **************************** SFN.Client.delete_state_machine_version(**kwargs) 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. Note: Deleting a state machine version won't terminate its in-progress executions. Note: You can't delete a state machine version currently referenced by one or more aliases. Before you delete a version, you must either delete the aliases or update them to point to another state machine version. **Related operations:** * PublishStateMachineVersion * ListStateMachineVersions See also: AWS API Documentation **Request Syntax** response = client.delete_state_machine_version( stateMachineVersionArn='string' ) Parameters: **stateMachineVersionArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the state machine version to delete. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "SFN.Client.exceptions.ValidationException" * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.ConflictException" SFN / Client / list_state_machine_versions list_state_machine_versions *************************** SFN.Client.list_state_machine_versions(**kwargs) 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** response = client.list_state_machine_versions( stateMachineArn='string', nextToken='string', maxResults=123 ) Parameters: * **stateMachineArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the state machine. * **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. * **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. Return type: 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. **Exceptions** * "SFN.Client.exceptions.ValidationException" * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.InvalidToken" SFN / Client / get_execution_history get_execution_history ********************* SFN.Client.get_execution_history(**kwargs) 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** response = client.get_execution_history( executionArn='string', maxResults=123, reverseOrder=True|False, nextToken='string', includeExecutionData=True|False ) Parameters: * **executionArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the execution. * **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. * **reverseOrder** (*boolean*) -- Lists events in descending order of their "timeStamp". * **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. * **includeExecutionData** (*boolean*) -- You can select whether execution data (input or output of a history event) is returned. The default is "true". Return type: 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'|'EvaluationFailed', '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 }, 'assignedVariables': { 'string': 'string' }, 'assignedVariablesDetails': { 'truncated': True|False } }, 'mapRunStartedEventDetails': { 'mapRunArn': 'string' }, 'mapRunFailedEventDetails': { 'error': 'string', 'cause': 'string' }, 'mapRunRedrivenEventDetails': { 'mapRunArn': 'string', 'redriveCount': 123 }, 'evaluationFailedEventDetails': { 'error': 'string', 'cause': 'string', 'location': 'string', 'state': '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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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", "U+FFFE-FFFF") * surrogates ( "U+D800-DFFF") * invalid characters ( `` U+10FFFF``) 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. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **assignedVariables** *(dict) --* Map of variable name and value as a serialized JSON representation. * *(string) --* * *(string) --* * **assignedVariablesDetails** *(dict) --* Provides details about input or output in an execution history event. * **truncated** *(boolean) --* Indicates whether assigned variables were truncated in the response. Always "false" for API calls. In CloudWatch logs, the value will be true if the data is truncated due to size limits. * **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. * **evaluationFailedEventDetails** *(dict) --* Contains details about an evaluation failure that occurred while processing a state. * **error** *(string) --* The error code of the failure. * **cause** *(string) --* A more detailed explanation of the cause of the failure. * **location** *(string) --* The location of the field in the state in which the evaluation error occurred. * **state** *(string) --* The name of the state in which the evaluation error occurred. * **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.ExecutionDoesNotExist" * "SFN.Client.exceptions.InvalidArn" * "SFN.Client.exceptions.InvalidToken" * "SFN.Client.exceptions.KmsAccessDeniedException" * "SFN.Client.exceptions.KmsInvalidStateException" * "SFN.Client.exceptions.KmsThrottlingException"