---
title: AWS Step Functions actions
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/aws/stepfunctions/aws-stepfunctions
---

This page provides a reference for AWS Step Functions actions available in the workflow automation actions catalog. Use these actions to start, stop, redrive, and inspect Step Functions executions and state machines from within your workflow definitions.

## Prerequisites

Before using AWS Step Functions actions in workflow automation, ensure you have:

-   An AWS account with appropriate permissions.
-   AWS credentials configured (IAM user credentials, IAM role ARN, or session credentials).
-   The necessary IAM permissions for Step Functions operations.

See [Set up AWS credentials](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/set-up-aws-credentials/) for information on how to create IAM users and IAM roles, and set up static and session AWS credentials for integration with workflow automation AWS actions.

## Required IAM permissions

The permissions you need depend on which Step Functions actions your workflow calls. Use the example below as a template for a least-privilege policy covering all seven actions.

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "states:StartExecution",
        "states:StopExecution",
        "states:RedriveExecution",
        "states:DescribeExecution",
        "states:ListExecutions",
        "states:DescribeStateMachine",
        "states:ListStateMachines"
      ],
      "Resource": "arn:aws:states:<region>:<account-id>:*"
    }
  ]
}
```

> #### ⚠️ IMPORTANT
>
> Replace `<region>` and `<account-id>` with your actual values, and restrict the `Resource` to specific state machine or execution ARNs where possible.

## Start a Step Functions execution

The action identifier is `aws.stepFunctions.startExecution`.

Starts an execution of an AWS Step Functions state machine. On success, returns the `executionArn` of the new execution, which you can pass to [`aws.stepFunctions.describeExecution`](#describe-a-step-functions-execution) to poll its status.

### Inputs

The following table describes all available input fields for this action.

| Input                  | Type            | Description                                                                                                                                                                                                                                                                                | Example                                                                      |
| ---------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------- |
| **awsRoleArn**         | String          | **Optional.** IAM Role ARN to assume. Recommended. Takes precedence over key-based credentials when you supply both.                                                                                                                                                                       | `arn:aws:iam::123456789012:role/my-workflow-role`                            |
| **awsAccessKeyId**     | String (secret) | **Optional.** AWS access key ID. Must be passed as a secret.                                                                                                                                                                                                                               | `${{ :secrets:awsAccessKeyId }}`                                             |
| **awsSecretAccessKey** | String (secret) | **Optional.** AWS secret access key. Must be passed as a secret.                                                                                                                                                                                                                           | `${{ :secrets:awsSecretAccessKey }}`                                         |
| **awsSessionToken**    | String (secret) | **Optional.** AWS session token for temporary credentials. Must be passed as a secret.                                                                                                                                                                                                     | `${{ :secrets:awsSessionToken }}`                                            |
| **region**             | String          | **Required.** AWS region where the state machine is deployed.                                                                                                                                                                                                                              | `us-east-1`                                                                  |
| **stateMachineArn**    | String          | **Required.** ARN of the state machine to execute.                                                                                                                                                                                                                                         | `arn:aws:states:us-east-1:123456789012:stateMachine:RestartUnhealthyService` |
| **name**               | String          | **Optional.** Execution name. Must be unique per state machine. Auto-generated as a UUID if omitted. On `STANDARD` state machines, reusing a running execution's name with different input returns `ExecutionAlreadyExists`. On `EXPRESS` state machines, names can be reused immediately. | `incident-42`                                                                |
| **input**              | String          | **Optional.** JSON string to pass as input to the execution.                                                                                                                                                                                                                               | `'{"instanceId": "i-0123456789abcdef0"}'`                                    |
| **traceHeader**        | String          | **Optional.** X-Ray trace header to propagate into the execution.                                                                                                                                                                                                                          | `Root=1-5e1b2f1a-3c1a1a1a1a1a1a1a1a1a1a1a`                                   |
| **selectors**          | List            | **Optional.** JQ selectors to extract specific fields from the action output.                                                                                                                                                                                                              | `[{"name": "executionArn", "expression": ".response.executionArn"}]`         |

### Outputs

The following table describes all output fields returned by this action.

| Output           | Type    | Description                                                                                                                                                                                                  |
| ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **response**     | Object  | Response from the AWS Step Functions API. ```json {   "executionArn": "arn:aws:states:us-east-1:123456789012:execution:RestartUnhealthyService:incident-42",   "startDate": "2026-08-24T09:00:00.000Z" } ``` |
| **success**      | Boolean | `true` on success, `false` on failure.                                                                                                                                                                       |
| **errorMessage** | String  | Error message if the execution failed to start. `null` on success.                                                                                                                                           |

### Example

The following example starts a remediation execution and captures the execution ARN for downstream steps.

| Workflow example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: start-sfn-remediation description: 'Starts a Step Functions remediation execution'  workflowInputs:   arnRole:     type: String   stateMachineArn:     type: String   incidentId:     type: String  steps:   - name: startRemediation     type: action     action: aws.stepFunctions.startExecution     version: '1'     inputs:       awsRoleArn: ${{ .workflowInputs.arnRole }}       region: us-east-1       stateMachineArn: ${{ .workflowInputs.stateMachineArn }}       name: incident-${{ .workflowInputs.incidentId }}       input: '{"incidentId": "${{ .workflowInputs.incidentId }}"}'       selectors:         - name: executionArn           expression: '.response.executionArn' ``` |

