From ae0a0a13477636036ed1d0115c7e54f7898b68a1 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Tue, 27 Jan 2026 11:44:19 -0500 Subject: [PATCH 1/2] Standalone Activity concept docs --- docs/encyclopedia/activities/activities.mdx | 13 ++++++---- .../activities/activity-execution.mdx | 5 ++-- .../activities/standalone-activity.mdx | 26 +++++++++++++++++++ .../detecting-activity-failures.mdx | 2 +- sidebars.js | 1 + 5 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 docs/encyclopedia/activities/standalone-activity.mdx diff --git a/docs/encyclopedia/activities/activities.mdx b/docs/encyclopedia/activities/activities.mdx index b3dd08b612..62928fed57 100644 --- a/docs/encyclopedia/activities/activities.mdx +++ b/docs/encyclopedia/activities/activities.mdx @@ -3,7 +3,7 @@ id: activities title: What is a Temporal Activity? sidebar_label: Activities description: - Understand Temporal Activities, including Activity Definitions, Types, Executions, idempotency, cancellations, and + Understand Temporal Activities, including Activity Definitions, Types, Executions, idempotency, cancellations, Standalone Activities, and Local Activities. slug: /activities toc_max_heading_level: 4 @@ -19,7 +19,7 @@ tags: This guide provides a comprehensive overview of Temporal Activities including [Activity Definition](/activity-definition), [Activity Type](/activity-definition#activity-type), -[Activity Execution](/activity-execution), and [Local Activity](/local-activity). +[Activity Execution](/activity-execution), [Standalone Activity](/standalone-activity), and [Local Activity](/local-activity). An Activity is a normal function or method that executes a single, well-defined action (either short or long running), such as calling another service, transcoding a media file, or sending an email message. Activity code can be @@ -34,11 +34,14 @@ Activities are the most common Temporal primitive and encompass small units of w Larger pieces of functionality should be broken up into multiple activities. This makes it easier to do failure recovery, have short timeouts, and be idempotent. -Workflow code orchestrates the execution of Activities, persisting the results. If an Activity Function Execution fails, -any future execution starts from initial state (except -[Heartbeats](/encyclopedia/detecting-activity-failures#activity-heartbeat)). +Workflow code orchestrates the execution of Activities, persisting the results. If an Activity Execution fails, +any future attempt will start from the initial state, unless your code uses ([Heartbeat details payloads](/encyclopedia/detecting-activity-failures#activity-heartbeat)) +for checkpointing (storing state on the server, and using it when resuming subsequent attempts). Activity Functions are executed by Worker Processes. When the Activity Function returns, the Worker sends the results back to the Temporal Service as part of the [ActivityTaskCompleted](/references/events#activitytaskcompleted) Event. The Event is added to the Workflow Execution's Event History. For other Activity-related Events, see [Activity Events](/workflow-execution/event#activity-events). + +If you only want to execute one Activity Function, then you don't need to use a Workflow: you can use your SDK Client to invoke it directly as a [Standalone Activity](/standalone-activity). +This will have lower latency and will result in fewer [Billable Actions](/cloud/actions#actions-in-workflows) in Temporal Cloud. \ No newline at end of file diff --git a/docs/encyclopedia/activities/activity-execution.mdx b/docs/encyclopedia/activities/activity-execution.mdx index 5696d66a19..db42273a7c 100644 --- a/docs/encyclopedia/activities/activity-execution.mdx +++ b/docs/encyclopedia/activities/activity-execution.mdx @@ -46,8 +46,9 @@ You can customize [Activity Execution timeouts](/encyclopedia/detecting-activity [retry policies](/encyclopedia/retry-policies). If an Activity Execution fails (because it exhausted all retries, threw a -[non-retryable error](/encyclopedia/retry-policies#non-retryable-errors), or was canceled), the error is returned to the -[Workflow](/workflows), which decides how to handle it. +[non-retryable error](/encyclopedia/retry-policies#non-retryable-errors), or was canceled), the error is returned to your +[Workflow](/workflows) code when it attempts to fetch the Activity result. For [Standalone Activities](/standalone-activity) the error is +returned to the Client when you attempt to fetch the Activity result. :::note diff --git a/docs/encyclopedia/activities/standalone-activity.mdx b/docs/encyclopedia/activities/standalone-activity.mdx new file mode 100644 index 0000000000..2734ca978d --- /dev/null +++ b/docs/encyclopedia/activities/standalone-activity.mdx @@ -0,0 +1,26 @@ +--- +id: standalone-activity +title: Standalone Activity +sidebar_label: Standalone Activity +description: Learn about Standalone Activities in Temporal, their benefits, execution model, and when to use them. +slug: /standalone-activity +toc_max_heading_level: 4 +keywords: + - explanation + - term + - timeouts +tags: + - Concepts + - Activities + - Durable Execution +--- + +## Standalone Activity {#standalone-activity} + +An [Activity Execution](/activity-execution) that is started directly by a [Client](/encyclopedia/temporal-sdks#temporal-client), without using a Workflow, is called a Standalone Activity. + +If you need to orchestrate multiple Activity Executions, then you should use a Workflow. +But if you just need to execute a single Activity, then Standalone Activity will have lower latency and will result in fewer [Billable Actions](/cloud/actions) in Temporal Cloud. + +Standalone Activities support the same retry policies and timeouts as Workflow Activities, and you write your Activity Functions in the same way for both. +In fact, an Activity Function can be executed both as a Standalone Activity and as a Workflow Activity. diff --git a/docs/encyclopedia/detecting-activity-failures.mdx b/docs/encyclopedia/detecting-activity-failures.mdx index 9a2355d719..3213dd59bb 100644 --- a/docs/encyclopedia/detecting-activity-failures.mdx +++ b/docs/encyclopedia/detecting-activity-failures.mdx @@ -185,7 +185,7 @@ Activity Heartbeats are implemented within the Activity Definition. Custom progress information can be included in the Heartbeat which can then be used by the Activity Execution should a retry occur. An Activity Heartbeat can be recorded as often as needed (e.g. once a minute or every loop iteration). -It is often a good practice to Heartbeat on anything but the shortest Activity Function Execution. +It is often a good practice to Heartbeat on anything but the shortest Activity Execution. Temporal SDKs control the rate at which Heartbeats are sent to the Temporal Service. Heartbeating is not required from [Local Activities](/local-activity), and does nothing. diff --git a/sidebars.js b/sidebars.js index 567a21a3fd..ea1b7ebe5c 100644 --- a/sidebars.js +++ b/sidebars.js @@ -704,6 +704,7 @@ module.exports = { items: [ 'encyclopedia/activities/activity-definition', 'encyclopedia/activities/activity-execution', + 'encyclopedia/activities/standalone-activity', 'encyclopedia/activities/local-activity', ], }, From 89da3f59e2cca6de4edd17d628f843d26700165c Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Tue, 27 Jan 2026 18:02:57 -0500 Subject: [PATCH 2/2] Simplify --- docs/encyclopedia/activities/activities.mdx | 4 ++-- docs/encyclopedia/activities/standalone-activity.mdx | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/encyclopedia/activities/activities.mdx b/docs/encyclopedia/activities/activities.mdx index 62928fed57..5629c7cb5f 100644 --- a/docs/encyclopedia/activities/activities.mdx +++ b/docs/encyclopedia/activities/activities.mdx @@ -43,5 +43,5 @@ back to the Temporal Service as part of the [ActivityTaskCompleted](/references/ Event is added to the Workflow Execution's Event History. For other Activity-related Events, see [Activity Events](/workflow-execution/event#activity-events). -If you only want to execute one Activity Function, then you don't need to use a Workflow: you can use your SDK Client to invoke it directly as a [Standalone Activity](/standalone-activity). -This will have lower latency and will result in fewer [Billable Actions](/cloud/actions#actions-in-workflows) in Temporal Cloud. \ No newline at end of file +If you only want to execute one Activity Function, then you don't need to use a Workflow: you can +use your SDK Client to invoke it directly as a [Standalone Activity](/standalone-activity). diff --git a/docs/encyclopedia/activities/standalone-activity.mdx b/docs/encyclopedia/activities/standalone-activity.mdx index 2734ca978d..14f3ef2a01 100644 --- a/docs/encyclopedia/activities/standalone-activity.mdx +++ b/docs/encyclopedia/activities/standalone-activity.mdx @@ -19,8 +19,12 @@ tags: An [Activity Execution](/activity-execution) that is started directly by a [Client](/encyclopedia/temporal-sdks#temporal-client), without using a Workflow, is called a Standalone Activity. -If you need to orchestrate multiple Activity Executions, then you should use a Workflow. -But if you just need to execute a single Activity, then Standalone Activity will have lower latency and will result in fewer [Billable Actions](/cloud/actions) in Temporal Cloud. +If you need to orchestrate multiple Activity Executions, then you should use a Workflow. But if you +just need to execute a single Activity, then you can use a Standalone Activity. This will result in +fewer [Billable Actions](/cloud/actions#actions-in-workflows) in Temporal Cloud. If your Activity +Execution is short-lived, then you will also notice lower latency, since there are fewer worker +round-trips than when executing the Activity in a Workflow. -Standalone Activities support the same retry policies and timeouts as Workflow Activities, and you write your Activity Functions in the same way for both. -In fact, an Activity Function can be executed both as a Standalone Activity and as a Workflow Activity. +Standalone Activities support the same retry policies and timeouts as Workflow Activities, and you +write your Activity Functions in the same way for both. In fact, an Activity Function can be +executed both as a Standalone Activity and as a Workflow Activity.