Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
id: demo
title: Serverless Workers Interactive Demo
sidebar_label: Interactive Demo
slug: /evaluate/serverless-workers/demo
toc_max_heading_level: 3
keywords:
- serverless
- lambda
- aws
- worker
- interactive demo
- serverless worker
tags:
- Workers
- Serverless
- AWS Lambda
description: An interactive demo for Temporal Serverless Workers. Explore the configuration, generated code, and execution flow for running Workers on AWS Lambda.
---

Serverless Workers let you run Temporal Workers on serverless compute like AWS Lambda.
There are no long-lived processes to provision or scale.
Temporal Cloud invokes your Worker when Tasks arrive, and the Worker shuts down when the work is done.

Use the interactive demo below to explore how the configuration options affect the generated
Worker code, deployment script, and CLI commands. Click "Start Workflow" to simulate the
end-to-end Serverless Worker invocation flow.



import { ServerlessWorkerDemo } from '@site/src/components';

<ServerlessWorkerDemo />


---

## Next steps

- [Serverless Workers - Go SDK](/develop/go/workers/serverless-workers/aws-lambda) for SDK-specific configuration, defaults, and lifecycle details.
- [Deploy a Serverless Worker](/production-deployment/worker-deployments/serverless-workers) for the full end-to-end deployment guide.
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
id: index
title: Serverless Workers
sidebar_label: Serverless Workers
slug: /evaluate/serverless-workers
description: Understand the benefits of Serverless Workers and when to use them. Run Temporal Workers on serverless compute with no infrastructure to manage.
toc_max_heading_level: 4
keywords:
- serverless
- lambda
- aws
- worker
- serverless worker
- evaluate
tags:
- Workers
- Serverless
---

Serverless Workers let you run Temporal Workers on serverless compute platforms like AWS Lambda.
There are no servers to provision, no clusters to scale, and no idle compute to pay for.
Temporal invokes the Worker when Tasks arrive, and the Worker shuts down when the work is done.

Serverless Workers use the same Temporal SDKs as traditional long-lived Workers.
You register Workflows and Activities the same way.
The difference is in the lifecycle: instead of running a long-lived process, Temporal invokes the Serverless Worker on demand when Tasks arrive. The Worker starts, polls for available Tasks, processes them, and exits when the work is done.

For a deeper look at how Serverless invocation works under the hood, see [Serverless Workers](/serverless-workers) in the encyclopedia.

## Benefits

### Reduce operational overhead

Long-lived Workers require you to provision infrastructure, configure scaling policies, manage deployments, and monitor host-level health.
Serverless Workers reduce this burden by offloading invocation and scaling to Temporal and the compute provider.
You still deploy the function and configure the compute provider, but there is no always-on infrastructure to manage and no autoscaling policies to tune.

Worker management is one of the most common sources of support questions for Temporal users.
Serverless Workers offer a prescriptive deployment path that reduces the operational surface area and lets you focus on writing Workflows instead of managing infrastructure.

### Get started faster

Running a long-lived Worker requires choosing a hosting strategy, configuring compute resources, and setting up deployment pipelines before you can execute your first Workflow.

With Serverless Workers, deploying a Worker is as simple as deploying a function.
Package your Worker code, deploy it to your serverless provider, and configure the connection to Temporal. There is no need to set up Kubernetes, manage container orchestration, or design a scaling strategy.

### Scale automatically

Serverless compute providers handle scaling natively.
When Task volume increases, the provider spins up additional function instances.
When traffic drops, instances scale down. When there is no work, there is no compute running.

This automatic scaling is especially useful for bursty, event-driven workloads where traffic patterns are unpredictable or highly variable.

### Pay only for what you use

Long-lived Workers run continuously, whether or not there is work to process.
Serverless Workers run only when Tasks are available.
For workloads with low or intermittent volume, this pay-per-invocation model can significantly reduce compute costs.

## When to use Serverless Workers

Serverless Workers are a good fit when:

