aws_sfn_state_machine cost estimation
Workflow orchestration. Standard workflows at $0.025 per 1,000 state transitions. Express workflows at $1 per 1M requests + duration fees. Standard for long-running workflows; Express for high-volume short workflows.
AWS Step Functions orchestrates Lambda, ECS tasks, and other AWS services via state machines. The aws_sfn_state_machine resource defines the workflow. Two pricing tiers exist with very different economics.
Standard workflows: $0.025 per 1,000 state transitions. Designed for long-running workflows (up to 1 year). Suitable for human approvals, multi-step batch processing, ETL pipelines. Each state transition (one step to another) counts.
A typical Standard workflow with 10 states executing 1M times/month: 10 transitions × 1M × $0.000025 = $250/month for transitions, plus the cost of underlying Lambda/ECS calls.
Express workflows: $1 per 1M requests + $0.00001667/GB-second duration. Designed for high-volume, short-duration workflows (up to 5 minutes). For event processing, microservice orchestration, real-time data ingestion.
The same 10-step workflow on Express with 50ms duration: - 1M requests × $0.000001 = $1 - 1M × 0.05s × 0.064 GB × $0.00001667 = $0.05 - Total: ~$1/month (compared to $250 for Standard)
The choice depends on duration and volume. Express is 50-100x cheaper for workflows that complete in seconds. Standard is required for workflows over 5 minutes (Express's hard limit).
c3x estimates Step Functions based on type (STANDARD vs EXPRESS) and expected execution volume specified in c3x-usage.yml.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "aws_sfn_state_machine" "order_workflow" {
name = "order-workflow"
role_arn = aws_iam_role.sfn.arn
type = "STANDARD"
definition = jsonencode({
Comment = "Order processing workflow"
StartAt = "ValidateOrder"
States = {
ValidateOrder = {
Type = "Task"
Resource = aws_lambda_function.validate.arn
Next = "ChargePayment"
}
ChargePayment = {
Type = "Task"
Resource = aws_lambda_function.charge.arn
End = true
}
}
})
logging_configuration {
log_destination = "${aws_cloudwatch_log_group.sfn.arn}:*"
include_execution_data = true
level = "ALL"
}
}Pricing dimensions
What you actually pay for when you provision aws_sfn_state_machine.
| Dimension | Unit | What's being charged |
|---|---|---|
| Standard state transitions | per 1,000 transitions | Each state transition in a Standard workflow execution. Tiered by region. $0.025 per 1,000 transitions |
| Express requests | per 1M requests | Each Express workflow execution counts as one request. $1.00 per 1M requests |
| Express duration | per GB-second | Duration of Express executions, billed similar to Lambda compute. $0.00001667/GB-second |
| CloudWatch Logs | per GB | If execution logging is enabled (recommended), CloudWatch Logs ingestion fees apply. $0.50/GB ingested |
Optimization tips
Common ways to reduce aws_sfn_state_machine cost without changing the workload.
Use Express for high-volume short workflows
50-100x for short workflowsExpress is 50-100x cheaper than Standard for sub-5-minute workflows. Switch type from STANDARD to EXPRESS for event-driven and microservice orchestration. Workflows over 5 min must stay on Standard.
Minimize state transitions
Proportional to transition reductionEach transition bills. Combining sequential simple states into a single state (via Parallel or Map) reduces transition count. For a workflow with 20 sequential steps, restructuring to use Parallel where possible can cut transitions in half.
Skip logging non-critical executions
$0.50/GB on log volume savedExecution logging is helpful for debugging but generates CloudWatch Logs ingestion. For high-volume workflows, log only errors. Set logging level to ERROR instead of ALL.
Use Map for batch operations
Processing 1000 items: a Map state with 1000 iterations counts as 1000 transitions. But Distributed Map can process much larger batches more efficiently. Or batch items inside Lambda and process as a single state.
FAQ
When is Express the wrong choice?
Workflows longer than 5 minutes — Express has a hard limit. Workflows with human approvals or callbacks. Workflows needing waitForCallback patterns. Use Standard for these. Express also has fewer service integrations (no synchronous wait patterns).
How do I reduce transition counts?
Combine sequential states into a single Lambda that does the work internally. Use Parallel states to run independent steps simultaneously (still 1 transition each, but they happen in parallel). Use Map for batch operations to process arrays in a single state's execution.
Is Step Functions cheaper than Lambda for orchestration?
Step Functions ADDS to Lambda costs — it doesn't replace them. The Lambdas you call still bill normally. SFN bills extra for orchestration (transitions). The value is in reliability, retries, error handling, and observability, not cost.
What's the limit on workflow duration?
Standard: 1 year. Express: 5 minutes. For long-running workflows, Standard is the only option. For very long workflows (hours/days), the slow polling for completion contributes to transition count and cost.
Related resources
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including aws_sfn_state_machine.