Creates a typed proxy for calling activity functions with durable execution,
automatic retry, and deterministic replay. This is the primary way to invoke
side-effectful code (HTTP calls, database writes, file I/O) from within a
workflow function.
Activities execute on a separate worker process via message queue,
isolating side effects from the deterministic workflow function. Each
proxied call is assigned a unique execution index, and on replay the
stored result is returned without re-executing the activity.
Routing
Default: Activities route to {workflowTaskQueue}-activity.
Explicit taskQueue: Activities route to {taskQueue}-activity,
enabling shared/global activity worker pools across workflows.
Retry Policy
Option
Default
Description
maximumAttempts
50
Max retries before the activity is marked as failed
backoffCoefficient
2
Exponential backoff multiplier
maximumInterval
'5m'
Cap on delay between retries
throwOnError
true
Throw on activity failure (set false to return the error)
Creates a typed proxy for calling activity functions with durable execution, automatic retry, and deterministic replay. This is the primary way to invoke side-effectful code (HTTP calls, database writes, file I/O) from within a workflow function.
Activities execute on a separate worker process via message queue, isolating side effects from the deterministic workflow function. Each proxied call is assigned a unique execution index, and on replay the stored result is returned without re-executing the activity.
Routing
{workflowTaskQueue}-activity.taskQueue: Activities route to{taskQueue}-activity, enabling shared/global activity worker pools across workflows.Retry Policy
maximumAttemptsbackoffCoefficientmaximumInterval'5m'throwOnErrortruefalseto return the error)Examples