- **Workloads are bursty or event-driven.** Order processing, notifications, webhook handlers, and similar workloads that experience spiky traffic benefit from automatic scaling without over-provisioning.
- **Traffic is low or intermittent.** If Workers spend most of their time idle, Serverless Workers eliminate the cost of always-on compute.
- **You want a simpler getting-started path.** Deploying a function is simpler than setting up a container orchestration platform. Serverless Workers reduce the steps between writing Worker code and running your first Workflow.
- **Your organization has standardized on serverless.** Teams that already run services on Lambda, Cloud Run, or similar platforms can run Temporal Workers using the same deployment patterns and tooling.
- **You serve multiple tenants with infrequent workloads.** Platforms that run Workflows on behalf of many users or customers can avoid running dedicated Workers per tenant.

Serverless Workers may not be ideal when:

- **Activities are long-running and cannot be interrupted.** Some serverless platforms enforce execution time limits. For example, AWS Lambda has a 15-minute execution limit. Activities that run longer than the provider's timeout and cannot be broken into smaller steps need a different hosting strategy or a provider with longer limits (such as Cloud Run). Long-running Workflows are not affected because Workflows can span multiple invocations.
- **Workloads require sustained high throughput.** For consistently high-volume Task Queues, long-lived Workers on dedicated compute may be more cost-effective and performant.
- **You need persistent connections.** Some features require a persistent connection between the Worker and Temporal, which serverless invocations do not maintain.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smuneebahmad Is this true? Should we comment on how sticky works here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is here primarily because in Go it looks like DisableEagerActivities is set to always true (users can't override). But yeah if there is a roadmap to remove these limitations we can remove this bullet

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can either remove this bullet point, or say:

**You need long running persistent connections**. Some features require a long running persistent connection between the Worker and Temporal, beyond the maximum runtime duration of a serverless worker like AWS Lambda.

Copy link
Copy Markdown
Contributor Author

@lennessyy lennessyy Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to be specific here if possible. Can we name specific features that require a persistent connection?

I wouldn't want to remove this if the limitation is real and unlikely to change. This page is not meant to be push users to serverless. We want to be helpful here to help them choose serverless vs stick with traditional workers.


## How Serverless Workers compare to long-lived Workers

| | Long-lived Worker | Serverless Worker |
|---|---|---|
| **Lifecycle** | Long-lived process that runs continuously. | Invoked on demand. Starts and stops per invocation. |
| **Scaling** | You manage scaling (Kubernetes HPA, instance count, etc.). | Temporal invokes additional instances as needed, within the compute provider's concurrency limits. |
| **Connection** | Persistent connection to Temporal. | Fresh connection on each invocation. |

## Supported providers

| Provider | Status |
|---|---|
| AWS Lambda | Available |

## Next steps

- [Interactive demo](/evaluate/serverless-workers/demo) to explore the configuration and invocation flow.
- [How Serverless Workers work](/serverless-workers) for a deeper look at the invocation lifecycle, compute providers, and architecture.
- [Deploy a Serverless Worker](/production-deployment/worker-deployments/serverless-workers) for the end-to-end deployment guide.
- [Serverless Workers - Go SDK](/develop/go/workers/serverless-workers/aws-lambda) for SDK-specific configuration and defaults.
4 changes: 2 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module.exports = async function createConfigAsync() {
tagline: 'Build invincible applications',
url: 'https://docs.temporal.io',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenAnchors: 'throw',
onBrokenLinks: 'warn',
onBrokenAnchors: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'temporalio', // Usually your GitHub org/user name.
projectName: 'temporal-documentation', // Usually your repo name.
Expand Down
8 changes: 8 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ module.exports = {
'evaluate/development-production-features/low-latency',
'evaluate/development-production-features/multi-tenancy',
'evaluate/development-production-features/job-queue',
{
type: 'category',
label: 'Serverless Workers',
link: { type: 'doc', id: 'evaluate/development-production-features/serverless-workers/index' },
items: [
'evaluate/development-production-features/serverless-workers/demo',
],
},
{
type: 'category',
label: 'Product release stages',
Expand Down
Loading
Loading