## Stop a Step Functions execution

The action identifier is `aws.stepFunctions.stopExecution`.

Stops a running Step Functions execution. AWS marks the execution as `ABORTED` once it stops.

> #### ⚠️ IMPORTANT
>
> This action is only supported on `STANDARD` state machines. It cannot stop `EXPRESS` executions.

### Inputs

The following table describes all available input fields for this action.

| Input                  | Type            | Description                                                                                                          | Example                                                                               |
| ---------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| **awsRoleArn**         | String          | **Optional.** IAM Role ARN to assume. Recommended. Takes precedence over key-based credentials when you supply both. | `arn:aws:iam::123456789012:role/my-workflow-role`                                     |
| **awsAccessKeyId**     | String (secret) | **Optional.** AWS access key ID. Must be passed as a secret.                                                         | `${{ :secrets:awsAccessKeyId }}`                                                      |
| **awsSecretAccessKey** | String (secret) | **Optional.** AWS secret access key. Must be passed as a secret.                                                     | `${{ :secrets:awsSecretAccessKey }}`                                                  |
| **awsSessionToken**    | String (secret) | **Optional.** AWS session token for temporary credentials. Must be passed as a secret.                               | `${{ :secrets:awsSessionToken }}`                                                     |
| **region**             | String          | **Required.** AWS region where the execution is running.                                                             | `us-east-1`                                                                           |
| **executionArn**       | String          | **Required.** ARN of the execution to stop.                                                                          | `arn:aws:states:us-east-1:123456789012:execution:RestartUnhealthyService:incident-42` |
| **error**              | String          | **Optional.** Short error code describing why the execution was stopped.                                             | `TimeoutFromWorkflowAutomation`                                                       |
| **cause**              | String          | **Optional.** Human-readable explanation of why the execution was stopped.                                           | `Remediation exceeded 10 minute SLA, aborted by workflow`                             |
| **selectors**          | List            | **Optional.** JQ selectors to extract specific fields from the action output.                                        | `[{"name": "stopDate", "expression": ".response.stopDate"}]`                          |

### Outputs

The following table describes all output fields returned by this action.

| Output           | Type    | Description                                                                                        |
| ---------------- | ------- | -------------------------------------------------------------------------------------------------- |
| **response**     | Object  | Response from the AWS Step Functions API. ```json {   "stopDate": "2026-08-24T09:15:30.000Z" } ``` |
| **success**      | Boolean | `true` on success, `false` on failure.                                                             |
| **errorMessage** | String  | Error message if stopping the execution failed. `null` on success.                                 |

