SfnClient

interface SfnClient : SdkClient

Step Functions

Step Functions coordinates the components of distributed applications and microservices using visual workflows.

You can use Step Functions to build applications from individual components, each of which performs a discrete function, or task, allowing you to scale and change applications quickly. Step Functions provides a console that helps visualize the components of your application as a series of steps. Step Functions automatically triggers and tracks each step, and retries steps when there are errors, so your application executes predictably and in the right order every time. Step Functions logs the state of each step, so you can quickly diagnose and debug any issues.

Step Functions manages operations and underlying infrastructure to ensure your application is available at any scale. You can run tasks on Amazon Web Services, your own servers, or any system that has access to Amazon Web Services. You can access and use Step Functions using the console, the Amazon Web Services SDKs, or an HTTP API. For more information about Step Functions, see the Step Functions Developer Guide.

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 could use Step Functions API action startSyncExecution and specify its parameter as StateMachineArn.

Properties

Link copied to clipboard
abstract override val config: SfnClient.Config

SfnClient's configuration

Functions

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Deletes an activity.

Link copied to clipboard

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.

Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard

Describes an activity.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

Returns details about a state machine alias.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard
abstract suspend fun listActivities(input: ListActivitiesRequest = ListActivitiesRequest { }): ListActivitiesResponse

Lists the existing activities.

Link copied to clipboard
abstract suspend fun listExecutions(input: ListExecutionsRequest = ListExecutionsRequest { }): ListExecutionsResponse

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.

Link copied to clipboard
abstract suspend fun listMapRuns(input: ListMapRunsRequest): ListMapRunsResponse

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.

Link copied to clipboard

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

Link copied to clipboard
abstract suspend fun listStateMachines(input: ListStateMachinesRequest = ListStateMachinesRequest { }): ListStateMachinesResponse

Lists the existing state machines.

Link copied to clipboard

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

Link copied to clipboard

List tags for a given resource.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Starts a state machine execution.

Link copied to clipboard

Starts a Synchronous Express state machine execution. StartSyncExecution is not available for STANDARD workflows.

Link copied to clipboard

Stops an execution.

Link copied to clipboard
abstract suspend fun tagResource(input: TagResourceRequest): TagResourceResponse

Add a tag to a Step Functions resource.

Link copied to clipboard
abstract suspend fun testState(input: TestStateRequest): TestStateResponse

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:

Link copied to clipboard

Remove a tag from a Step Functions resource

Link copied to clipboard

Updates an in-progress Map Run's configuration to include changes to the settings that control maximum concurrency and Map Run failure.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

Validates the syntax of a state machine definition specified in Amazon States Language (ASL), a JSON-based, structured language.

Inherited functions

Link copied to clipboard
expect abstract fun close()
Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Deletes an activity.

Link copied to clipboard

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.

Link copied to clipboard

Deletes a state machine alias.

Link copied to clipboard

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.

Link copied to clipboard

Describes an activity.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

Returns details about a state machine alias.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Lists the existing activities.

Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard
Link copied to clipboard
inline suspend fun SfnClient.listMapRuns(crossinline block: ListMapRunsRequest.Builder.() -> Unit): ListMapRunsResponse

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.

Link copied to clipboard

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

Link copied to clipboard

Lists the existing state machines.

Link copied to clipboard

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

Link copied to clipboard

List tags for a given resource.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Starts a state machine execution.

Link copied to clipboard

Starts a Synchronous Express state machine execution. StartSyncExecution is not available for STANDARD workflows.

Link copied to clipboard
inline suspend fun SfnClient.stopExecution(crossinline block: StopExecutionRequest.Builder.() -> Unit): StopExecutionResponse

Stops an execution.

Link copied to clipboard
inline suspend fun SfnClient.tagResource(crossinline block: TagResourceRequest.Builder.() -> Unit): TagResourceResponse

Add a tag to a Step Functions resource.

Link copied to clipboard
inline suspend fun SfnClient.testState(crossinline block: TestStateRequest.Builder.() -> Unit): TestStateResponse

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:

Link copied to clipboard
inline suspend fun SfnClient.untagResource(crossinline block: UntagResourceRequest.Builder.() -> Unit): UntagResourceResponse

Remove a tag from a Step Functions resource

Link copied to clipboard
inline suspend fun SfnClient.updateMapRun(crossinline block: UpdateMapRunRequest.Builder.() -> Unit): UpdateMapRunResponse

Updates an in-progress Map Run's configuration to include changes to the settings that control maximum concurrency and Map Run failure.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

Validates the syntax of a state machine definition specified in Amazon States Language (ASL), a JSON-based, structured language.

Link copied to clipboard

Create a copy of the client with one or more configuration values overridden. This method allows the caller to perform scoped config overrides for one or more client operations.