Skip to content

feat: serverless worker#4445

Open
lennessyy wants to merge 41 commits intomainfrom
feat/serverless-worker-prerelease
Open

feat: serverless worker#4445
lennessyy wants to merge 41 commits intomainfrom
feat/serverless-worker-prerelease

Conversation

@lennessyy
Copy link
Copy Markdown
Contributor

@lennessyy lennessyy commented Apr 16, 2026

What does this PR do?

  • Adds the serverless worker feature

Notes to reviewers

┆Attachments: EDU-6216 feat: serverless worker

lennessyy and others added 3 commits April 16, 2026 16:06
* docs: Serverless Workers - Go SDK pages (2/4)

Add Go SDK Serverless Workers documentation including the lambdaworker
package guide for AWS Lambda, rewrite run-worker-process to focus on
long-lived Workers, and remove cloud-worker (content folded in).
Update sidebars, add redirect, and set broken links to warn for
cross-PR references.

Part of #4405.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: expand OTel section with context and links for serverless Go SDK page

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: link worker defaults to Go SDK reference, clarify ShutdownDeadlineBuffer is serverless-only

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: address review feedback on Go SDK pages

- Replace ambiguous "Lambda deadline" with "configurable invocation
  deadline" on the AWS Lambda page (akhayam)
- Rewrite tautological "serverless compute" intro on the Go SDK
  serverless landing page (smuneebahmad)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: add Serverless Workers production deployment guide (3/4)

Add deploy guide for serverless workers covering AWS Lambda deployment,
including the serverless-workers index and aws-lambda pages under
production-deployment/worker-deployments. Update sidebar navigation
and set onBrokenLinks/onBrokenAnchors to warn for cross-PR references.

Part of #4405.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: address review feedback on Deploy guide

- Rename TLS env vars to TEMPORAL_TLS_CLIENT_CERT_PATH and
  TEMPORAL_TLS_CLIENT_KEY_PATH (smuneebahmad)
- Add HOME=/tmp env var to deploy command and env var table; needed
  for the SDK's config loader to resolve a user config directory in
  Lambda (smuneebahmad)
- Include TEMPORAL_API_KEY in deploy command so the auth path is
  complete (smuneebahmad)
- Remove --scaler-min-instances, --scaler-max-instances from
  create-version snippet (smuneebahmad)
- Remove --ignore-missing-task-queues from set-current-version
  snippet (smuneebahmad)
- Replace CloudFormation template stub with the real template from
  smuneebahmad, inline in a <details> block plus a downloadable file
  at /files/temporal-cloud-serverless-worker-role.yaml
- Update IAM parameter table to match real template params
  (AssumeRoleExternalId, LambdaFunctionARNs, RoleName)
- Add note flagging template is Cloud-scoped; self-hosted TBD
- Add sample aws cloudformation create-stack usage
- Use "invocation deadline" for consistency with Go SDK page

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: Serverless Workers - Evaluate pages (1/4)

Add the Evaluate section for Serverless Workers documentation:
- Serverless Workers overview page
- Interactive demo page with ServerlessWorkerDemo component
- Sidebar entry under Features
- Redirect from old demo URL
- Change onBrokenLinks/onBrokenAnchors to 'warn' for incremental PRs

Part 1 of 4, splitting PR #4405 into smaller PRs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: address PM feedback on evaluate page

- Fix polling description: serverless workers still poll, the difference is lifecycle
- Tone down operational overhead claims: customers still deploy and configure
- Clarify long-running limitation applies to activities, not workflows

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: address review feedback on Evaluate pages

- Reframe lifecycle description: Temporal invokes the Serverless Worker
  on demand (bchav, akhayam)
- Clarify operational overhead: offload invocation and scaling, but
  deployments remain the user's responsibility (bchav)
- Introduce "long-lived Workers" terminology and use consistently
- Sharpen Lambda execution limit wording and Cloud Run callout
  (akhayam, bchav)
- Remove Worker Versioning row from comparison table as too low-level
  (akhayam)
- Remove --scaler-min-instances, --scaler-max-instances, and
  --ignore-missing-task-queues from demo CLI snippets (smuneebahmad)
- Remove Min/Max Instances config fields from demo UI (smuneebahmad)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
temporal-documentation Ready Ready Preview, Comment Apr 30, 2026 1:02am

Request Review

