Overview
AWS Step Functions runs multi-step workflows — reward pipelines, match result processing, moderation, crafting queues, account deletion, AI chains — as state machines on AWS. StepFlow connects Unreal Engine 4.27 and 5.8 to it. Every request runs on a background worker thread with automatic retries; every result arrives back on the game thread.
- Start Execution, Run Execution (start + wait) and Wait For Execution with progress pins and a timeout.
- Start Sync Execution: Express workflows in one call, with output, error / cause and billed duration / memory.
- Describe, stop, list (status / redrive filters, paging) and redrive executions; full execution history with typed events, state timeline and error extraction.
- State machines: list, describe, create, update, delete, validate definitions on the service, versions and aliases.
- Activities and callbacks: the StepFlow Activity Worker component long-polls tasks in the background and answers them with Send Task Success / Failure, with automatic heartbeats; task tokens from
waitForTaskToken integrations work too.
- Distributed Map runs: list, describe and update.
- ARN builders and parsers, execution name and trace header helpers, JSON helpers.
Requirements
| Requirement | Details |
| Unreal Engine | 4.27 and 5.8 |
| Platforms | Win64, Linux and Android |
| Modules | StepFlow (Runtime), StepFlowSdk (prebuilt AWS SDK for C++ 1.11.916 in Source/ThirdParty) |
| Dependencies | No other plugins. On Linux and Android the SDK uses the engine's libcurl, OpenSSL and certificate store. |
| AWS | An AWS account. Step Functions and Cognito usage is billed by AWS. |
Installation
- Install StepFlow from Fab into your engine, or copy the
StepFlow folder into your project's Plugins folder.
- Enable StepFlow in Edit > Plugins and restart the editor.
- Open Project Settings > Plugins > StepFlow and set Region, Identity Pool Id and (optional, recommended) Account Id and Default State Machine Arn.
- C++ only: add
PublicDependencyModuleNames.Add("StepFlow"); to your Build.cs.
Plain names instead of ARNsWith the Account Id set, every node accepts QuestRewards where it would need arn:aws:states:us-east-1:123456789012:stateMachine:QuestRewards; empty State Machine pins use the Default State Machine Arn.
Several AWS plugins in one projectEach Alpha XP cloud plugin carries its own copy of the SDK under a plugin-specific name, so they install side by side without conflicts.
Setting up AWS
- Create your state machine in the Step Functions console (Standard for long, durable workflows; Express for short, high-volume ones you want to run synchronously). Note its ARN.
- For an activity worker, create an activity (console or Create Activity) and use it in a Task state:
"Resource": "arn:aws:states:us-east-1:123456789012:activity:CraftItem". Add "HeartbeatSeconds" if tasks may take long.
- In Amazon Cognito create an identity pool (guest access if players may act before signing in, plus your identity providers).
- Give the pool's player role only what the game needs. Least-privilege player policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RunGameWorkflows",
"Effect": "Allow",
"Action": ["states:StartExecution", "states:StartSyncExecution"],
"Resource": "arn:aws:states:us-east-1:123456789012:stateMachine:mygame-*"
},
{
"Sid": "FollowGameExecutions",
"Effect": "Allow",
"Action": ["states:DescribeExecution", "states:GetExecutionHistory", "states:StopExecution"],
"Resource": "arn:aws:states:us-east-1:123456789012:execution:mygame-*:*"
},
{
"Sid": "ActivityWorker",
"Effect": "Allow",
"Action": ["states:GetActivityTask"],
"Resource": "arn:aws:states:us-east-1:123456789012:activity:mygame-*"
},
{
"Sid": "AnswerTasks",
"Effect": "Allow",
"Action": ["states:SendTaskSuccess", "states:SendTaskFailure", "states:SendTaskHeartbeat"],
"Resource": "*"
}
]
}
Answers to callback (waitForTaskToken) tasks are not tied to an ARN, so the task-token actions usually need "Resource": "*"; if the game only answers activity tasks you can limit them to the activity ARNs. Only grant them to roles that really answer tasks (often a server role, not the guest role). For Express executions use the express: resource type in the execution ARN (...:express:mygame-*:*:*).
Admin nodes (Create / Update / Delete State Machine, Publish State Machine Version, Create / Delete Activity, Update Map Run, Redrive Execution, List State Machines / Activities, Validate State Machine Definition) need states:CreateStateMachine, states:UpdateStateMachine, states:DeleteStateMachine, states:PublishStateMachineVersion, states:CreateActivity, states:DeleteActivity, states:UpdateMapRun, states:RedriveExecution, states:List*, states:Describe*, states:ValidateStateMachineDefinition and iam:PassRole on the workflow role. Use them in tools, editor utilities and dedicated servers — not in player roles.
Never ship access keysStatic keys in the settings end up in DefaultGame.ini and in packaged games. Use them only for development and dedicated servers; players should always use the identity pool. Shipping builds refuse settings keys unless Allow Static Keys In Shipping is enabled.
Quick start
Run a workflow and use its result
- Build the input: Make JSON Object with
playerId = Get Identity Id, questId = Q42.
- Call Run Execution with State Machine
mygame-QuestRewards (or empty for the default) and that input.
- On Polled fires after every check (show a spinner, read Execution > Status).
- On Succeeded: Get JSON Field on Execution > Output with Path
rewards[0].itemId, or JSON To Struct into your reward struct.
- On Failed: Error > Code is the workflow error (for example
States.TaskFailed) or an API error; Error > Message the cause.
Express workflow, one call
Start Sync Execution runs an Express state machine and returns its output in the same node (up to 5 minutes). Check Result > Status: Succeeded, Failed or Timed Out. Billed Duration Ms and Billed Memory MB show what AWS charges.
Inspect what happened
Get Execution History returns every event; feed it to Get State Timeline for per-state durations, Get Last Error And Cause to find the state that failed, or Get State Output to read one state's result.
Activity worker
An activity is a Task state whose work is done by an outside worker — here, your game or dedicated server (spawn an NPC event, run a simulation, grant items that only the server may grant, ask a human moderator in a tool).
- Add the StepFlow Activity Worker component to an actor (Game Mode on a server, or any actor). Set Activity (ARN or name), optionally Auto Start, Max Pending Tasks and Auto Heartbeat Interval.
- Call Start Worker. The component long-polls
GetActivityTask on a background thread (each poll waits up to 60 seconds on AWS; the game thread is never blocked).
- On Task Received gives the task token and JSON input. Do the work, then call Complete Current Task with a JSON output, or Fail Current Task with an error name (match it in the state's Catch / Retry) and a cause.
- While Max Pending Tasks tasks are unanswered the worker pauses polling (Waiting) and resumes after an answer.
- With Auto Heartbeat Interval > 0 the component sends heartbeats for every pending task; a task that timed out on AWS fires On Task Lost and is removed.
StoppingStop Worker stops polling at once on Linux and Android; on Windows a poll that is already waiting on AWS ends by itself (within 60 seconds) and the state stays Stopping until then. A task that this last poll still brings is delivered normally. The long poll occupies one of the plugin's worker threads, so keep Worker Threads above the number of running workers.
Callback tasks: for .waitForTaskToken integrations (Lambda, SQS, EventBridge, ...) pass $$.Task.Token to the game in the message, then answer with Send Task Success / Send Task Failure / Send Task Heartbeat (or the component's Complete Task / Fail Task by token).
Node reference (79 nodes)
Latent nodes (Latent) run in the background, can be stopped with Cancel on their return value and fire exactly one final pin on the game thread (Wait For Execution / Run Execution also fire On Polled on the way). Every Error output is an FStepFlowError (Code, Message, Http Status, Retryable). State Machine inputs take an ARN, a version or alias ARN, or a plain name (with Account Id set); empty = Default State Machine Arn.
Executions
| Node | Kind | Inputs | Outputs | Purpose |
| Start Execution | Latent | State Machine, Input, Name, Trace Header | On Success / On Failure (Execution, Error) | Starts a workflow and returns its Execution Arn at once. |
| Start Sync Execution | Latent | State Machine, Input, Name, Trace Header, Include Data | On Completed / On Failure (Result, Error) | Runs an Express workflow and returns output, error / cause and billing. |
| Run Execution | Latent | State Machine, Input, Name, Poll Interval Seconds, Timeout Seconds | On Succeeded / On Failed / On Polled (Execution, Error) | Start Execution + Wait For Execution in one node. |
| Wait For Execution | Latent | Execution Arn, Poll Interval Seconds, Timeout Seconds | On Succeeded / On Failed / On Polled | Polls until the execution ends; failures carry the workflow error in Error. |
| Describe Execution | Latent | Execution Arn, Include Data | On Success / On Failure (Execution, Error) | Status, times, input / output, error / cause, redrive status. |
| Stop Execution | Latent | Execution Arn, Error, Cause | On Success / On Failure (Error) | Aborts a running execution. |
| Redrive Execution | Latent | Execution Arn | On Success / On Failure (Error) | Restarts a failed Standard execution from its failed states. |
| List Executions | Latent | State Machine, Status Filter, Redrive Filter, Map Run Arn, Max Results, Next Token | On Success / On Failure (Executions, Next Token, Error) | One page of executions, newest first. |
| Get Execution History | Latent | Execution Arn, Fetch All, Reverse Order, Include Data, Max Results, Next Token | On Success / On Failure (Events, Next Token, Error) | The typed event log of an execution (all pages by default). |
| Is Terminal Status | Pure | Status | Boolean | True for Succeeded, Failed, Timed Out, Aborted. |
| Make Unique Execution Name | Callable | Prefix | String | Prefix-yyyyMMdd-HHmmss-random, max 80 chars (idempotent starts). |
| Is Valid Execution Name | Pure | Name | Boolean | Checks the AWS naming rules. |
| Make Trace Header | Callable | Sampled | String | New AWS X-Ray trace header for Start Execution. |
| Get Execution Console Url | Pure | Execution Arn | String | Link to the execution in the AWS console. |
History helpers
| Node | Kind | Inputs | Outputs | Purpose |
| Get Events Of Type | Pure | Events, Type, Contains | Events | Filters events by type (exact or substring, e.g. "Failed"). |
| Get Last Error And Cause | Pure | Events | Boolean, Error, Cause, State Name | The newest failure and the state it happened in. |
| Get State Timeline | Pure | Events | State Visits | One entry per state visit with entered / exited times and duration. |
| Get State Output | Pure | Events, State Name | Boolean, Output | JSON output of a state's last exit. |
State machines
| Node | Kind | Inputs | Outputs | Purpose |
| List State Machines | Latent | Max Results, Next Token | On Success / On Failure (State Machines, Next Token, Error) | The account's state machines in the region. |
| Describe State Machine | Latent | State Machine, Include Definition | On Success / On Failure (State Machine, Error) | Type, status, role, revision, definition. |
| Describe State Machine For Execution | Latent | Execution Arn | On Success / On Failure (State Machine, Error) | The exact definition an execution ran with. |
| Create State Machine | Latent admin | Name, Definition, Role Arn, Type, Publish, Version Description | On Success / On Failure (State Machine, Error) | Creates a state machine (optionally publishing version 1). |
| Update State Machine | Latent admin | State Machine, Definition, Role Arn, Publish, Version Description | On Success / On Failure (State Machine, Error) | Changes definition / role; returns the new revision. |
| Delete State Machine | Latent admin | State Machine | On Success / On Failure (Error) | Deletes a state machine. |
| Validate State Machine Definition | Latent | Definition, Type, Max Results | On Success / On Failure (Validation, Error) | Server-side ASL check with errors, warnings and JSON paths. |
| Publish State Machine Version | Latent admin | State Machine, Description, Revision Id | On Success / On Failure (State Machine, Error) | Publishes the current revision as a version. |
| List State Machine Versions | Latent | State Machine, Max Results, Next Token | On Success / On Failure (Versions, Next Token, Error) | Published versions with numbers. |
| List State Machine Aliases | Latent | State Machine, Max Results, Next Token | On Success / On Failure (Aliases, Next Token, Error) | Aliases of a state machine. |
| Describe State Machine Alias | Latent | Alias Arn | On Success / On Failure (Alias, Error) | Alias description and version routing weights. |
Activities and task tokens
| Node | Kind | Inputs | Outputs | Purpose |
| Create Activity | Latent admin | Name | On Success / On Failure (Activity, Error) | Creates (or returns) an activity. |
| Delete Activity | Latent admin | Activity | On Success / On Failure (Error) | Deletes an activity. |
| List Activities | Latent | Max Results, Next Token | On Success / On Failure (Activities, Next Token, Error) | The account's activities. |
| Describe Activity | Latent | Activity | On Success / On Failure (Activity, Error) | Name, ARN, creation time. |
| Get Activity Task | Latent | Activity, Worker Name | On Task / On No Task / On Failure (Task, Error) | One long poll (up to 60 s, background thread). |
| Send Task Success | Latent | Task Token, Output | On Success / On Failure (Error) | Completes a task with JSON output. |
| Send Task Failure | Latent | Task Token, Error, Cause | On Success / On Failure (Error) | Fails a task with an error name and cause. |
| Send Task Heartbeat | Latent | Task Token | On Success / On Failure (Error) | Keeps a long task alive. |
Activity worker component
| Node | Kind | Inputs | Outputs | Purpose |
| Start Worker | Callable | Activity Override | — | Starts background polling. |
| Stop Worker | Callable | — | — | Stops polling; pending tasks stay answerable. |
| Is Running | Pure | — | Boolean | Polling or waiting for answers. |
| Get Worker State | Pure | — | Stopped / Polling / Waiting / Stopping | Detailed state. |
| Complete Current Task | Callable | Output | Boolean | Answers the oldest pending task with success. |
| Fail Current Task | Callable | Error, Cause | Boolean | Answers the oldest pending task with failure. |
| Complete Task | Callable | Task Token, Output | — | Answers a task by token. |
| Fail Task | Callable | Task Token, Error, Cause | — | Fails a task by token. |
| Hand Off Task | Callable | Task Token | Boolean | Forgets a task you passed to someone else (frees a pending slot). |
| Get Current Task Token | Pure | — | String | Token of the oldest pending task. |
| Get Current Task | Pure | — | Boolean, Task | The oldest pending task. |
| Get Pending Tasks | Pure | — | Tasks | All unanswered tasks. |
| Send Heartbeat Now | Callable | — | — | Heartbeats every pending task. |
| Set Auto Heartbeat Interval | Callable | Seconds | — | 0 = off. |
| Get Stats | Pure | — | Worker Stats | Received / completed / failed, heartbeats, empty polls, errors, uptime. |
Events: On Task Received (Task), On Task Answered (Task Token, Delivered, Error), On Task Lost (Task Token, Error), On Worker Error (Error), On Worker Stopped.
Map runs
| Node | Kind | Inputs | Outputs | Purpose |
| List Map Runs | Latent | Execution Arn, Max Results, Next Token | On Success / On Failure (Map Runs, Next Token, Error) | Distributed Map runs of an execution. |
| Describe Map Run | Latent | Map Run Arn | On Success / On Failure (Map Run, Error) | Status, concurrency, tolerance, item / execution counters. |
| Update Map Run | Latent admin | Map Run Arn, Max Concurrency, Tolerated Failure Percentage, Tolerated Failure Count (-1 = keep) | On Success / On Failure (Error) | Tunes a running Map run. |
ARNs
| Node | Kind | Inputs | Outputs | Purpose |
| Make State Machine Arn | Pure | Name, Qualifier, Region, Account Id | String | Builds a state machine / version / alias ARN. |
| Make Activity Arn | Pure | Name, Region, Account Id | String | Builds an activity ARN. |
| Make Execution Arn | Pure | State Machine, Execution Name, Express | String | ARN of a named execution. |
| Parse Arn | Pure | Arn | Boolean, Parts | Partition, region, account, type, name, qualifier. |
| Get Name From Arn | Pure | Arn | String | State machine / activity name. |
| Get Execution Name | Pure | Execution Arn | String | Execution name at the end of the ARN. |
Config and identity
| Node | Kind | Inputs | Outputs | Purpose |
| Set Region | Callable | Region | — | Region for every following request. |
| Set Credential Mode | Callable | Mode | — | Overrides the settings' credential mode. |
| Set Login Token | Callable | Provider, Token | — | Signs the player in to the identity pool. |
| Clear Login Tokens | Callable | — | — | Back to guest. |
| Set Static Credentials | Callable | Access Key Id, Secret Access Key, Session Token | — | Keys from your backend (Static Keys mode). |
| Get Identity Id | Pure | — | String | Cognito identity id of the player. |
| Make User Pool Provider Name | Pure | Region, User Pool Id | String | Login key of a Cognito user pool. |
| Is Configured | Pure | — | Boolean, Problem | False with a reason when settings are incomplete. |
| Set Default State Machine | Callable | State Machine | — | Runtime override of Default State Machine Arn. |
| Set Account Id | Callable | Account Id | — | Runtime override of Account Id (plain names). |
| Resolve Identity | Latent | Force Refresh | On Success / On Failure (Identity Id, Error) | Fetches credentials now (right after login). |
| Cancel | Callable | (latent node) | — | Stops waiting; no pins fire any more. |
| Is Finished | Pure | (latent node) | Boolean | True after finish or cancel. |
JSON
| Node | Kind | Inputs | Outputs | Purpose |
| Struct To JSON | Callable | Struct | Boolean, Json | Any struct to a JSON object (execution input). |
| JSON To Struct | Callable | Json | Boolean, Out Struct | Execution output into a struct. |
| Get JSON Field | Pure | Json, Path | Boolean, Value | One value by path such as rewards[0].itemId. |
| Make JSON Object | Pure | Fields (map), Parse Values | String | Builds an input object from key / value pairs. |
| Set JSON Field | Pure | Json, Path, Value, Value Is Json | Boolean, Result | Sets a (nested) field and returns the new JSON. |
Credentials
| Mode | Use for | How |
| Cognito Identity Pool | Game clients | Guests get unauthenticated credentials; after Set Login Token the player gets the authenticated role. Credentials refresh automatically before they expire. |
| Static Keys | Development, dedicated servers, keys from your backend | Settings keys or Set Static Credentials (with an optional session token). |
| Default Credential Chain | Servers and tools | Environment variables, the ~/.aws profile, ECS and EC2 instance roles. |
C++ API
// Build.cs: PublicDependencyModuleNames.Add("StepFlow");
#include "StepFlowLibrary.h"
UStepFlowLibrary::StartSyncExecutionNative(TEXT("mygame-ScoreCheck"), TEXT("{\"score\":1200}"),
FStepFlowNativeSyncDelegate::CreateLambda([](const FStepFlowSyncResult& Result, const FStepFlowError& Error)
{
// runs on the game thread; Result.Status, Result.Output, Error.Code
}));
StartExecutionNative works the same for Standard workflows. The latent node classes (UStepFlowWaitAction and the others) can be created from C++ through their static factory functions; bind the delegates, then call Activate(). The worker is a normal component: UStepFlowActivityWorkerComponent.
Types
| Type | Kind | Members |
| FStepFlowExecution | Struct | Execution Arn, Name, State Machine Arn / Version Arn / Alias Arn, Status, Finished, Input, Output, Error, Cause, Start / Stop Time, Duration Seconds, Map Run Arn, Redrive Count / Status / Reason, Trace Header |
| FStepFlowSyncResult | Struct | Execution Arn, Name, State Machine Arn, Status, Input, Output, Error, Cause, Start / Stop Time, Duration Seconds, Billed Duration Ms, Billed Memory MB, Trace Header |
| FStepFlowHistoryEvent | Struct | Id, Previous Event Id, Type, Timestamp, State Name, Error, Cause, Details Json |
| FStepFlowStateVisit | Struct | State Name, Entered / Exited Event Id, Entered / Exited Time, Duration Seconds, Exited |
| FStepFlowStateMachine | Struct | Arn, Name, Type, Status, Definition, Role Arn, Description, Label, Revision Id, Version Arn, Creation / Update Time |
| FStepFlowVersionInfo / FStepFlowAliasInfo / FStepFlowRoutingEntry | Struct | Version Arn + Number; Alias Arn, Name, Description, Routing (version + weight) |
| FStepFlowActivity / FStepFlowActivityTask | Struct | Activity Arn, Name, Creation Time; Task Token, Input, Activity Arn, Worker Name, Received Time, Last Heartbeat Time |
| FStepFlowWorkerStats | Struct | Tasks Received / Completed / Failed, Heartbeats Sent, Empty Polls, Poll Errors, Uptime Seconds, Last Error |
| FStepFlowMapRun / FStepFlowMapRunCounts | Struct | Map Run Arn, Execution Arn, Status, times, Max Concurrency, tolerances, Execution / Item Counts (pending, running, succeeded, failed, timed out, aborted, total, ...) |
| FStepFlowValidation / FStepFlowDiagnostic | Struct | Valid, Truncated, Error / Warning Count, Diagnostics (Severity, Code, Message, Location) |
| FStepFlowArn | Struct | Partition, Service, Region, Account Id, Resource Type, Resource Name, Qualifier |
| FStepFlowError | Struct | Code, Message, Http Status, Retryable |
| EStepFlowExecutionStatus | Enum | Any / Unknown, Running, Succeeded, Failed, Timed Out, Aborted, Pending Redrive |
| EStepFlowStateMachineType / EStepFlowMapRunStatus / EStepFlowRedriveFilter / EStepFlowWorkerState / EStepFlowCredentialMode | Enum | Standard / Express; Map run states; Any / Redriven / Not Redriven; Stopped / Polling / Waiting / Stopping; credential modes |
Settings
Project Settings > Plugins > StepFlow (saved to DefaultGame.ini). Changes apply to the next request.
| Setting | Default | Description |
| Region | us-east-1 | Region of your state machines and identity pool. |
| Credential Mode | Cognito Identity Pool | Cognito Identity Pool, Static Keys or Default Credential Chain. |
| Identity Pool Id | (empty) | For example us-east-1:01234567-89ab-cdef-0123-456789abcdef. |
| Allow Guest Access | On | Unauthenticated identities before Set Login Token. |
| Access Key Id / Secret Access Key | (empty) | Static Keys mode - development and servers only. |
| Allow Static Keys In Shipping | Off | Settings keys are refused in Shipping builds unless enabled. |
| Endpoint Override | (empty) | Custom endpoint such as a local Step Functions emulator. |
| Request Timeout Ms / Connect Timeout Ms | 30000 / 5000 | Time limits of normal requests. |
| Max Retries | 3 | Automatic retries for throttling and transient errors (normal requests). |
| Worker Threads | 4 | Background threads; each running activity poll holds one. |
| Verify SSL / Log Sdk Warnings | On / On | TLS verification; SDK warnings to LogStepFlow. |
| Default State Machine Arn | (empty) | Used by nodes whose State Machine pin is empty. |
| Account Id | (empty) | Lets nodes take plain names instead of ARNs. |
| Activity Worker Name | (computer name) | Worker name sent with Get Activity Task. |
| Long Request Timeout Ms | 310000 | Timeout of Get Activity Task (60 s long poll) and Start Sync Execution (up to 5 min); no automatic retries, so a workflow is never started twice. |
| Wait Poll Interval Seconds | 2 | Interval of Wait For Execution / Run Execution when the node says 0. |
Troubleshooting
| Error code | Cause and fix |
NotConfigured | Set the Identity Pool Id in Project Settings > Plugins > StepFlow, or switch the credential mode. |
MissingArn | The State Machine / Execution / Activity pin is empty and no default is set. |
InvalidArn | A plain name was passed without an Account Id in the settings, or the ARN is malformed. Use Make State Machine Arn. |
AccessDeniedException | The role lacks the states: action on that resource (see Setting up AWS). |
StateMachineDoesNotExist / ExecutionDoesNotExist / ActivityDoesNotExist | Wrong name, region or account. |
ExecutionAlreadyExists | The execution name was used before with a different input (names are unique for 90 days). Use Make Unique Execution Name. |
StateMachineTypeNotSupported | Start Sync Execution only runs Express state machines. |
TaskTimedOut / TaskDoesNotExist | The task expired before the answer (raise TimeoutSeconds / use heartbeats) or was answered already. |
Timeout | Wait For Execution hit its Timeout Seconds; the execution keeps running on AWS. |
Unavailable | The SDK library could not be loaded or the engine is shutting down. Check the Output Log for LogStepFlow errors. |
Credits
© 2026 Alpha XP — alphaxp.net · Support: support@alphaxp.net.
Includes the AWS SDK for C++ and the AWS Common Runtime (Apache License 2.0). Built for Unreal Engine 4.27 and 5.8.