How a serverless function runs: trigger, cold start, scale to zero
On AWS Lambda, the trigger can be API Gateway, Amazon S3, Amazon SQS, EventBridge or one of more than 200 other AWS services. Typical jobs are API routes and webhooks, which Vercel lists for its functions, and scheduled tasks, which Microsoft lists for Azure Functions.
When no warm environment exists, Lambda first downloads the code and sets up the execution environment, two steps that AWS says are frequently called a cold start. AWS states that cold starts typically occur in under 1% of invocations and last from under 100 ms to more than 1 second.
On Azure Functions, apps on the legacy Consumption plan can scale to zero when idle, so some requests might have more latency at startup. The Flex Consumption plan, which Microsoft names for new apps, supports always ready instances that reduce this delay.
With Vercel's Fluid compute, several invocations can share one function instance, where traditional serverless gives each invocation its own. Fluid compute has been enabled by default for new Vercel projects since April 23, 2025, and Vercel bills these functions for active CPU time and provisioned memory time. Teams that want a lower bill can start from the Next.js Vercel cost optimization service.
Timeout, memory and payload limits on AWS Lambda and Vercel
AWS Lambda. The quotas page lists a function timeout of 900 seconds (15 minutes) and a memory allocation of 128 MB to 10,240 MB, in 1-MB increments. On Lambda Managed Instances, asynchronous invocations support a timeout of up to 5,400 seconds (90 minutes).
Vercel Functions, duration. On the Node.js, Bun and Python runtimes with Fluid compute, the default is 300 seconds on every plan. The maximum is 300 seconds on Hobby and 800 seconds on Pro and Enterprise, where an extended maximum of 1,800 seconds is in beta. A function that does not complete within its duration returns a 504 error,
FUNCTION_INVOCATION_TIMEOUT.Vercel Functions, memory and payload. The maximum memory is 2 GB on Hobby and 4 GB on Pro and Enterprise. A request body or response body can be at most 4.5 MB, and the response limit does not apply to streamed responses. A function that receives a larger payload returns a 413 error,
FUNCTION_PAYLOAD_TOO_LARGE.
The full tables are in the AWS Lambda quotas and the Vercel Functions limits. Cloudflare contrasts its edge functions (Workers), which run in V8 isolates, with serverless providers that use containerized processes, each running an instance of a language runtime. For application code on the Node.js runtime, the related services are Next.js development and Node.js development services.
Sources
- What is AWS Lambda?Amazon Web Services · docs.aws.amazon.com
- How Workers worksCloudflare · developers.cloudflare.com
- Edge Functions overviewNetlify · docs.netlify.com
- Vercel FunctionsVercel · vercel.com
- What is Azure Functions?Microsoft · learn.microsoft.com
- Understanding the Lambda execution environment lifecycleAmazon Web Services · docs.aws.amazon.com
- Azure Functions hosting optionsMicrosoft · learn.microsoft.com
- Fluid computeVercel · vercel.com
- Vercel Functions LimitsVercel · vercel.com
- Lambda quotasAmazon Web Services · docs.aws.amazon.com