@lennessyy lennessyy marked this pull request as ready for review April 17, 2026 01:54
@lennessyy lennessyy requested a review from a team as a code owner April 17, 2026 01:54
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 2026

* docs: add Serverless Workers encyclopedia page and update related pages

Add the encyclopedia entry for Serverless Workers, update workers.mdx
and task-queues.mdx with serverless references, add the architecture
diagram, update sidebar, and add "Serverless Worker" to Vale terms.

Change onBrokenLinks/onBrokenAnchors to 'warn' to accommodate
cross-references to pages in other PRs in this series.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Remove differences section from encyclopedia page

The comparison table lives on the evaluate page now.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix Worker invocation wording in encyclopedia

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: address review feedback on encyclopedia page

- Use "traditional long-lived Worker" on first contrast, "long-lived
  Worker" thereafter (akhayam, smuneebahmad)
- Replace "triggers the compute environment" with "invokes the
  Serverless Worker on demand" (akhayam)
- Use "shuts down" instead of "exits" to match AWS Lambda runtime
  terminology (akhayam)
- Fix "serverless function" -> "Serverless Worker" for cross-provider
  accuracy
- Use "invocation deadline" for consistency with other pages
- Add Worker lifecycle section with new lifecycle diagram (addresses
  akhayam's suggestion to mirror AWS's Lambda lifecycle diagram)
- Explain Worker stop timeout and shutdown deadline buffer, including
  tuning guidance for long-running Activities and the consequences of
  raising one knob without the other

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: crop lifecycle diagram

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: add light/dark themed diagrams with figure captions

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…aram table

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…o Go SDK page

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ment

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lennessyy and others added 2 commits April 21, 2026 10:29
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs: add Serverless Worker Autoscaling encyclopedia page

Add a dedicated page explaining how Temporal autoscales Serverless Workers
on AWS Lambda, covering scaling signals (backlog + sync match rate),
the push-based scaling flow, failure handling, and key constraints.

Also adds an Autoscaling section to the existing Serverless Workers
encyclopedia page linking to the new page, and a sidebar entry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* merge autoscaling info with existing docs

* copyedits

* copyedits

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Lenny Chen <lenny.chen@temporal.io>
Copy link
Copy Markdown
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

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

I just focused on the SDK / getting started instructions, but those parts are looking good. Thanks Lenny!

Comment on lines +78 to +91
| Setting | Lambda default |
|---|---|
| `MaxConcurrentActivityExecutionSize` | 2 |
| `MaxConcurrentWorkflowTaskExecutionSize` | 10 |
| `MaxConcurrentLocalActivityExecutionSize` | 2 |
| `MaxConcurrentNexusTaskExecutionSize` | 5 |
| `MaxConcurrentActivityTaskPollers` | 1 |
| `MaxConcurrentWorkflowTaskPollers` | 2 |
| `MaxConcurrentNexusTaskPollers` | 1 |
| `WorkerStopTimeout` | 5 seconds |
| `DisableEagerActivities` | Always true |
| Sticky cache size | 100 |
| `ShutdownDeadlineBuffer` | 7 seconds |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think maybe we can keep the paragraph above but omit the exact values just to avoid future drift, since I suspect we may end up changing them? I'm fine if you want to keep them too.

Applies to other langs too.

- For self-hosted deployments, complete the
[self-hosted setup](/production-deployment/worker-deployments/serverless-workers/self-hosted-setup) before following
this guide.
- Every Workflow must declare a [versioning behavior](/worker-versioning#versioning-behaviors).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Or the worker needs to set a default behavior

The underlying metrics and traces are the same ones the Python SDK emits in any environment.
For general observability concepts and the full list of available metrics, see [Observability - Python SDK](/develop/python/observability) and the [SDK metrics reference](/references/sdk-metrics).

from temporalio.common import WorkerDeploymentVersion
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is missing a ``` start fence

…ionedImage

- Mention worker-level default versioning behavior across all SDK pages
- Fix missing Python OTel code fence
- Update prerequisite to include worker-level default option
- Replace ThemedImage with CaptionedImage on encyclopedia page
- Add "not to scale" note to lifecycle diagram caption
- Remove duplicate env vars sentence in deploy guide

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The shorthand Variables={} syntax fails when values contain colons
or periods, which Temporal addresses always have.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Clarify which role to use in create-version step (not execution role or user IAM role)
- Fix External ID description: user-chosen, not provided by Temporal Cloud
- Add Go config file resolution order to match Python and TS pages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants