
AWS Lambda Can Run for 90 Minutes Now. Should It?
AWS Lambda Managed Instances can now run asynchronous and event-driven functions for up to 90 minutes. That removes one of Lambda's most familiar limits—but a longer timeout does not automatically make every long-running workload a Lambda workload. Here is how I would think about the architecture before simply increasing the clock.
For years, one number was almost impossible to separate from AWS Lambda:
15 minutes.
If a function needed longer than that, the architectural conversation usually changed.
Maybe the workload belonged in:
- ECS;
- AWS Batch;
- Step Functions;
- another containerized service;
- or a workflow broken into smaller Lambda functions.
Then AWS changed the conversation.
AWS Lambda Managed Instances can now run a single function invocation for up to 90 minutes for asynchronous invocations and most event source mappings.
Six times longer.
At first glance, this sounds simple:
Long-running job? Just keep it in Lambda now.
But I think that is the wrong conclusion.
The more interesting question is:
Just because Lambda can run for 90 minutes, should we design our applications around 90-minute functions?
First: This Is Not Every Lambda Function
This distinction matters.
The new 90-minute timeout applies to AWS Lambda Managed Instances, not the normal Lambda compute model most developers first learn.
And even with Lambda Managed Instances, the 90-minute duration applies to:
- asynchronous invocations;
- supported event source mapping invocations.
Synchronous invocations still have a 15-minute maximum.
The initialization phase also remains limited to 15 minutes.
Some event sources, including Amazon MQ and Amazon DocumentDB event source mappings, also retain the 15-minute restriction.
So this is not:
Every Lambda15 minutes → 90 minutesIt is closer to:
Lambda Managed Instances +Asynchronous / supported ESM workloads ↓Up to 90 minutesThat difference is important before making any architectural decision.
What Are Lambda Managed Instances?
Lambda Managed Instances sit somewhere interesting between traditional Lambda and managing EC2 yourself.
Your functions run on current-generation EC2 infrastructure in your AWS account, but Lambda manages much of the operational work around that infrastructure.
That includes things such as:
- instance lifecycle;
- operating system patching;
- runtime patching;
- routing;
- load balancing;
- scaling.
You still use the Lambda programming model, but the underlying compute and pricing behavior are different from standard Lambda.
That gives developers access to EC2-style compute choices while keeping much of Lambda's managed experience.
It also changes the kinds of workloads that make sense.
AWS positions Lambda Managed Instances particularly well for workloads with predictable, sustained, high-volume traffic, rather than simply assuming that every bursty serverless workload belongs there.
So when discussing the 90-minute timeout, we are really discussing more than a larger timeout value.
We are discussing a different Lambda compute model.
Why 90 Minutes Is Actually Interesting
There are many workloads that never fit comfortably inside the traditional 15-minute window.
Imagine:
Large file processing
A large archive lands in S3 and needs to be:
Download ↓Validate ↓Transform ↓Compress ↓Upload resultMaybe that takes 25 minutes.
Media processing
A video requires:
- decoding;
- transformation;
- transcoding;
- packaging;
- uploading.
A 15-minute limit may force the workflow into several pieces even when the processing logic naturally belongs together.
AI inference
Some AI workloads can involve:
- loading substantial models;
- processing large inputs;
- running multi-stage inference;
- performing batch processing.
These jobs do not always fit neatly into a few minutes.
Data processing
A function consuming a large event batch may need substantial time to:
- download data;
- transform it;
- validate records;
- call external systems;
- persist results.
Slow external integrations
Sometimes your code is fast.
The system you depend on is not.
A job involving slow APIs, file transfers, crawling, or external services may spend much of its life waiting.
For these workloads, 90 minutes can remove unnecessary architectural gymnastics.
That is valuable.
But eliminating one limitation can expose several others.
A Longer Timeout Does Not Remove Failure
Imagine a function runs for 54 minutes.
At minute 53, something fails.
Now ask:
What happens next?
That question is much more important for a 60-minute process than for a function that normally completes in two seconds.
With a long-running workload, you need to think seriously about:
- retries;
- checkpoints;
- idempotency;
- partial progress;
- duplicate processing;
- external side effects;
- recovery.
Suppose a function performs:
Process 10,000 records ↓9,500 completed ↓FailureDo you restart all 10,000?
Can you safely replay the operation?
Were some records already written to a database?
Did the function send emails?
Did it charge a customer?
Did it call an external API?
A longer maximum execution time does not solve any of these questions.
In fact, longer functions can make them more important.
“Can Run Longer” and “Should Run Longer” Are Different Questions
Consider two workloads.
Workload A
A video-processing job consistently takes 22 minutes.
It:
- receives an event;
- processes one file;
- writes one output;
- is naturally isolated;
- can safely retry.
That may be a reasonable long-running function candidate.
Now consider:
Workload B
A business workflow takes 45 minutes because it:
Creates order ↓Waits for payment ↓Checks inventory ↓Requests approval ↓Waits ↓Updates database ↓Sends notificationThat looks very different.
The process may take 45 minutes overall, but that does not mean it should consume one continuously running function for 45 minutes.
It is a workflow, not simply a long computation.
That distinction matters.
Continuous Work vs. Long-Lived Workflow
One useful question is:
Is my application actually computing for 40 minutes, or does the business process merely take 40 minutes to finish?
Those are different problems.
Continuous workload
Start ↓Compute ↓Compute ↓Compute ↓FinishA longer function timeout may help.
Long-lived workflow
Start ↓Do something ↓Wait ↓External event ↓Do something else ↓Wait ↓FinishKeeping a single process alive through all of that may not be the best design.
AWS Lambda durable functions are another option for long-lived, multi-step processes. A durable execution can span multiple invocations, use checkpoints, wait for external events, recover from failures, and continue for significantly longer than a traditional single invocation.
The important architectural lesson is:
Elapsed time alone should not determine the compute service.
Understand what the application is actually doing during that time.
The Retry Problem Gets More Expensive
Long-running processes also change how I think about retries.
Imagine:
Function duration: 3 secondsFailure at second 2RetryNot ideal.
But usually manageable.
Now:
Function duration: 70 minutesFailure at minute 68Retry from beginningThat hurts.
Operationally.
Financially.
And emotionally.
This is where checkpointing becomes valuable.
Instead of:
START ↓████████████████████████████████████ X ↓ START AGAINwe may want:
Step 1 ✓ ↓Checkpoint ↓Step 2 ✓ ↓Checkpoint ↓Step 3 ✕ ↓Resume from Step 3The longer the computation, the more seriously recovery architecture deserves consideration.
What About Cost?
There is another important detail.
Lambda Managed Instances do not use exactly the same pricing model as standard Lambda.
Managed Instances use EC2-based compute pricing, with AWS applying a management fee on top of the underlying EC2 instance cost. They can also benefit from eligible EC2 pricing options such as Savings Plans and Reserved Instances.
That makes sense because the underlying model is different.
Standard Lambda is particularly attractive for bursty workloads because capacity can scale with requests and scale down when unused.
Managed Instances are designed more toward sustained and predictable workloads where using EC2-based capacity efficiently can make sense.
So:
90 minutes does not mean Lambda Managed Instances are automatically the cheapest place to run every 90-minute job.
You still need to ask:
- How frequently does the job run?
- How much CPU does it require?
- How much memory?
- Is traffic predictable?
- Is the workload mostly waiting?
- Is capacity heavily utilized?
- Could a container or batch workload be more appropriate?
Serverless does not remove cost architecture.
It changes it.
There Is Another Big Difference: Concurrency
This is one of the details I think developers should pay close attention to.
Traditional Lambda execution environments process one invocation at a time.
Lambda Managed Instances can process multiple concurrent invocations within an execution environment.
That can improve utilization.
But it also changes assumptions inside your application.
Consider something like:
let currentCustomer = null;With a single request operating in an isolated execution context, global state may behave one way.
With multiple concurrent requests sharing parts of an execution environment, careless shared state can become much more dangerous.
Depending on the runtime, developers need to think about:
- thread safety;
- shared state;
- mutable global variables;
- caches;
- connection pools;
- request isolation.
So migrating a function to Lambda Managed Instances should not necessarily be treated like:
Change timeout = 900toChange timeout = 5400The execution model matters too.
Long-Lived Connections Deserve Attention
AWS also specifically recommends thinking about ephemeral components when functions run for longer periods.
A process running for 60 or 80 minutes may hold:
- network connections;
- temporary credentials;
- database sessions;
- SDK clients;
- external API connections.
The longer a process stays alive, the more likely one of those dependencies may change underneath it.
For example:
Function starts ↓Credential valid ↓40 minutes pass ↓Credential expires ↓Next request failsOr:
Database connection ↓Idle / network interruption ↓Connection no longer validLong-running functions therefore need to be designed with reconnection and credential refresh behavior in mind.
A 90-minute timeout expands what Lambda can do.
It also expands the amount of lifecycle your code may need to survive.
Backpressure Still Matters
Imagine an S3 workflow.
Someone uploads:
10 filesEverything looks fine.
Then one day:
10,000 filesarrive.
Each one triggers processing that can take 30 minutes.
The fact that every function can run for 30 minutes does not mean all 10,000 should immediately do so.
You still need to think about:
- event queues;
- concurrency controls;
- downstream capacity;
- database connections;
- API rate limits;
- throttling;
- cost.
A queue such as SQS can help turn a traffic spike into a controlled backlog:
10,000 Events ↓ SQS ↓Controlled consumption ↓WorkersLonger execution limits do not replace backpressure.
They may make controlling it even more important.
So When Would I Use the 90-Minute Window?
I would consider it when the workload has several of these characteristics:
1. The work is naturally one unit
The task is easier to understand and manage as one operation rather than artificially splitting it into many tiny steps.
2. It genuinely performs continuous work
The process is computing, transforming, transferring, or processing rather than simply waiting for external events.
3. Retries are safe
The task is idempotent or has a well-designed recovery strategy.
4. Traffic is reasonably predictable
The workload fits the sustained or predictable characteristics where Lambda Managed Instances make sense.
5. The workload benefits from Lambda integrations
It naturally responds to AWS events and gains value from the Lambda programming and operational model.
6. The alternative architecture adds complexity without meaningful benefit
Sometimes splitting a 20-minute process into several services simply because of an old timeout limit created complexity rather than resilience.
Removing that artificial split can be a real improvement.
When Would I Still Look Elsewhere?
I would hesitate when:
The workload is a complex workflow
If the process contains many states, waits, approvals, retries, and external events, workflow-oriented architecture may be clearer.
The workload requires specialized container behavior
If I need extensive control over:
- container configuration;
- operating system behavior;
- long-lived services;
- specialized scheduling;
a container platform may make more sense.
The workload is batch-oriented
If I am processing a large queue of computational jobs with clear scheduling requirements, AWS Batch may deserve consideration.
The application requires synchronous responses
The new 90-minute timeout does not turn Lambda into a 90-minute synchronous HTTP request platform.
Synchronous invocations retain the shorter limit.
And even aside from Lambda's timeout, other components between the user and the function may have their own timeout constraints.
Failure requires fine-grained recovery
If losing 50 minutes of progress would be painful, I would seriously consider checkpoints or dividing the workload into recoverable stages.
My Decision Framework
Before using a long-running Lambda Managed Instances function, I would ask seven questions.
1. Is this one job or a workflow?
One continuous task → maybe long LambdaMultiple states/waits → consider orchestration2. What happens if it fails at minute 80?
If the answer is:
“Start the whole thing again and hope”
I am probably not finished designing it.
3. Is the operation idempotent?
Retries should not accidentally:
- duplicate payments;
- create duplicate records;
- send messages twice;
- corrupt state.
4. Is my traffic predictable?
Lambda Managed Instances have different scaling and economics from standard Lambda.
5. Can downstream systems handle the concurrency?
My function scaling successfully does not help if it destroys the database behind it.
6. Do I understand the new concurrency model?
Shared state and thread/process behavior need to be considered.
7. Am I using 90 minutes because it simplifies the architecture—or because it lets me avoid fixing the architecture?
That last question is probably the most important.
The 15-Minute Limit Was Sometimes Useful
There is a strange benefit to hard limits.
They force architectural questions.
The old 15-minute Lambda timeout made developers ask:
Should this task be smaller?
Should this be asynchronous?
Should I introduce a queue?
Should this be a workflow?
Should this workload actually be running somewhere else?
Now that some Lambda workloads can run six times longer, those questions do not become irrelevant.
They become easier to ignore.
That is why I do not think the right reaction is:
“Great. Now I can make all my functions longer.”
I think the better reaction is:
“Great. Now I have another architecture option.”
That is a much more useful way to look at the change.
Final Thoughts
AWS Lambda Managed Instances supporting 90-minute asynchronous and event-source-driven executions removes a real limitation.
There are workloads that previously required unnecessary splitting or migration to another compute model simply because they needed 20, 30, or 45 minutes of continuous processing.
Those workloads now have another option.
But a larger timeout should not become an excuse to create larger failure domains.
Long-running serverless workloads still need:
- sensible retry behavior;
- idempotency;
- observability;
- backpressure;
- concurrency control;
- cost awareness;
- recovery planning.
The best architecture is not the one that uses the maximum timeout available.
It is the one that matches the shape of the workload.
So I think the real news is not:
Lambda can run for 90 minutes.
It is:
Lambda's architectural boundary just moved—and now developers have to decide where their own boundary should be.
Your Turn
Suppose you have a job that consistently takes 45 minutes.
It is asynchronous, technically fits inside Lambda Managed Instances, and could also run in a container or batch environment.
Where would you put it?
A — Lambda Managed Instances
Keep the Lambda operational model and use the longer execution window.
B — ECS/Fargate
Use a containerized workload with more runtime control.
C — AWS Batch
Treat it explicitly as a batch-processing job.
D — Break it into a workflow
Split the work into recoverable steps and orchestrate it.
And the more interesting question:
What factor would make that decision for you: failure recovery, cost, operational simplicity, workload duration, or something else?
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article