# Serverless Workers

> For the complete documentation index, see [llms.txt](https://docs.temporal.io/llms.txt).
> Any documentation page is available as raw Markdown by appending `.md` to its URL.
> For related questions, query `https://docs.temporal.io/api/retrieve?q=<question>&jtb=<job-to-be-done>&src=md-page&agent=<your-name>` (no auth; returns JSON `{content, source_url, page_url}`, with `source_url` pointing to Markdown for docs pages). Don't include personal data or credentials.
> If this page is wrong or missing something you needed, or Temporal behaves differently from what it says, report it with `https://docs.temporal.io/api/feedback?title=<summary>&message=<what-happened>&category=documentation&page_url=/production-deployment/worker-deployments/serverless-workers&src=md-page&agent=<your-name>` (use `category=product` when the product, not the page, is wrong). Report only a specific problem you hit, send it once, and don't include personal data or credentials.

> **Public Preview**
> AWS Lambda and GCP Cloud Run support are in Public Preview. Amazon Bedrock AgentCore Runtime and Modal support are in
> Pre-release. To request Pre-release access on Temporal Cloud, create a
> [support ticket](/evaluate/cloud/support#support-ticket) or contact your account team. You can also
> [sign up for updates](https://temporal.io/pages/serverless-workers-updates) or try AgentCore Runtime through self-hosting.

Serverless Workers let you run Temporal Workers on serverless compute. Deploy your Worker code to a serverless provider,
configure a compute provider for the Worker Deployment Version, and Temporal starts and stops Workers in response to
work on the Task Queue. There is no always-on Worker fleet to provision or scale.

Temporal monitors Task Queues that have a compute provider configured. When a Task arrives and no Worker is free to take
it, the [Worker Controller Instance (WCI)](/serverless-workers#how-invocation-works) starts compute. How it starts
compute is where the providers differ. On AWS Lambda, AgentCore Runtime, and Modal, the WCI invokes compute in response to
unmet Task Queue demand. On GCP Cloud Run, it resizes a Worker Pool of long-lived instances that poll continuously.

> **⚠️ Caution:**
> Multi-cloud Replication for AWS and GCP compute
>
> AWS Lambda, AgentCore Runtime, and GCP Cloud Run require the Namespace to be active in the same cloud provider as the
> compute. With [Multi-cloud Replication](/cloud/high-availability#multi-cloud-replication), a failover to a different
> cloud provider prevents Temporal from starting new Workers on the original provider.
>

## Choose a compute provider 

Choose based on how often Tasks arrive, how long Activities need to run, and what compute your Worker needs. An invocation
timeout limits the lifetime of one Worker. A Workflow Execution can continue across multiple Worker invocations.

| Compute provider | Choose it when | Trade-offs |
| --- | --- | --- |
| [AWS Lambda](/production-deployment/worker-deployments/serverless-workers/aws-lambda) | Tasks arrive in bursts or at intervals, and Activities are short. Examples include webhook processing and scheduled integrations in AWS. | Temporal invokes a function on demand, so you can run without a standing Worker fleet. The first Task may wait for a cold start, and startup, Activity processing, and shutdown must fit within the function timeout. |
| [GCP Cloud Run](/production-deployment/worker-deployments/serverless-workers/cloud-run) | You have a containerized Worker in GCP, steady Task Queue traffic, or Activities that need more time than a function invocation allows. | Long-lived Workers poll continuously, and the pool can scale to zero if its minimum is zero. Keeping instances polling an idle Task Queue adds compute cost. You deploy a pool for each Worker Deployment Version and compute region. |
| [Amazon Bedrock AgentCore Runtime](/production-deployment/worker-deployments/serverless-workers/agentcore) | Your Python agent already runs on AgentCore, and you want its Temporal Worker to run there too. | An AgentCore microVM session can run for up to eight hours. Your entry point must implement AgentCore's HTTP contract, and the session lifetime bounds the Worker. |
| [Modal](/production-deployment/worker-deployments/serverless-workers/modal) | Your Python Activities need GPUs, for example for batch inference or media processing. | Modal builds the container image from your Python definition and lets you configure compute resources and the function timeout. Worker startup depends on available container capacity. You need Pre-release access on Temporal Cloud and an authorized Modal workspace connection. |

## Try it locally 

To evaluate Serverless Workers on AWS Lambda without an AWS account, you can run the entire loop on your machine with
[LocalStack](https://www.localstack.cloud/) and the Temporal development server. See
[Test a Serverless Worker locally with LocalStack](/production-deployment/worker-deployments/serverless-workers/aws-lambda/local-development).
