Amazon States Language (ASL) is the JSON-based language used to define workflows in AWS Step Functions. It acts as the blueprint for how distributed applications, serverless processes, AI pipelines, and orchestration logic should execute.
Every AWS Step Functions state machine is ultimately powered by ASL.
If you have ever built a workflow in AWS that coordinates Lambda functions, queues, AI services, APIs, retries, or branching logic, you were working with Amazon States Language whether you realized it or not.
ASL allows developers to describe workflows declaratively instead of manually writing orchestration code. Rather than building complex coordination logic inside a single Lambda function, you define states, transitions, retries, conditions, and integrations in JSON.
This approach makes workflows easier to visualize, debug, scale, and maintain.
What Is a State Machine?
A state machine is a workflow composed of individual steps called states.
Each state performs a specific action such as:
- Running a Lambda function
- Sending a message to SQS
- Calling Amazon Bedrock
- Waiting for approval
- Processing items in parallel
- Making decisions with branching logic
- Publishing events to EventBridge
The workflow transitions from one state to another until execution completes.
In AWS Step Functions, ASL is the definition language used to describe those states and transitions.
Basic Structure of Amazon States Language
An ASL definition is written in JSON and contains:
- A
StartAtproperty - A collection of
States - Definitions for transitions and execution logic
Here is a simple example:
{
"Comment": "Simple workflow",
"StartAt": "ProcessOrder",
"States": {
"ProcessOrder": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123456789012:function:processOrder",
"End": true
}
}
}JSONThis workflow contains a single Task state that invokes a Lambda function.
All AWS Step Functions State Types
Amazon States Language supports multiple state types that together enable sophisticated orchestration patterns.
Task State
The Task state performs work.
Start free. No AWS account needed.
ZERO AWS costs.
Download Thrubit and run your first state machine locally in under five minutes. No cloud setup, no IAM policies, no waiting.
This is the most common state type and is used to invoke:
- AWS Lambda
- Amazon Bedrock
- SQS
- SNS
- DynamoDB
- ECS tasks
- Batch jobs
- API Gateway
- EventBridge
- SageMaker
- Glue jobs
- Custom SDK integrations
Example:
{
"Type": "Task",
"Resource": "arn:aws:states:::lambda:invoke"
}JSONTask states are the foundation of most workflows.
Choice State
Choice states add conditional branching logic.
They allow workflows to make decisions based on input data.
Example use cases:
- Order approval routing
- AI confidence thresholds
- Error handling paths
- User role decisions
Example:
{
"Type": "Choice",
"Choices": [
{
"Variable": "$.approved",
"BooleanEquals": true,
"Next": "ShipOrder"
}
],
"Default": "RejectOrder"
}JSONPass State
Pass states move or transform data without performing work.
They are useful for:
- Testing workflows
- Injecting mock data
- Reshaping JSON payloads
Wait State
Wait states pause execution for a duration or until a timestamp.
Common use cases include:
- Delayed retries
- Human approvals
- Scheduled processing
- Polling workflows
Succeed State
Marks successful completion of a workflow branch or execution.
Fail State
Explicitly terminates the workflow with an error.
Useful for validation failures and business logic enforcement.
Parallel State
Runs multiple branches simultaneously.
Example use cases:
- Concurrent API calls
- Parallel AI processing
- Multi-region operations
- Running independent validations
Map State
Processes arrays of items iteratively.
Map states are commonly used for:
- Batch processing
- CSV imports
- Large-scale transformations
- Parallel item execution
Modern distributed Map states can scale massively across large datasets.
Widely Used AWS Services in ASL Workflows
One of the most powerful aspects of Amazon States Language is native AWS service integration.
Instead of writing orchestration code manually, workflows can directly interact with AWS services.
AWS Lambda
Lambda is the most widely used integration with Step Functions.
It enables developers to execute code in response to workflow steps.
Typical use cases:
- Data transformation
- API integrations
- Validation
- Business logic
- AI preprocessing
- Notifications
Lambda works exceptionally well with ASL because Step Functions manages retries, error handling, branching, and execution flow automatically.
Learn more about local Lambdas in Thrubit.
Amazon Bedrock
Amazon Bedrock allows AI and generative AI capabilities to become part of workflows.
ASL workflows can integrate with Bedrock for:
- Text generation
- Retrieval-augmented generation (RAG)
- Knowledge base querying
- AI summarization
- Content moderation
- Guardrails
- AI agents
Common Step Functions Bedrock integrations include:
bedrock:invokeModelbedrock:retrievebedrock:retrieveAndGeneratebedrock:applyGuardrailbedrock-agent:invokeAgent
This enables intelligent AI workflows entirely within Step Functions.
Learn more about local Bedrock in Thrubit.
Amazon SQS
SQS is commonly used for decoupled messaging and asynchronous processing.
Step Functions workflows often use SQS to:
- Queue jobs
- Trigger downstream systems
- Coordinate distributed services
- Handle high-throughput workloads
Common integration:
"arn:aws:states:::sqs:sendMessage"JSONLearn more about local SQS in Thrubit.
Amazon S3
S3 is frequently used for workflow inputs and outputs.
Typical use cases:
- File ingestion
- Document processing
- AI training datasets
- Media pipelines
- CSV imports
- Large payload storage
Step Functions can use S3 with Map states for scalable file processing workflows.
Learn more about local S3 in Thrubit.
Amazon EventBridge
EventBridge enables event-driven architectures.
ASL workflows can publish events directly to EventBridge for:
- Microservice communication
- Workflow notifications
- Event fan-out
- Cross-system integrations
Common integration:
"arn:aws:states:::events:putEvents"JSONLearn more about local EventBridge in Thrubit.
DynamoDB
DynamoDB is often used for:
- Workflow state persistence
- User data
- Session tracking
- Metadata storage
- Transaction coordination
Learn more about local DynamoDB in Thrubit.
Amazon SNS
SNS enables notifications and pub/sub messaging.
Common use cases:
- Alerts
- Email notifications
- SMS workflows
- Event broadcasting
Amazon ECS and AWS Batch
Step Functions can orchestrate containerized workloads and long-running compute jobs.
These integrations are common in:
- Machine learning
- Video processing
- Scientific computing
- ETL pipelines
SageMaker
SageMaker integrations support machine learning workflows.
Step Functions can orchestrate:
- Model training
- Inference jobs
- Data preparation
- Hyperparameter tuning
API Gateway
Workflows can invoke APIs directly through API Gateway integrations.
This enables hybrid architectures between Step Functions and external systems.
Why Amazon States Language Matters
ASL simplifies orchestration by separating workflow logic from application code.
Benefits include:
- Visual workflows
- Easier debugging
- Built-in retries
- Error handling
- Scalability
- Reduced orchestration code
- Native AWS integrations
- Parallel execution
- Event-driven architectures
Instead of embedding orchestration logic inside Lambda functions, developers can centralize workflow coordination in ASL.
This creates cleaner and more maintainable architectures.
Challenges of Developing Step Functions in AWS
While Step Functions are powerful, developing directly in the cloud introduces challenges:
- Constant deployments
- Slow iteration cycles
- Lambda invocation costs
- Step transition costs
- Bedrock API costs
- Complex debugging
- Cloud dependency during development
- Difficult local testing
Even small workflow changes often require redeploying infrastructure and rerunning cloud executions.
As workflows grow more complex, debugging becomes increasingly expensive and time consuming.
Running Amazon States Language Workflows Locally with Thrubit
Thrubit solves this problem by allowing developers to run AWS Step Functions workflows locally using real Amazon States Language definitions.
Instead of constantly deploying to AWS, developers can execute workflows directly on their machine with visual debugging and real Lambda execution.
Thrubit supports local execution for many widely used Step Functions integrations including:
- Lambda
- Bedrock
- SQS
- EventBridge
- DynamoDB
- S3
- Nested state machines
- Parallel states
- Map states
- Choice states
- ResultSelector handling
- InputPath and OutputPath processing
This means developers can build and debug ASL workflows locally before deploying to AWS.
Benefits of Local Step Functions Development
Using local ASL development with Thrubit provides major advantages:
Faster Iteration
Make workflow changes instantly without redeploying.
ZERO AWS Costs During Development
Avoid paying for:
- Step transitions
- Lambda invocations
- Bedrock requests
- Queue operations
- EventBridge events
Visual Debugging
See execution flow through the state machine visually.
Local AI Workflow Testing
Run Bedrock-integrated workflows locally with mock responses or real AWS connections.
Better Developer Productivity
Developers can focus on workflow logic instead of deployment overhead.
The Future of Workflow Development
As serverless architectures, AI pipelines, and event-driven systems continue to grow, Amazon States Language is becoming increasingly important.
ASL has evolved beyond simple orchestration into a central layer for:
- AI systems
- Distributed applications
- Event processing
- Automation pipelines
- Data engineering
- Serverless microservices
Modern development workflows increasingly depend on fast local iteration, visual debugging, and cloud cost reduction.
That is why local-first workflow development tools like Thrubit are becoming essential for teams building complex AWS Step Functions applications.
Final Thoughts
Amazon States Language is the foundation of AWS Step Functions.
It provides a powerful way to define scalable workflows using JSON-based state machines that integrate deeply with AWS services like Lambda, Bedrock, SQS, S3, EventBridge, DynamoDB, and more.
By separating orchestration logic from application code, ASL enables cleaner architectures, visual workflows, and highly scalable automation systems.
As workflows become more sophisticated, local development becomes increasingly valuable.
Tools like Thrubit allow developers to run and debug ASL workflows locally with visual execution, real Lambda support, AI workflow testing, and ZERO AWS costs during development.