Skip to content
Open
Show file tree
Hide file tree
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
83 changes: 83 additions & 0 deletions docs/develop/standalone-activities-interactive-demo.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
id: standalone-activities-interactive-demo
title: Standalone Activities Demo
sidebar_label: Standalone Activities
toc_max_heading_level: 3
keywords:
- standalone activity
- interactive demo
tags:
- Standalone Activities
- Temporal SDKs
description: An interactive overview of Temporal Standalone Activities.
---

:::tip SUPPORT, STABILITY, and DEPENDENCY INFO

[Standalone Activities](/standalone-activity) are available as a
[Public Preview](/evaluate/development-production-features/release-stages#public-preview) feature
in the Go, Python, and .NET SDKs, and as a
[Pre-release](/evaluate/development-production-features/release-stages#pre-release) feature in the
Java and TypeScript SDKs.

Standalone Activities require Temporal CLI v1.7.0 or higher and Temporal Server v1.31.0 or higher.

:::

Standalone Activities let you run a single Activity straight from your application without
writing a Workflow. Your code calls the Temporal Client, the Server durably enqueues the request
for a Worker to pick up, and the result comes back through a handle that your code can wait on or
check later.

Try the demo below to walk through the full flow, tweak the retry and timeout settings, and watch
the SDK code and CLI command update as you go.

import { StandaloneActivityDemo } from '@site/src/components';

<StandaloneActivityDemo />

---

## How it works

When you call `client.ExecuteActivity()` (or the equivalent in your SDK), the following happens:

1. **Connect**: Your application opens a connection to the Temporal Server using a Temporal Client
configured with your namespace and credentials.
2. **Schedule**: The Server durably persists the Activity Task on the specified Task Queue so that
the request survives Worker restarts and network interruptions.
3. **Poll**: A Worker that is polling that Task Queue picks up the Activity Task and prepares to
execute it.
4. **Execute**: The Worker runs your Activity function with the provided arguments and reports the
outcome back to the Server.
5. **Return**: The Server stores the result and returns it to the original caller through the
`ActivityHandle` that was created when the Activity was scheduled.

Because the Server durably persists the Activity, it survives Worker restarts and network
interruptions. If the Activity fails, the Server automatically retries it according to the Retry
Policy you configure.

### Standalone vs Workflow Activities

| | Workflow Activity | Standalone Activity |
|---|---|---|
| Orchestrated by | A Workflow Definition | Your application code (via the Temporal Client) |
| Started with | SDK-specific (for example, `workflow.ExecuteActivity()` in Go) | SDK-specific (for example, `client.ExecuteActivity()` in Go, `client.StartActivityAsync()` in .NET) |
| Retry policy | Set in `ActivityOptions` inside your Workflow | Set in `StartActivityOptions` when calling the client |
| Visibility | Shown in the Workflow's Event History | Shown in the Activity list and count views |
| Use case | Multi-step orchestration with multiple Activities | Single, independent jobs like sending an email or processing a webhook |

The Activity function and Worker registration are **identical** for both approaches, and only the
execution path that triggers the Activity differs between them.

---

## Next steps

For complete API reference and advanced usage, see the SDK-specific guides:

- [Standalone Activities with the Go SDK](/develop/go/activities/standalone-activities)
- [Standalone Activities with the Java SDK](/develop/java/activities/standalone-activities)
- [Standalone Activities with the Python SDK](/develop/python/activities/standalone-activities)
- [Standalone Activities with the TypeScript SDK](/develop/typescript/activities/standalone-activities)
- [Standalone Activities with the .NET SDK](/develop/dotnet/activities/standalone-activities)
8 changes: 8 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,14 @@ module.exports = {
'web-ui',
],
},
{
type: 'category',
label: 'Interactive Demos',
collapsed: true,
items: [
'develop/standalone-activities-interactive-demo',
],
},
'glossary',
'with-ai',
// {
Expand Down
Loading