AWS Lambda timeout: the limit is now 30 minutes, and what to do when a job needs longer
AWS raised the Lambda timeout from 15 to 30 minutes on November 19, 2026. The limits, why calls still stop at 29 s, and options past 30 minutes.
An AWS Lambda function can now run for up to 30 minutes (1,800 seconds) per invocation. AWS doubled the limit from 15 minutes on November 19, 2026, and the default is still 3 seconds. The new limit covers on-demand functions called synchronously, asynchronously and through event source mappings, in all commercial Regions. The function may still be cut off sooner by whatever calls it: API Gateway REST APIs wait 29 seconds by default and HTTP APIs at most 30. For work that needs longer than 30 minutes, use Lambda durable functions, Step Functions, or a container.
Gregale publishes this page. AWS’s limits come from its own docs, checked on December 2, 2026: function timeout, Lambda quotas, timeouts of synchronous callers and the November 19 announcement. Gregale’s limits come from its plans page.
AWS Lambda timeout limits
| What | Limit |
|---|---|
| Default function timeout | 3 seconds |
| Maximum, on-demand functions | 1,800 seconds (30 minutes) for synchronous, asynchronous and event source mapping calls |
| Maximum before November 19, 2026 | 900 seconds (15 minutes) |
| Lambda Managed Instances | 30 minutes synchronous; 90 minutes asynchronous and event source mappings (not Amazon MQ or DocumentDB) |
| Lambda Web Functions request timeout | 30 seconds by default, 3 to 900 seconds |
| Lambda MicroVMs | Up to 8 hours per MicroVM |
| Durable functions | One durable execution can run for up to a year |
| Init phase | 10 seconds |
Still reading “15 minutes” everywhere? That was the limit from 2018 until November 19, 2026, and many guides, forum answers and AI assistants still quote it. A function created before the change keeps its configured timeout: nothing raises it for you.
The Init phase limit is separate from the function timeout. If your runtime, extensions and initialization code don’t finish within 10 seconds, Lambda retries initialization when the first invocation arrives, under the function’s configured timeout.
How to change the timeout
With the AWS CLI, in seconds:
aws lambda update-function-configuration \
--function-name my-function \
--timeout 1800
In an AWS SAM template, set Timeout on the function and run sam deploy:
Resources:
my-function:
Type: AWS::Serverless::Function
Properties:
Timeout: 1800
In the console, open the function, choose Configuration → General configuration → Edit, and set Timeout to a value from 1 to 1,800 seconds. CloudFormation, the CDK and the SDKs take the same value.
If SQS triggers the function, raise the queue’s visibility timeout first. AWS’s timeout page says to do that before you raise the function timeout; otherwise a message can become visible again while a long invocation is still working on it, and run twice.
Why it still times out at 29 or 30 seconds
Raising the function timeout doesn’t make the caller wait longer. AWS lists how long each synchronous caller waits:
| Caller | How long it waits |
|---|---|
| API Gateway REST API | 29 seconds by default |
| API Gateway HTTP API | 30 seconds, the maximum |
| Amazon Cognito user pool trigger | 5 seconds |
| AWS Step Functions | Until the function returns |
| Lambda function URL | Until the function returns |
When the caller gives up, the function keeps running until it returns or reaches its timeout, and AWS charges you for that time. On a Regional or private REST API you can raise the integration timeout past 29 seconds, but AWS says that may lower your account’s throttle quota for the Region; edge-optimized APIs stay at 29 seconds.
Your own client can also hang up first. AWS says to set the client’s read
timeout higher than the function timeout and turn on TCP keep-alive; with the
AWS CLI, --cli-read-timeout 0 waits with no limit.
Why a function times out when it shouldn’t
AWS names the usual causes: an S3 download that is larger or slower than average, a downstream service that responds slowly, and input that needs more computation than your tests used. Before raising the limit:
- Put a timeout on every call to another service that is shorter than the function’s timeout, so a slow dependency fails with a clear error.
- Test with data at the upper end of what you expect, not small samples.
- Give the function more memory. Lambda allocates CPU in proportion to memory, so a CPU-bound function gets faster; at 1,769 MB it has the equivalent of one vCPU.
When the job needs more than 30 minutes
- Durable functions. A durable function checkpoints each step, retries failed steps, and can run for up to a year. While it waits, it doesn’t pay for compute. Best when the work is a sequence of steps or waits on people or other systems.
- Step Functions. Chain several invocations, each under 30 minutes.
- Split the work. Fan the input out over an SQS queue so each invocation handles one slice.
- Run a container. Lambda MicroVMs run for up to 8 hours; ECS, Fargate and AWS Batch have no per-invocation limit like Lambda’s.
If an API starts the job, don’t make the client wait for it. Return 202 with
a job ID, run the work in the background, and let the client poll for the
result. The Vercel timeout guide
shows the same pattern.
Where Gregale fits
Gregale’s HTTP request timeouts are 30 seconds on Free, 1 minute on Hobby, 5 minutes on Pro and 15 minutes on Scale, so for long requests Lambda with a function URL now allows more. For background work, a Gregale job runs a container to completion with retries and fan-out over many inputs:
| Gregale plan | Longest job task |
|---|---|
| Free ($0) | no jobs |
| Hobby ($10/mo) | 5 minutes |
| Pro ($30/mo) | 30 minutes |
| Scale ($99/mo) | 1 hour |
That’s the same 30 minutes as Lambda on Pro and twice that on Scale. The difference is shape more than length: the job runs from the same image as your app, with no API Gateway, SQS or IAM wiring to set up. See jobs and batch jobs with retries. If you’re already on AWS and the work fits in 30 minutes, staying on Lambda is the simpler choice.
What we verified
The Lambda and API Gateway limits are from AWS’s docs and its November 19, 2026 announcement, checked on December 2, 2026. We did not run a 30-minute Lambda invocation for this page. The Gregale limits are from Gregale’s plans page and its plan limits table on the same date.
Questions
- What is the maximum AWS Lambda timeout?
1,800 seconds (30 minutes) per invocation, since November 19, 2026. It was 900 seconds (15 minutes) before. The default is 3 seconds.
- Why does my Lambda behind API Gateway time out after 29 seconds?
API Gateway stops waiting before the function does: REST APIs wait 29 seconds by default and HTTP APIs at most 30. The function keeps running, and is billed, until it returns or reaches its own timeout.
- How do I increase the Lambda timeout?
Set it in seconds with aws lambda update-function-configuration --timeout, the Timeout property in SAM or CloudFormation, or the function’s general configuration in the console, up to 1,800 seconds.
- What if a job needs more than 30 minutes?
Use Lambda durable functions, which can run for up to a year, chain invocations with Step Functions, split the input over a queue, or run it as a container, for example on Lambda MicroVMs, which run for up to 8 hours.