- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ListExecutionsCommand
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.
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.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { SFNClient, ListExecutionsCommand } from "@aws-sdk/client-sfn"; // ES Modules import
// const { SFNClient, ListExecutionsCommand } = require("@aws-sdk/client-sfn"); // CommonJS import
const client = new SFNClient(config);
const input = { // ListExecutionsInput
stateMachineArn: "STRING_VALUE",
statusFilter: "RUNNING" || "SUCCEEDED" || "FAILED" || "TIMED_OUT" || "ABORTED" || "PENDING_REDRIVE",
maxResults: Number("int"),
nextToken: "STRING_VALUE",
mapRunArn: "STRING_VALUE",
redriveFilter: "REDRIVEN" || "NOT_REDRIVEN",
};
const command = new ListExecutionsCommand(input);
const response = await client.send(command);
// { // ListExecutionsOutput
// executions: [ // ExecutionList // required
// { // ExecutionListItem
// executionArn: "STRING_VALUE", // required
// stateMachineArn: "STRING_VALUE", // required
// name: "STRING_VALUE", // required
// status: "RUNNING" || "SUCCEEDED" || "FAILED" || "TIMED_OUT" || "ABORTED" || "PENDING_REDRIVE", // required
// startDate: new Date("TIMESTAMP"), // required
// stopDate: new Date("TIMESTAMP"),
// mapRunArn: "STRING_VALUE",
// itemCount: Number("int"),
// stateMachineVersionArn: "STRING_VALUE",
// stateMachineAliasArn: "STRING_VALUE",
// redriveCount: Number("int"),
// redriveDate: new Date("TIMESTAMP"),
// },
// ],
// nextToken: "STRING_VALUE",
// };
ListExecutionsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
mapRunArn | string | undefined | The Amazon Resource Name (ARN) of the Map Run that started the child workflow executions. If the You can specify either a |
maxResults | number | undefined | The maximum number of results that are returned per call. You can use This is only an upper limit. The actual number of results returned per call might be fewer than the specified maximum. |
nextToken | string | undefined | If |
redriveFilter | ExecutionRedriveFilter | undefined | Sets a filter to list executions based on whether or not they have been redriven. For a Distributed Map, If you do not provide a If you provide a state machine ARN in |
stateMachineArn | string | undefined | The Amazon Resource Name (ARN) of the state machine whose executions is listed. You can specify either a |
statusFilter | ExecutionStatus | undefined | If specified, only list the executions whose current execution status matches the given filter. |
ListExecutionsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
executions Required | ExecutionListItem[] | undefined | The list of matching executions. |
nextToken | string | undefined | If |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidArn | client | The provided Amazon Resource Name (ARN) is not valid. |
InvalidToken | client | The provided token is not valid. |
ResourceNotFound | client | Could not find the referenced resource. |
StateMachineDoesNotExist | client | The specified state machine does not exist. |
StateMachineTypeNotSupported | client | State machine type is not supported. |
ValidationException | client | The input does not satisfy the constraints specified by an Amazon Web Services service. |
SFNServiceException | Base exception class for all service exceptions from SFN service. |