### Example

The following example aborts an execution that has exceeded its SLA.

| Workflow example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: abort-stuck-sfn-run description: 'Aborts a Step Functions execution that exceeded its SLA'  workflowInputs:   arnRole:     type: String   executionArn:     type: String  steps:   - name: abortStuckRun     type: action     action: aws.stepFunctions.stopExecution     version: '1'     inputs:       awsRoleArn: ${{ .workflowInputs.arnRole }}       region: us-east-1       executionArn: ${{ .workflowInputs.executionArn }}       error: 'TimeoutFromWorkflowAutomation'       cause: 'Remediation exceeded 10 minute SLA, aborted by workflow' ``` |

## Redrive a Step Functions execution

The action identifier is `aws.stepFunctions.redriveExecution`.

Redrives a failed, timed-out, or aborted Step Functions execution, resuming it from the last unsuccessful state without starting over from the beginning.

> #### ⚠️ IMPORTANT
>
> This action is only supported on `STANDARD` state machines. An execution can only be redriven if it has not `SUCCEEDED`, is within 14 days of completion, and has fewer than 24,999 history events.

### Inputs

The following table describes all available input fields for this action.

| Input                  | Type            | Description                                                                                                          | Example                                                                               |
| ---------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| **awsRoleArn**         | String          | **Optional.** IAM Role ARN to assume. Recommended. Takes precedence over key-based credentials when you supply both. | `arn:aws:iam::123456789012:role/my-workflow-role`                                     |
| **awsAccessKeyId**     | String (secret) | **Optional.** AWS access key ID. Must be passed as a secret.                                                         | `${{ :secrets:awsAccessKeyId }}`                                                      |
| **awsSecretAccessKey** | String (secret) | **Optional.** AWS secret access key. Must be passed as a secret.                                                     | `${{ :secrets:awsSecretAccessKey }}`                                                  |
| **awsSessionToken**    | String (secret) | **Optional.** AWS session token for temporary credentials. Must be passed as a secret.                               | `${{ :secrets:awsSessionToken }}`                                                     |
| **region**             | String          | **Required.** AWS region where the execution ran.                                                                    | `us-east-1`                                                                           |
| **executionArn**       | String          | **Required.** ARN of the execution to redrive.                                                                       | `arn:aws:states:us-east-1:123456789012:execution:RestartUnhealthyService:incident-42` |
| **clientToken**        | String          | **Optional.** Idempotency token for the redrive request. Auto-generated by the SDK if omitted.                       | `a1b2c3d4-e5f6-7890-abcd-ef1234567890`                                                |
| **selectors**          | List            | **Optional.** JQ selectors to extract specific fields from the action output.                                        | `[{"name": "redriveDate", "expression": ".response.redriveDate"}]`                    |

### Outputs

The following table describes all output fields returned by this action.

| Output           | Type    | Description                                                                                           |
| ---------------- | ------- | ----------------------------------------------------------------------------------------------------- |
| **response**     | Object  | Response from the AWS Step Functions API. ```json {   "redriveDate": "2026-08-24T09:20:00.000Z" } ``` |
| **success**      | Boolean | `true` on success, `false` on failure.                                                                |
| **errorMessage** | String  | Error message if the redrive failed. `null` on success.                                               |

### Example

The following example redrives a failed execution to resume it from its last unsuccessful state.

| Workflow example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: retry-failed-sfn-execution description: 'Redrives a failed Step Functions execution from its last unsuccessful state'  workflowInputs:   arnRole:     type: String   executionArn:     type: String  steps:   - name: retryFailedRemediation     type: action     action: aws.stepFunctions.redriveExecution     version: '1'     inputs:       awsRoleArn: ${{ .workflowInputs.arnRole }}       region: us-east-1       executionArn: ${{ .workflowInputs.executionArn }}       selectors:         - name: redriveDate           expression: '.response.redriveDate' ``` |

