Skip to content

Commit fc7eb77

Browse files
lennessyyclaude
andauthored
docs: add Activity Heartbeat tip for long-running Activities on serverless (#4495)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1afbb83 commit fc7eb77

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

docs/encyclopedia/workers/serverless-workers.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ If your Worker handles long-running Activities, set these three values together:
147147
- **Invocation deadline > longest Activity runtime + shutdown deadline buffer.** Set on the compute provider to give
148148
each invocation enough total runtime.
149149

150+
:::tip
151+
152+
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.
154+
155+
:::
156+
150157
For example, if your longest Activity runtime is 5 minutes, and your shutdown hooks take 3 seconds to run, set the
151158
Worker stop timeout to more than 5 minutes, and the shutdown deadline buffer to more than 303 seconds (5 minutes + 3
152159
seconds). Set your invocation deadline to at least 10 minutes and 3 seconds (5 minutes + 303 seconds).

0 commit comments

Comments
 (0)