Skip to content
Open
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
7 changes: 7 additions & 0 deletions docs/encyclopedia/workers/serverless-workers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ If your Worker handles long-running Activities, set these three values together:
- **Invocation deadline > longest Activity runtime + shutdown deadline buffer.** Set on the compute provider to give
each invocation enough total runtime.

:::tip

If your longest-running Activity runs longer than half the maximum invocation deadline, this constraint may be difficult or impossible to meet.
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.

:::

For example, if your longest Activity runtime is 5 minutes, and your shutdown hooks take 3 seconds to run, set the
Worker stop timeout to more than 5 minutes, and the shutdown deadline buffer to more than 303 seconds (5 minutes + 3
seconds). Set your invocation deadline to at least 10 minutes and 3 seconds (5 minutes + 303 seconds).
Expand Down
Loading