## Describe a Step Functions execution

The action identifier is `aws.stepFunctions.describeExecution`.

Returns the status, input, output, and timestamps for a Step Functions execution. Use this action to poll the result of an execution started by [`aws.stepFunctions.startExecution`](#start-a-step-functions-execution).

> #### ⚠️ IMPORTANT
>
> This action supports `STANDARD` state machine executions directly. You can only describe `EXPRESS` executions that a Map Run dispatched.

### Inputs

The following table describes all available input fields for this action.

| Input                  | Type            | Description                                                                                                                                                                                      | Example                                                                               |
| ---------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
| **awsRoleArn**         | String          | **Optional.** IAM Role ARN to assume. Recommended. Takes precedence over key-based credentials when you supply both.                                                                             | `arn:aws:iam::123456789012:role/my-workflow-role`                                     |
| **awsAccessKeyId**     | String (secret) | **Optional.** AWS access key ID. Must be passed as a secret.                                                                                                                                     | `${{ :secrets:awsAccessKeyId }}`                                                      |
| **awsSecretAccessKey** | String (secret) | **Optional.** AWS secret access key. Must be passed as a secret.                                                                                                                                 | `${{ :secrets:awsSecretAccessKey }}`                                                  |
| **awsSessionToken**    | String (secret) | **Optional.** AWS session token for temporary credentials. Must be passed as a secret.                                                                                                           | `${{ :secrets:awsSessionToken }}`                                                     |
| **region**             | String          | **Required.** AWS region where the execution ran.                                                                                                                                                | `us-east-1`                                                                           |
| **executionArn**       | String          | **Required.** ARN of the execution to describe.                                                                                                                                                  | `arn:aws:states:us-east-1:123456789012:execution:RestartUnhealthyService:incident-42` |
| **includedData**       | Enum            | **Optional.** Controls whether the execution definition is returned. Use `METADATA_ONLY` to skip decrypting the definition when `kms:Decrypt` permission is unavailable. Defaults to `ALL_DATA`. | `ALL_DATA` or `METADATA_ONLY`                                                         |
| **selectors**          | List            | **Optional.** JQ selectors to extract specific fields from the action output.                                                                                                                    | `[{"name": "status", "expression": ".response.status"}]`                              |

### Outputs

The following table describes all output fields returned by this action.

| Output           | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **response**     | Object  | Execution details from the AWS Step Functions API. On `FAILED`, `TIMED_OUT`, or `ABORTED` executions, `output` is absent and the API populates `error` / `cause` instead. `redriveStatus` indicates whether the execution can be redriven. ```json {   "executionArn": "arn:aws:states:us-east-1:123456789012:execution:RestartUnhealthyService:incident-42",   "stateMachineArn": "arn:aws:states:us-east-1:123456789012:stateMachine:RestartUnhealthyService",   "name": "incident-42",   "status": "SUCCEEDED",   "startDate": "2026-08-24T09:00:00.000Z",   "stopDate": "2026-08-24T09:02:15.000Z",   "input": "{\"incidentId\": \"42\"}",   "output": "{\"result\": \"resolved\"}",   "redriveCount": 0,   "redriveStatus": "NOT_REDRIVABLE" } ``` |
| **success**      | Boolean | `true` on success, `false` on failure.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **errorMessage** | String  | Error message if the request failed. `null` on success.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

### Example

The following example polls the status of an execution and captures the output for downstream steps.

| Workflow example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: check-sfn-execution-status description: 'Polls the status and output of a Step Functions execution'  workflowInputs:   arnRole:     type: String   executionArn:     type: String  steps:   - name: checkStatus     type: action     action: aws.stepFunctions.describeExecution     version: '1'     inputs:       awsRoleArn: ${{ .workflowInputs.arnRole }}       region: us-east-1       executionArn: ${{ .workflowInputs.executionArn }}       selectors:         - name: status           expression: '.response.status'         - name: output           expression: '.response.output' ``` |

## List Step Functions executions

The action identifier is `aws.stepFunctions.listExecutions`.

Lists executions of an AWS Step Functions state machine or map run, optionally filtered by status. Results are sorted most-recent first.

### Inputs

The following table describes all available input fields for this action.

| Input                  | Type            | Description                                                                                                                                                                                                                                 | Example                                                                               |
| ---------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| **awsRoleArn**         | String          | **Optional.** IAM Role ARN to assume. Recommended. Takes precedence over key-based credentials when you supply both.                                                                                                                        | `arn:aws:iam::123456789012:role/my-workflow-role`                                     |
| **awsAccessKeyId**     | String (secret) | **Optional.** AWS access key ID. Must be passed as a secret.                                                                                                                                                                                | `${{ :secrets:awsAccessKeyId }}`                                                      |
| **awsSecretAccessKey** | String (secret) | **Optional.** AWS secret access key. Must be passed as a secret.                                                                                                                                                                            | `${{ :secrets:awsSecretAccessKey }}`                                                  |
| **awsSessionToken**    | String (secret) | **Optional.** AWS session token for temporary credentials. Must be passed as a secret.                                                                                                                                                      | `${{ :secrets:awsSessionToken }}`                                                     |
| **region**             | String          | **Required.** AWS region to list executions in.                                                                                                                                                                                             | `us-east-1`                                                                           |
| **stateMachineArn**    | String          | **Optional.** ARN of the state machine whose executions to list. Provide this or `mapRunArn`, not both. `EXPRESS` state machines are not directly listable — use `mapRunArn` to list their child executions from a Distributed Map instead. | `arn:aws:states:us-east-1:123456789012:stateMachine:RestartUnhealthyService`          |
| **mapRunArn**          | String          | **Optional.** ARN of the map run whose child executions to list. Provide this or `stateMachineArn`, not both. Required when using `statusFilter: PENDING_REDRIVE`.                                                                          | `arn:aws:states:us-east-1:123456789012:mapRun:MyStateMachine/abcd1234`                |
| **statusFilter**       | Enum            | **Optional.** Filter executions by status. `PENDING_REDRIVE` requires `mapRunArn`.                                                                                                                                                          | `RUNNING` \| `SUCCEEDED` \| `FAILED` \| `TIMED_OUT` \| `ABORTED` \| `PENDING_REDRIVE` |
| **maxResults**         | Int             | **Optional.** Maximum number of executions to return. Defaults to 100, maximum 1000.                                                                                                                                                        | `20`                                                                                  |
| **nextToken**          | String          | **Optional.** Pagination token from a previous call's `response.nextToken`. Expires after 24 hours.                                                                                                                                         | `AQICAHi...`                                                                          |
| **redriveFilter**      | Enum            | **Optional.** Filter executions by whether they have been redriven.                                                                                                                                                                         | `REDRIVEN` or `NOT_REDRIVEN`                                                          |
| **selectors**          | List            | **Optional.** JQ selectors to extract specific fields from the action output.                                                                                                                                                               | `[{"name": "executions", "expression": ".response.executions"}]`                      |

### Outputs

The following table describes all output fields returned by this action.

| Output           | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ---------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **response**     | Object  | List of executions from the AWS Step Functions API. `nextToken` is present only when more pages are available — pass it as `nextToken` on a subsequent call to retrieve the next page. ```json {   "executions": [     {       "executionArn": "arn:aws:states:us-east-1:123456789012:execution:RestartUnhealthyService:incident-42",       "stateMachineArn": "arn:aws:states:us-east-1:123456789012:stateMachine:RestartUnhealthyService",       "name": "incident-42",       "status": "RUNNING",       "startDate": "2026-08-24T09:00:00.000Z"     }   ],   "nextToken": null } ``` |
| **success**      | Boolean | `true` on success, `false` on failure.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **errorMessage** | String  | Error message if the request failed. `null` on success.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

### Example

The following example lists the currently running executions for a state machine.

| Workflow example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: find-running-sfn-executions description: 'Lists running executions for a state machine'  workflowInputs:   arnRole:     type: String   stateMachineArn:     type: String  steps:   - name: findRunningExecutions     type: action     action: aws.stepFunctions.listExecutions     version: '1'     inputs:       awsRoleArn: ${{ .workflowInputs.arnRole }}       region: us-east-1       stateMachineArn: ${{ .workflowInputs.stateMachineArn }}       statusFilter: RUNNING       maxResults: 20       selectors:         - name: executions           expression: '.response.executions' ``` |

## Describe a state machine

The action identifier is `aws.stepFunctions.describeStateMachine`.

Returns the definition, IAM role, logging configuration, type (`STANDARD` or `EXPRESS`), and status of an AWS Step Functions state machine.

### Inputs

The following table describes all available input fields for this action.

| Input                  | Type            | Description                                                                                                                                                                    | Example                                                                      |
| ---------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------- |
| **awsRoleArn**         | String          | **Optional.** IAM Role ARN to assume. Recommended. Takes precedence over key-based credentials when you supply both.                                                           | `arn:aws:iam::123456789012:role/my-workflow-role`                            |
| **awsAccessKeyId**     | String (secret) | **Optional.** AWS access key ID. Must be passed as a secret.                                                                                                                   | `${{ :secrets:awsAccessKeyId }}`                                             |
| **awsSecretAccessKey** | String (secret) | **Optional.** AWS secret access key. Must be passed as a secret.                                                                                                               | `${{ :secrets:awsSecretAccessKey }}`                                         |
| **awsSessionToken**    | String (secret) | **Optional.** AWS session token for temporary credentials. Must be passed as a secret.                                                                                         | `${{ :secrets:awsSessionToken }}`                                            |
| **region**             | String          | **Required.** AWS region where the state machine is deployed.                                                                                                                  | `us-east-1`                                                                  |
| **stateMachineArn**    | String          | **Required.** ARN of the state machine to describe. Also accepts a version ARN.                                                                                                | `arn:aws:states:us-east-1:123456789012:stateMachine:RestartUnhealthyService` |
| **includedData**       | Enum            | **Optional.** Use `METADATA_ONLY` to skip returning the state machine definition and avoid needing `kms:Decrypt` when the definition is KMS-encrypted. Defaults to `ALL_DATA`. | `ALL_DATA` or `METADATA_ONLY`                                                |
| **selectors**          | List            | **Optional.** JQ selectors to extract specific fields from the action output.                                                                                                  | `[{"name": "type", "expression": ".response.type"}]`                         |

### Outputs

The following table describes all output fields returned by this action.

| Output           | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **response**     | Object  | State machine details from the AWS Step Functions API. The `type` field (`STANDARD` or `EXPRESS`) is useful for branching logic — for example, to determine whether `stopExecution` or `redriveExecution` are applicable. ```json {   "stateMachineArn": "arn:aws:states:us-east-1:123456789012:stateMachine:RestartUnhealthyService",   "name": "RestartUnhealthyService",   "status": "ACTIVE",   "definition": "{\"StartAt\": \"RestartTask\", \"States\": {...}}",   "roleArn": "arn:aws:iam::123456789012:role/StepFunctionsExecutionRole",   "type": "STANDARD",   "creationDate": "2026-01-15T00:00:00.000Z" } ``` |
| **success**      | Boolean | `true` on success, `false` on failure.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **errorMessage** | String  | Error message if the request failed. `null` on success.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

### Example

The following example retrieves the type and definition of a state machine.

| Workflow example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ```yaml name: get-sfn-state-machine-type description: 'Retrieves the type and definition of a state machine'  workflowInputs:   arnRole:     type: String   stateMachineArn:     type: String  steps:   - name: getDefinition     type: action     action: aws.stepFunctions.describeStateMachine     version: '1'     inputs:       awsRoleArn: ${{ .workflowInputs.arnRole }}       region: us-east-1       stateMachineArn: ${{ .workflowInputs.stateMachineArn }}       selectors:         - name: type           expression: '.response.type'         - name: definition           expression: '.response.definition' ``` |

## List state machines

The action identifier is `aws.stepFunctions.listStateMachines`.

Lists AWS Step Functions state machines in an account and region. Use pagination inputs to retrieve large result sets.

### Inputs

The following table describes all available input fields for this action.

| Input                  | Type            | Description                                                                                                          | Example                                                                |
| ---------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| **awsRoleArn**         | String          | **Optional.** IAM Role ARN to assume. Recommended. Takes precedence over key-based credentials when you supply both. | `arn:aws:iam::123456789012:role/my-workflow-role`                      |
| **awsAccessKeyId**     | String (secret) | **Optional.** AWS access key ID. Must be passed as a secret.                                                         | `${{ :secrets:awsAccessKeyId }}`                                       |
| **awsSecretAccessKey** | String (secret) | **Optional.** AWS secret access key. Must be passed as a secret.                                                     | `${{ :secrets:awsSecretAccessKey }}`                                   |
| **awsSessionToken**    | String (secret) | **Optional.** AWS session token for temporary credentials. Must be passed as a secret.                               | `${{ :secrets:awsSessionToken }}`                                      |
| **region**             | String          | **Required.** AWS region to list state machines in.                                                                  | `us-east-1`                                                            |
| **maxResults**         | Int             | **Optional.** Maximum number of state machines to return. Defaults to 100, maximum 1000.                             | `50`                                                                   |
| **nextToken**          | String          | **Optional.** Pagination token from a previous call's `response.nextToken`. Expires after 24 hours.                  | `AQICAHi...`                                                           |
| **selectors**          | List            | **Optional.** JQ selectors to extract specific fields from the action output.                                        | `[{"name": "stateMachines", "expression": ".response.stateMachines"}]` |

### Outputs

The following table describes all output fields returned by this action.

| Output           | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ---------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **response**     | Object  | List of state machines from the AWS Step Functions API. `nextToken` is present only when more pages are available — pass it as `nextToken` on a subsequent call to retrieve the next page. ```json {   "stateMachines": [     {       "stateMachineArn": "arn:aws:states:us-east-1:123456789012:stateMachine:RestartUnhealthyService",       "name": "RestartUnhealthyService",       "type": "STANDARD",       "creationDate": "2026-01-15T00:00:00.000Z"     }   ],   "nextToken": null } ``` |
| **success**      | Boolean | `true` on success, `false` on failure.                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **errorMessage** | String  | Error message if the request failed. `null` on success.                                                                                                                                                                                                                                                                                                                                                                                                                                         |

### Example

The following example lists state machines in the account and captures the result for downstream steps.

| Workflow example                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: discover-sfn-state-machines description: 'Lists state machines in the account'  workflowInputs:   arnRole:     type: String  steps:   - name: discoverStateMachines     type: action     action: aws.stepFunctions.listStateMachines     version: '1'     inputs:       awsRoleArn: ${{ .workflowInputs.arnRole }}       region: us-east-1       maxResults: 50       selectors:         - name: stateMachines           expression: '.response.stateMachines' ``` |

## What's next

To continue working with AWS actions and workflow automation, see the following resources.

-   **[AWS credentials setup](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/set-up-aws-credentials/)**: Configure IAM roles and access keys for use with AWS actions.
-   **[AWS Execute API](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/aws/aws-execute-api)**: Call any AWS API directly when a dedicated action is not available.
-   **[Workflow examples](https://docs.newrelic.com/docs/workflow-automation/workflow-examples/workflow-examples)**: See real-world workflow examples using AWS actions.
