Skip to content

Commit 4ad8d01

Browse files
committed
address review comments
1 parent 2dd3e2f commit 4ad8d01

5 files changed

Lines changed: 17 additions & 47 deletions

File tree

docs/encyclopedia/workers/serverless-workers.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ The invocation flow works as follows:
8181
5. The Serverless Worker starts, creates a Temporal Client, and begins polling the Task Queue.
8282
6. The Worker processes available Tasks until it exits (see [Worker lifecycle](#worker-lifecycle)).
8383

84-
The WCI also monitors the Task Queue backlog independently. If tasks arrive faster than Workers can process them, the
84+
The WCI also monitors the Task Queue backlog independently. If Tasks arrive faster than Workers can process them, the
8585
WCI invokes additional Workers in parallel until the backlog drains or provider concurrency limits are reached.
8686

8787
Each invocation is independent. The Worker creates a fresh client connection on every invocation. There is no connection
@@ -90,7 +90,7 @@ reuse or shared state across invocations.
9090
## Autoscaling {#autoscaling}
9191

9292
Temporal automatically scales Serverless Workers based on Task Queue signals. When Tasks arrive and no Worker is
93-
available, Temporal invokes new Workers. When the work is done, Workers exit and scale to zero.
93+
available, Temporal invokes new Workers. When the Tasks are done, Workers exit and scale to zero.
9494

9595
The WCI uses two signals to decide when to invoke new Workers:
9696

@@ -105,7 +105,7 @@ responsive.
105105
### Task Queue backlog {#task-queue-backlog}
106106

107107
The WCI monitors Task Queue metadata to determine whether pending Tasks exist without enough Workers to process them. If
108-
there is work on the queue and not enough Workers, the WCI invokes additional Workers.
108+
there are Tasks on the queue and not enough Workers, the WCI invokes additional Workers.
109109

110110
## Scaling with long-lived Workers {#scaling-with-long-lived-workers}
111111

@@ -125,7 +125,7 @@ A single Serverless Worker invocation has three phases: init, work, and shutdown
125125
src="/diagrams/serverless-worker-lifecycle.svg"
126126
srcDark="/diagrams/serverless-worker-lifecycle-dark.svg"
127127
alt="Serverless Worker lifecycle"
128-
title="The shutdown deadline buffer controls when the Worker stops polling, and the Worker stop timeout controls how long the Worker waits for in-flight Tasks to finish before shutdown hooks run. Diagram is not to scale. Shutdown hooks typically take less than a few seconds."
128+
title="Diagram is not to scale. The shutdown deadline buffer controls when the Worker stops polling, and the Worker stop timeout controls how long the Worker waits for in-flight Tasks to finish before shutdown hooks run. Shutdown hooks typically take less than a few seconds."
129129
/>
130130

131131
During the **init** phase, the Worker initializes and establishes a client connection to Temporal.
@@ -150,7 +150,7 @@ If your Worker handles long-running Activities, set these three values together:
150150
:::tip
151151

152152
If your longest-running Activity runs longer than half the maximum invocation deadline, this constraint may be difficult or impossible to meet.
153-
In this case, use [Activity Heartbeats](/activity-heartbeat) to record the state of the Activity execution so that the next retry can pick up where it left off.
153+
In this case, use [Activity Heartbeats](/detecting-activity-failures#activity-heartbeat) to record the state of the Activity execution so that the next retry can pick up where it left off.
154154

155155
:::
156156

@@ -210,7 +210,7 @@ With single-slot configuration, each Activity gets a dedicated execution environ
210210
| Activity duration | Must complete within the compute provider's invocation limit (minus shutdown deadline buffer). For AWS Lambda, the maximum is 15 minutes. |
211211
| Workflow duration | No limit. Workflows of any duration work, regardless of the invocation timeout. A Workflow runs across as many invocations as needed. |
212212
| Worker code | Same Temporal SDK Worker code, using the serverless Worker package for your SDK. |
213-
| Versioning | [Worker Versioning](/worker-versioning) is required. Each Workflow must have an `AutoUpgrade` or `Pinned` behavior, set per-Workflow or as a worker-level default. |
213+
| Versioning | [Worker Versioning](/worker-versioning) is required. Each Workflow must have an `AutoUpgrade` or `Pinned` behavior, set per-Workflow or as a Worker-level default. |
214214

215215
## Compute providers {#compute-providers}
216216

docs/production-deployment/worker-deployments/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ This section also covers specific Worker Deployment examples:
3737

3838
- [**Serverless Workers**](/production-deployment/worker-deployments/serverless-workers)
3939
Deploy Serverless Workers on serverless compute like AWS Lambda.
40-
Temporal invokes your Worker when tasks arrive, with no long-lived processes to manage.
40+
Temporal invokes your Worker when Tasks arrive, with no long-lived processes to manage.
4141

4242
- [**Deploy Workers to Amazon EKS**](/production-deployment/worker-deployments/deploy-workers-to-aws-eks)
4343
Containerize your Worker, publish it to Amazon Elastic Container Registry (ECR), and deploy it to Amazon Elastic Kubernetes Service (EKS) using the Temporal Python SDK.

docs/production-deployment/worker-deployments/serverless-workers/aws-lambda.mdx

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,48 +45,18 @@ APIs are experimental and may be subject to backwards-incompatible changes.
4545
- The AWS-specific steps in this guide require the [`aws` CLI](https://aws.amazon.com/cli/) installed and configured
4646
with your AWS credentials. You may use other tools to perform the steps, such as the AWS Console or the AWS SDKs.
4747

48-
<SdkTabs hideUnsupportedLanguages>
49-
<SdkTabs.Go>
50-
51-
- The [Go SDK](/develop/go) (`go.temporal.io/sdk`)
52-
53-
:::tip
54-
55-
If you are just exploring the Serverless Worker feature and don't have a Workflow ready, you can use the sample
56-
Workflows and Activities from the
57-
[Go Lambda Worker sample](https://github.com/temporalio/samples-go/tree/main/lambda-worker).
58-
59-
:::
60-
61-
</SdkTabs.Go>
62-
<SdkTabs.Python>
63-
64-
- The [Python SDK](/develop/python) (`temporalio`)
48+
- The [Go SDK](/develop/go), [Python SDK](/develop/python), or [TypeScript SDK](/develop/typescript), depending on which
49+
language you are using. Use the tabs to select your language and the rest of the page will update accordingly.
6550

6651
:::tip
6752

68-
If you are just exploring the Serverless Worker feature and don't have a Workflow ready, you can use the sample
69-
Workflows and Activities from the
70-
[Python Lambda Worker sample](https://github.com/temporalio/samples-python/tree/main/lambda_worker).
71-
72-
:::
73-
74-
</SdkTabs.Python>
75-
<SdkTabs.TypeScript>
76-
77-
- The [TypeScript SDK](/develop/typescript) (`@temporalio/lambda-worker`)
78-
79-
:::tip
80-
81-
If you are just exploring the Serverless Worker feature and don't have a Workflow ready, you can use the sample
82-
Workflows and Activities from the
53+
If you are exploring the Serverless Worker feature and don't have a Workflow ready, you can use a sample from
54+
the [Go Lambda Worker sample](https://github.com/temporalio/samples-go/tree/main/lambda-worker),
55+
[Python Lambda Worker sample](https://github.com/temporalio/samples-python/tree/main/lambda_worker), or
8356
[TypeScript Lambda Worker sample](https://github.com/temporalio/samples-typescript/tree/main/lambda-worker).
8457

8558
:::
8659

87-
</SdkTabs.TypeScript>
88-
</SdkTabs>
89-
9060
## 1. Write Worker code {#write-worker-code}
9161

9262
Write a Worker that runs inside a Lambda function. The Worker handles the per-invocation lifecycle: connecting to
@@ -124,7 +94,7 @@ func main() {
12494
```
12595

12696
Each Workflow must have a [versioning behavior](/worker-versioning#versioning-behaviors), either `AutoUpgrade` or
127-
`Pinned`. Set it per-Workflow at registration time, or set a worker-level default with `DefaultVersioningBehavior` in
97+
`Pinned`. Set it per-Workflow at registration time, or set a Worker-level default with `DefaultVersioningBehavior` in
12898
`DeploymentOptions`.
12999

130100
For details on configuration options, Lambda-tuned defaults, and the invocation lifecycle, see
@@ -159,7 +129,7 @@ lambda_handler = run_worker(
159129
```
160130

161131
Each Workflow must have a [versioning behavior](/worker-versioning#versioning-behaviors), either `PINNED` or
162-
`AUTO_UPGRADE`. Set it per-Workflow in the `@workflow.defn` decorator, or set a worker-level default with
132+
`AUTO_UPGRADE`. Set it per-Workflow in the `@workflow.defn` decorator, or set a Worker-level default with
163133
`default_versioning_behavior` in the worker config.
164134

165135
```python

docs/production-deployment/worker-deployments/serverless-workers/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ Deploy your Worker code to a serverless provider, configure a compute provider f
2121
There are no long-lived processes to provision or scale.
2222

2323
Temporal monitors Task Queues that have a compute provider configured.
24-
When a task arrives and no Worker is polling, Temporal invokes the configured compute target.
25-
The Worker starts, processes available tasks, and shuts down when the invocation window ends.
24+
When a Task arrives and no Worker is polling, Temporal invokes the configured compute target.
25+
The Worker starts, processes available Tasks, and shuts down when the invocation window ends.
2626

2727
## Supported providers
2828

docs/production-deployment/worker-deployments/serverless-workers/self-hosted-setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Worker.
4141

4242
## Ensure Lambda can reach the Temporal Service {#ensure-network-reachability}
4343

44-
The [Temporal Service frontend](/temporal-service#frontend-service) must be reachable from the Lambda execution
44+
The [Temporal Service frontend](/temporal-service/temporal-server#frontend-service) must be reachable from the Lambda execution
4545
environment. How to achieve this depends on your network setup. If the Temporal Service runs on a private network, you
4646
may need [VPC access for Lambda](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), VPC peering, or a
4747
similar mechanism to allow the Lambda function to connect to the Temporal frontend.

0 commit comments

Comments
 (0)