Skip to main content

AWS Step Functions ExecModule

Overview

AwsStepFunctionsModule brings durable AWS state-machine orchestration into ValkyrAI workflows. It discovers Standard and Express state machines, starts named executions, reads bounded execution state and history, stops reviewed executions, redrives eligible failures, and completes callback tasks. It uses ValkyrAI's native map ABI and a verified IntegrationAccount; credentials never belong in workflow input.

The connector implements twelve operations:

  • list_state_machines and describe_state_machine discover bounded state-machine metadata.
  • start_execution starts an asynchronous Standard or Express execution.
  • start_sync_execution starts an Express workflow and returns its bounded result.
  • list_executions, describe_execution, and get_execution_history inspect execution state without returning the original execution input.
  • stop_execution terminates a running Standard execution after explicit confirmation.
  • redrive_execution restarts eligible unsuccessful Standard executions with an optional client token.
  • send_task_success, send_task_failure, and send_task_heartbeat complete or extend callback tasks without echoing the sensitive task token.

n8n's AWS Lambda, SNS, and SQS nodes demonstrate useful AWS workflow patterns: account credentials, region-aware resources, resource discovery, pagination, JSON payloads, and workflow-tool composition. n8n does not currently ship a dedicated Step Functions node in its built-in AWS node tree, so ValkyrAI provides a native lifecycle connector with stricter ARN validation, bounded output, mutation replay boundaries, callback-token redaction, and destructive confirmation.

Usage

  1. Select the state machines and executions the workflow may access.
  2. Create a least-privilege IAM principal restricted to the required states:* actions and resources.
  3. Store its access key ID and secret access key in an AWS IntegrationAccount; verify it and keep it in READY status.
  4. Add AwsStepFunctionsModule and bind that account through ExecModuleConfig.authConfig.integrationAccount.
  5. Choose one operation and supply only its documented fields. Unexpected fields fail before provider access.
  6. Use stable execution names and redrive client tokens where applicable. Reconcile exact AWS state before replaying any timed-out mutation.

Never place an AWS access key, secret key, session token, or credential object in module input. Those fields are rejected before any network request. Treat callback task tokens as sensitive capabilities and keep them in ACL-scoped workflow data.

Inputs

NameTypeRequired forDefaultConstraints
operationstringEvery executionNoneOne of the twelve documented operations.
regionstringEvery executionNoneAWS region such as us-west-2; custom endpoints are not accepted.
stateMachineArnstringState-machine describe/start/list-executions operationsNoneAWS Step Functions state-machine, alias, or version ARN in the selected region.
executionArnstringExecution describe/history/stop/redrive operationsNoneAWS Step Functions execution ARN in the selected region.
executionNamestringOptional start fieldAWS-generated1-80 letters, digits, underscores, or hyphens.
inputobject or JSON stringOptional start field{}JSON object or array, at most 256 KiB after canonical serialization.
outputobject or JSON stringsend_task_successNoneJSON object or array, at most 256 KiB.
statusFilterstringOptional list_executions fieldNoneRUNNING, SUCCEEDED, FAILED, TIMED_OUT, ABORTED, or PENDING_REDRIVE.
nextTokenstringOptional list/history fieldNoneOpaque provider token, at most 4,096 characters.
limitintegerOptional list/history field100From 1 through 10,000 total returned items.
returnAllbooleanOptional list/history fieldfalseFollow provider pages until limit, exhaustion, or the 100-page guard.
reverseOrderbooleanOptional history fieldfalseReturn newest history events first.
errorstringOptional stop/failure fieldNoneBounded application error code, at most 256 characters.
causestringOptional stop/failure fieldNoneBounded diagnostic, at most 32,768 UTF-8 bytes.
clientTokenstringOptional redrive fieldAWS-generated1-64 letters, digits, underscores, or hyphens.
taskTokenstringCallback operationsNoneSensitive nonblank token, at most 2,048 UTF-8 bytes; never returned or logged.
confirmStopbooleanstop_executionfalseMust be exactly true.

State-machine and execution ARNs must use the selected region. This prevents a workflow configured for one region from silently operating on a resource in another. Alias- and version-qualified state-machine ARNs remain supported.

Outputs

Every call returns stable status, operation, and attempts fields.

NameTypeWhen presentDescription
statusstringAlwayssuccess or error.
operationstringAlwaysNormalized operation.
attemptsintegerAlwaysProvider calls including pages and retry-safe reads.
resultTypestringSuccessstate_machines, state_machine, executions, execution, sync_execution, history_events, or callback.
itemsarrayList/history successBounded normalized state machines, execution summaries, or history event envelopes.
countintegerList/history successNumber of returned items.
pagesintegerList/history successProvider pages consumed.
hasMorebooleanList/history successWhether AWS returned another page token.
nextTokenstringAnother page existsOpaque continuation token.
dataobjectNon-list successNormalized state-machine, execution, billing, redrive, stop, or callback receipt.
requestIdstringAWS supplies oneBounded request reference for reconciliation.
errorobjectFailureSafe {code, message, httpStatus?, retryable} details.

Execution input is never copied into output. Describe and synchronous execution responses can return bounded parsed execution output because that value is the operation's intended workflow result. History results contain only event ID, prior event ID, type, and timestamp; execution-data details remain disabled to avoid leaking task inputs or outputs through event history.

IntegrationAccount Requirements

Bind one AWS IntegrationAccount through the normalized ExecModule authentication relationship:

FieldRequirement
ProviderAmazon Web Services / Step Functions
statusMust be READY.
verifiedMust be true.
apiKey SecureFieldAWS access key ID.
password SecureFieldAWS secret access key.

Grant only the actions enabled for the workflow:

  • Discovery: states:ListStateMachines and states:DescribeStateMachine.
  • Start: states:StartExecution and, for Express workflows, states:StartSyncExecution.
  • Execution reads: states:ListExecutions, states:DescribeExecution, and states:GetExecutionHistory.
  • Lifecycle mutation: states:StopExecution and states:RedriveExecution where needed.
  • Callback tasks: states:SendTaskSuccess, states:SendTaskFailure, and states:SendTaskHeartbeat.

Restrict state-machine and execution resource ARNs wherever AWS supports resource-level permissions. State-machine definitions can invoke other AWS services under the state machine's execution role; the caller's IntegrationAccount does not replace that role. The connector currently supports a long-lived access-key pair. STS session credentials, role assumption, workload identity, and custom endpoints are deferred.

Configuration

The awsAccount relationship is the only credential configuration. Operation, region, resource ARN, and payload fields belong in mapped input or module parameters.

{
"version": "1.0.0",
"authConfig": {
"authStrategy": 1,
"integrationAccount": "integration-account:aws-step-functions-production"
},
"payloadConfig": {
"parameters": "{\"operation\":\"start_execution\",\"region\":\"us-west-2\"}"
}
}

The relationship value is illustrative. Persisted workflows bind the generated IntegrationAccount relationship, never plaintext credentials.

Operations

OperationProvider behaviorSide effect and retry behavior
list_state_machinesLists bounded Standard and Express state-machine metadata.Read-only; each page retries transient failures up to the configured bound.
describe_state_machineReads metadata for one exact machine, alias, or version without returning its definition.Read-only; bounded retry.
start_executionStarts an asynchronous Standard or Express execution with JSON input.Billable external side effect; one provider attempt. A repeated Standard start with the same name and input can be idempotent while running, but callers must reconcile exact state.
start_sync_executionStarts an Express workflow and waits for a terminal provider response.Billable external side effect; one attempt. HTTP success can still contain a failed execution status.
list_executionsLists bounded executions for one state machine and optional status.Read-only; opaque pagination and bounded retry.
describe_executionReads one execution and its bounded result metadata.Read-only; bounded retry.
get_execution_historyReads bounded event envelopes with execution data disabled.Read-only; opaque pagination and bounded retry. Standard workflows only.
stop_executionStops one running Standard execution after explicit confirmation.Destructive, single attempt; reconcile status after an ambiguous response.
redrive_executionRedrives one eligible unsuccessful Standard execution.State-changing, single attempt; an explicit clientToken provides provider idempotency.
send_task_successCompletes a callback task with bounded JSON output.State-changing, single attempt; task token is consumed and never echoed.
send_task_failureFails a callback task with bounded error/cause.State-changing, single attempt; task token is consumed and never echoed.
send_task_heartbeatExtends a callback task's heartbeat deadline.State-changing, single attempt; it does not create a durable completion receipt beyond AWS request evidence.

Errors and Failure Modes

CodeTypical causeRetryableResolution
VALIDATION_ERRORMissing/malformed region, ARN, JSON, name, status, token, pagination value, confirmation, or unexpected field.NoCorrect the named input; no provider request was sent.
UNSUPPORTED_OPERATIONUnknown operation.NoSelect a documented operation.
INTEGRATION_ACCOUNT_ERRORAccount missing, unverified, not READY, or missing key material.NoRepair and bind the AWS account.
AWS_STEP_FUNCTIONS_HTTP_400Invalid ARN, state, execution input, callback token, unsupported workflow type, or provider limit.Usually noInspect the exact resource and operation before changing input.
AWS_STEP_FUNCTIONS_HTTP_403IAM denies the action or resource.NoGrant only the missing permission under the intended conditions.
AWS_STEP_FUNCTIONS_HTTP_404State machine, execution, or callback task no longer exists.NoReconcile the immutable ARN/token and workflow state.
AWS_STEP_FUNCTIONS_HTTP_429 / 500 / 503Throttle or transient provider pressure.Reads retry; mutations report ambiguityInspect AWS state and the request ID before any replay.
NETWORK_ERRORDNS, TLS, timeout, or connectivity failure.Reads retry; mutations report ambiguityTreat mutation acceptance as unknown until exact provider state is read.
EXECUTION_ERRORUnexpected bounded runtime failure.No automatic replayPreserve operation and request evidence for investigation.

Provider exception messages are never copied into workflow output. This prevents credentials, task tokens, execution payloads, or unbounded service detail from leaking through errors.

Example

Start a named order-approval execution:

{
"operation": "start_execution",
"region": "us-west-2",
"stateMachineArn": "arn:aws:states:us-west-2:123456789012:stateMachine:OrderApproval",
"executionName": "order-A-1042",
"input": {
"orderId": "A-1042",
"riskTier": "reviewed",
"requestedAction": "approve"
}
}

Expected result shape:

{
"status": "success",
"operation": "start_execution",
"attempts": 1,
"resultType": "execution",
"data": {
"started": true,
"executionArn": "arn:aws:states:us-west-2:123456789012:execution:OrderApproval:order-A-1042",
"startDate": "2026-09-06T09:05:00Z"
},
"requestId": "aws-request-reference"
}

The receipt proves that AWS accepted the start request. It does not prove the execution completed successfully. Use describe_execution, EventBridge execution-status events, or an explicit callback path for terminal evidence.

Notes

  • Pagination: state-machine, execution, and history operations return one page unless returnAll=true; the connector follows opaque tokens with unchanged filters and stops at limit, exhaustion, or 100 pages.
  • Rate limits: Step Functions quotas vary by account, region, workflow type, and action. Read calls use at most five configured attempts with bounded backoff. Starts, stops, redrives, and callbacks never retry automatically.
  • API limits: JSON input/output is capped at 256 KiB, list/history output at 10,000 items, provider pages at 1,000 items, execution names at 80 characters, client tokens at 64, task tokens at 2,048 UTF-8 bytes, and diagnostics at 32 KiB.
  • Idempotency: Standard StartExecution uses the execution name and input for provider idempotency while the execution is running; Express starts are not idempotent. Redrive can use clientToken. ValkyrAI still sends each mutation once and requires read-after-ambiguity reconciliation.
  • Synchronous Express behavior: start_sync_execution can return HTTP success with FAILED, TIMED_OUT, or another terminal status in its body. Branch on the returned execution status, not only module status=success.
  • Destructive behavior: stop_execution requires confirmStop=true, applies only to running Standard executions, and cannot be undone.
  • Callback behavior: callback task tokens are bearer capabilities. Keep them private, send them once, and treat timeout/heartbeat acceptance as ambiguous until execution state is checked.
  • Execution history: event payload details are deliberately excluded. Use purpose-built downstream observability when a task's input/output detail must be retained under separate ACL controls.
  • State-machine definitions: discovery returns metadata, not Amazon States Language definitions. Definition create/update/validate/test belongs in a separately reviewed infrastructure deployment surface.
  • Deferred operations: create/update/delete state machine, versions/aliases, activities, Map Run controls, tagging, CloudWatch Logs configuration, X-Ray configuration, KMS configuration, and state-definition testing are not implemented.
  • Provider verification boundary: deterministic tests cover validation, region/ARN binding, JSON bounds, pagination, operation families, retry boundaries, stop confirmation, callback-token and credential redaction, error normalization, registration, and metadata. Live AWS behavior remains unverified until an authorized AWS account and reviewed state machine are supplied.
  • Functional reference: n8n's AWS Lambda node and AWS credential model inform resource discovery, JSON input, region, and tool-use ergonomics. ValkyrAI adds the Step Functions lifecycle and governance controls described above.
  • Runtime boundary: merged source and published documentation do not update the deployed Workflow Studio catalog until a ValkyrAI backend release exposes AwsStepFunctionsModule through /v1/modules/metadata.