For years, one number followed AWS Lambda developers everywhere: 15 minutes.
If a task needed more time, we had to split it into smaller pieces, coordinate those pieces with a workflow service, or consider running the workload on containers.
Now, AWS has raised the maximum timeout for on-demand Lambda Event Functions to 30 minutes. That opens the door to longer-running tasks—but it also raises an important architecture question:
If Lambda can run for 30 minutes, when should we still use Step Functions, SQS, or ECS?
The answer isn't simply “use Lambda for everything.” A longer timeout gives us another option. It doesn't remove the need to choose the right execution model.
Figure: The longer Lambda timeout expands our options, but the workload should still determine the architecture.
1. What Actually Changed?
AWS announced that on-demand Lambda Event Functions can run for up to 30 minutes per invocation, doubling the previous 15-minute limit. The new limit applies to synchronous, asynchronous, and supported event source mapping invocations.
This is useful for workloads such as:
- Processing large media files
- Generating reports from multiple data sources
- Running longer AI inference tasks
- Performing financial calculations
- Executing ETL steps triggered by S3 or SQS events
For example, imagine a function that processes a large video and takes 22 minutes to finish. A 15-minute timeout would have forced us to split the work or move it to another compute option. With the new limit, that task may fit into one Lambda invocation.
But “may fit” is not the same as “should run as one function.”
A single invocation is a good fit when the work is self-contained, can safely be retried, and doesn't need to preserve progress across multiple stages.
2. What the Longer Timeout Does—and Doesn't—Mean
The timeout controls how long one Lambda invocation can run. It does not automatically make a multi-step process reliable, resumable, or inexpensive.
A longer-running function still needs to account for:
- Retries and duplicate event delivery
- Downstream services timing out
- Network connections or temporary credentials expiring
- Concurrency limits
- Failures that happen near the end of a long task
Longer execution times can also increase concurrency requirements. At the same request rate, a function that runs for 30 minutes can require twice the concurrency of one that runs for 15 minutes.
So before increasing a timeout, ask:
Is this really one long task, or is it a workflow made up of several tasks?
That question helps determine which AWS service pattern makes sense.
3. When Is a Longer Lambda Invocation a Good Fit?
Lambda is a strong option when you have a discrete task that starts from an event, runs, and finishes.
For example:
S3 file uploaded | v Lambda function | v Process file | v Save result Suppose a user uploads a large document. A Lambda function extracts its contents, performs a transformation, and saves the result.
If the task takes 20 minutes, fits within Lambda's limits, and can safely restart after failure, the longer timeout may simplify the design.
You may not need to split the work into several smaller functions just to stay under the old 15-minute limit.
However, if the task is expensive to repeat from the beginning, consider checkpointing or splitting it into recoverable stages. A longer timeout alone does not save progress when an invocation fails.
4. When Should You Use Step Functions?
AWS Step Functions is useful when the work is better represented as a workflow rather than one long function.
Imagine an order-processing system:
Receive order | v Validate order | v Process payment | v Update inventory | v Send confirmation Each stage may have different failure conditions, retry rules, and recovery steps.
Step Functions can coordinate those stages, including branching, parallel work, retries, and error handling. It can also invoke Lambda functions.
The 30-minute Lambda timeout does not replace Step Functions. It simply means that an individual Lambda task inside a workflow can run longer where supported.
Use Step Functions when the workflow itself needs coordination. Don't add it only because a single function used to hit the 15-minute limit.
5. When Should You Use SQS?
Amazon SQS solves a different problem: it helps decouple work from the system that creates it.
Imagine a website where users upload documents for processing.
Without a queue, the frontend-facing backend might have to wait for processing to finish. That can make requests slow and tie up application resources.
With SQS, the backend can place a message on a queue and return a response. A worker processes the job separately.
User uploads file | v Backend API | v SQS Queue | v Lambda worker | v Process document SQS is useful when you need to buffer bursts of work, decouple producers from consumers, or process jobs asynchronously.
A longer Lambda timeout can make an SQS-triggered worker suitable for some longer tasks. But the queue configuration matters.
For SQS event source mappings, AWS recommends setting the queue's visibility timeout to at least six times the function timeout. For a 30-minute function, that means at least three hours.
Also, design the worker to be idempotent: a message can be processed more than once, so repeating the operation should not accidentally create duplicate payments, records, or other side effects.
6. When Does ECS or Fargate Make More Sense?
AWS Lambda is not the only way to run code without managing servers directly.
Amazon ECS with AWS Fargate is a good option when you need to run containerized workloads with more control over the runtime environment.
For example, a video-processing application might need:
- A custom container image with specialized dependencies
- A process that runs for several hours
- More control over how the application starts and operates
- A worker service that continuously consumes jobs
A container-based architecture might look like this:
Application | v SQS Queue | v ECS Service on Fargate | v Process job | v Store result Fargate removes the need to manage the underlying EC2 instances, but you still configure and operate the ECS tasks and services. It is not automatically cheaper or simpler than Lambda; the right choice depends on workload duration, traffic patterns, dependencies, and operational needs.
7. Quick Comparison: Lambda vs. Step Functions vs. SQS vs. ECS
These services aren't direct substitutes for one another. They solve different parts of an architecture.
| Option | Main purpose | Consider it when |
|---|---|---|
| Lambda | Run code in response to events | A task is self-contained and fits within the execution limits |
| Step Functions | Coordinate workflow steps | You need branching, retries, parallel stages, or workflow-level recovery |
| SQS | Queue and buffer work | You need asynchronous processing and decoupling between systems |
| ECS/Fargate | Run containerized workloads | You need more runtime control or longer-running container processes |
You can also combine them. For example, SQS can buffer jobs, ECS can process them, and Step Functions can coordinate a separate multi-stage workflow.
The goal is not to pick one AWS service for the entire system. It's to use each service where it solves the right problem.
8. A Practical Decision Example
Let's say you're building a document-processing application.
A user uploads a file, and your system must extract text, classify the content, and save the result.
Option A: One Lambda invocation
Use one Lambda function if the processing is a single, retryable task that reliably finishes within the timeout.
Option B: SQS + Lambda
Use SQS and Lambda if uploads can arrive in bursts and you want the API to accept jobs without waiting for processing to finish.
Option C: Step Functions + Lambda
Use Step Functions if the process has distinct stages, such as extraction, classification, validation, and review, with different retry or recovery rules.
Option D: ECS/Fargate worker
Use ECS/Fargate if the processing needs a custom container environment or a runtime that doesn't fit comfortably within Lambda's execution model.
The 30-minute timeout may make Option A or B viable for more workloads. It doesn't make the other options obsolete.
9. What Should You Check Before Increasing the Timeout?
A longer timeout can be helpful, but it deserves a quick architecture review.
- Retries: Could a failed invocation repeat work that already completed?
- Idempotency: Can the same event be processed again without causing duplicate side effects?
- Concurrency: Will longer execution increase the number of simultaneous invocations beyond your account or function limits?
- Connections: Could database connections, API sessions, or credentials expire during execution?
- Queue settings: If SQS invokes the function, is the visibility timeout configured appropriately?
- Recovery: If the function fails near the end, does it need to restart from the beginning, or should the workflow preserve progress?
These checks matter because a function that succeeds in a local test may behave differently under production traffic, retries, and downstream service failures.
Final Thoughts
The new 30-minute Lambda timeout is a useful change. It lets more workloads run as a single invocation and may remove architectural workarounds that existed only because of the old 15-minute limit.
But the bigger lesson is about architecture.
A longer timeout is an option—not an architecture.
Use Lambda for suitable individual tasks. Use SQS to decouple and buffer work. Use Step Functions to coordinate multi-step workflows. Use ECS/Fargate when a container-based runtime is a better fit.
As I continue learning AWS, I'm realizing that good cloud engineering isn't just knowing what each service does. It's understanding when to combine them—and when not to add complexity that the application doesn't need.
For the official announcement and exact limits, see the AWS Compute Blog.



