Skip to content

Commit 02a82f2

Browse files
Merge branch 'main' into ha-connectivity-endpoints
2 parents 36c608c + ed7aaef commit 02a82f2

85 files changed

Lines changed: 4124 additions & 574 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/best-practices/cost-optimization.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ See [Spooky Stories: Chilling Temporal Anti-Patterns](https://temporal.io/blog/s
6262
### Large payloads in Workflow History
6363

6464
Passing multi-megabyte payloads through Workflows when external storage (S3, blob storage) is more appropriate.
65-
Use [compression](/troubleshooting/blob-size-limit-error#why-does-this-error-occur) or the [claim check pattern](https://dataengineering.wiki/Concepts/Software+Engineering/Claim+Check+Pattern) for large data.
65+
Use [compression](/troubleshooting/blob-size-limit-error#payload-size-limit) or the [claim check pattern](https://dataengineering.wiki/Concepts/Software+Engineering/Claim+Check+Pattern) for large data.
6666

6767
### Over-optimization at the expense of observability
6868

docs/cloud/capacity-modes.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,6 @@ This means that your default limit would be 800 APS.
133133

134134
## Provisioned Capacity {#provisioned-capacity}
135135

136-
:::tip Support, stability, and dependency info
137-
138-
Provisioned Capacity is currently in [Public Preview](/evaluate/development-production-features/release-stages#public-preview).
139-
140-
:::
141-
142136
Provisioned Capacity provides an alternative to On-Demand Capacity by allowing you to control the limits on your Namespace based on your specific need.
143137

144138
| | Actions Per Second | Requests Per Second | Operations Per Second|

docs/cloud/worker-health.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ This page is a guide to monitoring a Temporal Worker fleet and covers the follow
3939
- [How to detect misconfigured Workers](#detect-misconfigured-workers)
4040
- [How to configure Sticky cache](#configure-sticky-cache)
4141

42+
:::tip
43+
44+
You can also inspect Workers and the Workers assigned to a Task Queue directly in the Temporal UI. See [Visualize Workers in the UI](/develop/worker-performance#visualize-workers).
45+
46+
:::
47+
4248
## Minimal Observations {#minimal-observations}
4349

4450
These alerts should be configured and understood first to gain intelligence into your application health and behaviors.
@@ -450,6 +456,14 @@ Set the `WorkerHeartbeatInterval` property on [`TemporalRuntimeOptions`](https:/
450456
Set it to `null` to disable heartbeating.
451457

452458
</SdkTabs.DotNet>
459+
<SdkTabs.Java>
460+
461+
_Available since Java SDK v1.35.0_
462+
463+
Set the heartbeat interval on [`WorkflowClientOptions.Builder`](https://www.javadoc.io/doc/io.temporal/temporal-sdk/latest/io/temporal/client/WorkflowClientOptions.Builder.html) with `setWorkerHeartbeatInterval(Duration)`.
464+
Set it to a negative `Duration` to disable heartbeating.
465+
466+
</SdkTabs.Java>
453467
<SdkTabs.Ruby>
454468

455469
_Available since Ruby SDK v1.1.0_

docs/develop/dotnet/activities/standalone-activities.mdx

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ description: Execute Activities independently without a Workflow using the Tempo
2222
:::tip SUPPORT, STABILITY, and DEPENDENCY INFO
2323

2424
Temporal .NET SDK support for [Standalone Activities](/standalone-activity) is at
25-
[Pre-release](/evaluate/development-production-features/release-stages#pre-release).
26-
27-
All APIs are experimental and may be subject to backwards-incompatible changes.
25+
[Public Preview](/evaluate/development-production-features/release-stages#public-preview).
2826

2927
:::
3028

@@ -63,47 +61,26 @@ Prerequisites:
6361

6462
- **Temporal .NET SDK** (v1.12.0 or higher). See the [.NET Quickstart](https://docs.temporal.io/develop/dotnet/set-up-your-local-dotnet) for install instructions.
6563

66-
- **Temporal CLI** (Pre-release version with Standalone Activity support)
67-
68-
Download for your platform:
64+
- **Temporal CLI** v1.7.0 or higher
6965

70-
```bash title="macOS (Apple Silicon)"
71-
curl -L https://github.com/temporalio/cli/releases/download/v1.6.2-standalone-activity/temporal_cli_1.6.2-standalone-activity_darwin_arm64.tar.gz | tar xz
72-
```
66+
Install with Homebrew:
7367

74-
```bash title="macOS (Intel)"
75-
curl -L https://github.com/temporalio/cli/releases/download/v1.6.2-standalone-activity/temporal_cli_1.6.2-standalone-activity_darwin_amd64.tar.gz | tar xz
76-
```
77-
78-
```bash title="Linux (arm64)"
79-
curl -L https://github.com/temporalio/cli/releases/download/v1.6.2-standalone-activity/temporal_cli_1.6.2-standalone-activity_linux_arm64.tar.gz | tar xz
68+
```bash
69+
brew install temporal
8070
```
8171

82-
```bash title="Linux (amd64)"
83-
curl -L https://github.com/temporalio/cli/releases/download/v1.6.2-standalone-activity/temporal_cli_1.6.2-standalone-activity_linux_amd64.tar.gz | tar xz
84-
```
72+
Or see the [Temporal CLI install guide](/cli#install) for other platforms.
8573

8674
Verify the installation:
8775

8876
```bash
89-
./temporal --version
90-
# temporal version 1.6.2-standalone-activity (Server 1.31.0-151.2, UI 2.47.2)
77+
temporal --version
9178
```
9279

93-
Move the binary to your PATH or run it from the current directory as `./temporal`.
94-
95-
:::warning
96-
97-
If you see `Standalone activity is disabled` when running commands, you are using the standard
98-
Temporal CLI instead of the pre-release version above. The standard `brew install temporal` or
99-
`brew upgrade temporal` does not include Standalone Activity support during Pre-release.
100-
101-
:::
102-
10380
Start the Temporal development server:
10481

10582
```bash
106-
./temporal server start-dev
83+
temporal server start-dev
10784
```
10885

10986
This command automatically starts the Temporal development server with the Web UI, and creates the `default` Namespace.
@@ -251,7 +228,7 @@ You can pass the Activity as either a lambda expression or a string Activity typ
251228
// Using a lambda expression (type-safe)
252229
var result = await client.ExecuteActivityAsync(
253230
() => MyActivities.ComposeGreetingAsync(new ComposeGreetingInput("Hello", "World")),
254-
new("my-activity-id", "my-task-queue")
231+
new("standalone-activity-id", "standalone-activity-sample")
255232
{
256233
ScheduleToCloseTimeout = TimeSpan.FromSeconds(10),
257234
});
@@ -260,7 +237,7 @@ var result = await client.ExecuteActivityAsync(
260237
var result = await client.ExecuteActivityAsync<string>(
261238
"ComposeGreeting",
262239
new object?[] { new ComposeGreetingInput("Hello", "World") },
263-
new("my-activity-id", "my-task-queue")
240+
new("standalone-activity-id", "standalone-activity-sample")
264241
{
265242
ScheduleToCloseTimeout = TimeSpan.FromSeconds(10),
266243
});
@@ -284,7 +261,7 @@ dotnet run --project src/StandaloneActivity execute-activity
284261
Or use the Temporal CLI:
285262

286263
```bash
287-
./temporal activity execute \
264+
temporal activity execute \
288265
--type ComposeGreeting \
289266
--activity-id standalone-activity-id \
290267
--task-queue standalone-activity-sample \
@@ -331,7 +308,7 @@ dotnet run --project src/StandaloneActivity start-activity
331308
Or use the Temporal CLI:
332309

333310
```bash
334-
./temporal activity start \
311+
temporal activity start \
335312
--type ComposeGreeting \
336313
--activity-id standalone-activity-id \
337314
--task-queue standalone-activity-sample \
@@ -366,7 +343,7 @@ var result = await handle.GetResultAsync();
366343
Or use the Temporal CLI to wait for a result by Activity ID:
367344

368345
```bash
369-
./temporal activity result --activity-id my-standalone-activity-id
346+
temporal activity result --activity-id my-standalone-activity-id
370347
```
371348

372349
## List Standalone Activities {#list-activities}
@@ -405,7 +382,7 @@ dotnet run --project src/StandaloneActivity list-activities
405382
Or use the Temporal CLI:
406383

407384
```bash
408-
./temporal activity list
385+
temporal activity list
409386
```
410387

411388
The query parameter accepts the same [List Filter](/list-filter) syntax used for [Workflow
@@ -443,7 +420,7 @@ dotnet run --project src/StandaloneActivity count-activities
443420
Or use the Temporal CLI:
444421

445422
```bash
446-
./temporal activity count
423+
temporal activity count
447424
```
448425

449426
## Run Standalone Activities with Temporal Cloud {#run-standalone-activities-temporal-cloud}

docs/develop/dotnet/workflows/basics.mdx

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,9 @@ All Workflow Definition parameters must be serializable.
4444

4545
## Workflow logic requirements {#workflow-logic-requirements}
4646

47-
Workflow logic is constrained by [deterministic execution requirements](/workflow-definition#deterministic-constraints).
48-
Therefore, each language is limited to the use of certain idiomatic techniques.
49-
However, each Temporal SDK provides a set of APIs that can be used inside your Workflow to interact with external (to the Workflow) application code.
47+
Workflow logic is constrained by [deterministic execution requirements](/workflow-definition#deterministic-constraints). Each Temporal SDK provides a set of APIs that can be used inside your Workflow to interact with application code outside the Workflow.
5048

51-
This means there are several things Workflows cannot do such as:
49+
This means there are several things Workflows shouldn't do such as:
5250

5351
- Perform IO (network, disk, stdio, etc)
5452
- Access/alter external mutable state
@@ -65,34 +63,28 @@ This is especially true with `Task`s.
6563
Temporal requires that the deterministic `TaskScheduler.Current` is used, but many .NET async calls will use `TaskScheduler.Default` implicitly (and some analyzers even encourage this).
6664
Here are some known gotchas to avoid with .NET tasks inside of Workflows:
6765

68-
- Do not use `Task.Run` - this uses the default scheduler and puts work on the thread pool.
69-
- Use `Workflow.RunTaskAsync` instead.
70-
- Can also use `Task.Factory.StartNew` with current scheduler or instantiate the `Task` and run `Task.Start` on it.
71-
- Do not use `Task.ConfigureAwait(false)` - this will not use the current context.
72-
- If you must use `Task.ConfigureAwait`, use `Task.ConfigureAwait(true)`.
73-
- There is no significant performance benefit to `Task.ConfigureAwait` in workflows anyways due to how the scheduler works.
74-
- Do not use anything that defaults to the default task scheduler.
75-
- Do not use `Task.Delay`, `Task.Wait`, timeout-based `CancellationTokenSource`, or anything that uses .NET built-in timers.
76-
- `Workflow.DelayAsync`, `Workflow.WaitConditionAsync`, or non-timeout-based cancellation token source is suggested.
77-
- Do not use `Task.WhenAny`.
78-
- Use `Workflow.WhenAnyAsync` instead.
66+
- Use `Workflow.RunTaskAsync` instead of `Task.Run`. `Task.Run` uses the default scheduler and puts work on the thread pool.
67+
- You can also use `Task.Factory.StartNew` with current scheduler or instantiate the `Task` and run `Task.Start` on it.
68+
- If you need to use `Task.ConfigureAwait`, use `Task.ConfigureAwait(true)`. `Task.ConfigureAwait(false)` won't use the current context.
69+
- There is no significant performance benefit to `Task.ConfigureAwait` in workflows because of how the scheduler works.
70+
- Avoid anything that defaults to the default task scheduler.
71+
- Use `Workflow.DelayAsync`, `Workflow.WaitConditionAsync`, or non-timeout-based cancellation token sources instead of `Task.Delay`, `Task.Wait`, timeout-based `CancellationTokenSource`, or anything that uses .NET built-in timers.
72+
- Use `Workflow.WhenAnyAsync` instead of `Task.WhenAny`.
7973
- Technically this only applies to an enumerable set of tasks with results or more than 2 tasks with results. Other
8074
uses are safe. See [this issue](https://github.com/dotnet/runtime/issues/87481).
81-
- Do not use `Task.WhenAll`
82-
- Use `Workflow.WhenAllAsync` instead.
75+
- Use `Workflow.WhenAllAsync` instead of `Task.WhenAll`.
8376
- Technically `Task.WhenAll` is currently deterministic in .NET and safe, but it is better to use the wrapper to be
8477
sure.
85-
- Do not use `CancellationTokenSource.CancelAsync`.
86-
- Use `CancellationTokenSource.Cancel` instead.
87-
- Do not use `System.Threading.Semaphore` or `System.Threading.SemaphoreSlim` or `System.Threading.Mutex`.
88-
- Use `Temporalio.Workflows.Semaphore` or `Temporalio.Workflows.Mutex` instead.
78+
- Use `CancellationTokenSource.Cancel` instead of `CancellationTokenSource.CancelAsync`.
79+
- Use `Temporalio.Workflows.Semaphore` or `Temporalio.Workflows.Mutex` instead of `System.Threading.Semaphore`, `System.Threading.SemaphoreSlim`, or `System.Threading.Mutex`.
8980
- _Technically_ `SemaphoreSlim` does work if only the async form of `WaitAsync` is used without no timeouts and
9081
`Release` is used. But anything else can deadlock the workflow and its use is cumbersome since it must be disposed.
9182
- Be wary of additional libraries' implicit use of the default scheduler.
9283
- For example, while there are articles for `Dataflow` about [using a specific scheduler](https://learn.microsoft.com/en-us/dotnet/standard/parallel-programming/how-to-specify-a-task-scheduler-in-a-dataflow-block), there are hidden implicit uses of `TaskScheduler.Default`. For example, see [this bug](https://github.com/dotnet/runtime/issues/83159).
9384

9485
In order to help catch wrong scheduler use, by default the Temporal .NET SDK adds an event source listener for info-level task events.
9586
While this technically receives events from all uses of tasks in the process, we make sure to ignore anything that is not running in a Workflow in a high performant way (basically one thread local check).
87+
9688
For code that does run in a Workflow and accidentally starts a task in another scheduler, an `InvalidWorkflowOperationException` will be thrown which "pauses" the Workflow (fails the Workflow Task which continually retries until the code is fixed).
9789
This is unfortunately a runtime-only check, but can help catch mistakes early. If this needs to be turned off for any reason, set `DisableWorkflowTracingEventListener` to `true` in Worker options.
9890

docs/develop/dotnet/workflows/cancellation.mdx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,18 @@ public async Task RunAsync()
9090

9191
// Call cleanup activity. If this throws, it will swallow the original exception which we
9292
// are ok with here. This could be changed to just log a failure and let the original
93-
// cancellation continue. We use a different cancellation token since the default one on
94-
// Workflow.CancellationToken is now marked cancelled.
95-
using var detachedCancelSource = new CancellationTokenSource();
93+
// cancellation continue.
94+
// The default token on Workflow.CancellationToken is now marked
95+
// cancelled, so we pass a different one. We use CancellationToken.None here because the
96+
// cleanup activity itself doesn't need to be cancellable; if it did (e.g. you want to
97+
// cancel cleanup from a timeout or another signal), create a new detached
98+
// CancellationTokenSource and pass its Token instead.
9699
await Workflow.ExecuteActivityAsync(
97100
(MyActivities a) => a.MyCancellationCleanupActivity(),
98101
new()
99102
{
100103
ScheduleToCloseTimeout = TimeSpan.FromMinutes(5),
101-
CancellationToken = detachedCancelSource.Token;
104+
CancellationToken = CancellationToken.None,
102105
});
103106

104107
// Rethrow the cancellation

docs/develop/dotnet/workflows/versioning.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ import { CaptionedImage } from '@site/src/components';
3131

3232
Since Workflow Executions in Temporal can run for long periods — sometimes months or even years — it's common to need to make changes to a Workflow Definition, even while a particular Workflow Execution is in progress.
3333

34-
The Temporal Platform requires that Workflow code is [deterministic](/workflow-definition#deterministic-constraints).
35-
If you make a change to your Workflow code that would cause non-deterministic behavior on Replay, you'll need to use one of our Versioning methods to gracefully update your running Workflows.
34+
The Temporal Platform requires that Workflow code is [deterministic](/workflow-definition#deterministic-constraints). If you make a change to your Workflow code that would cause non-deterministic behavior on Replay, you'll need to use one of our Versioning methods to gracefully update your running Workflows. This only applies to Workflow orchestration logic. Non-deterministic work such as API calls, and database queries should be placed in Activities, which Temporal retries reliably.
35+
3636
With Versioning, you can modify your Workflow Definition so that new executions use the updated code, while existing ones continue running the original version.
3737
There are two primary Versioning methods that you can use:
3838

docs/develop/go/activities/standalone-activities.mdx

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ description: Execute Activities independently without a Workflow using the Tempo
2222
:::tip SUPPORT, STABILITY, and DEPENDENCY INFO
2323

2424
Temporal Go SDK support for [Standalone Activities](/standalone-activity) is at
25-
[Pre-release](/evaluate/development-production-features/release-stages#pre-release).
26-
27-
All APIs are experimental and may be subject to backwards-incompatible changes.
25+
[Public Preview](/evaluate/development-production-features/release-stages#public-preview).
2826

2927
:::
3028

@@ -62,47 +60,26 @@ Prerequisites:
6260

6361
- **[Temporal Go SDK](https://docs.temporal.io/develop/go/core-application#install-a-temporal-sdk)** (v1.41.0 or higher)
6462

65-
- **Temporal CLI** (Pre-release version with Standalone Activity support)
66-
67-
Download for your platform:
63+
- **Temporal CLI** v1.7.0 or higher
6864

69-
```bash title="macOS (Apple Silicon)"
70-
curl -L https://github.com/temporalio/cli/releases/download/v1.6.2-standalone-activity/temporal_cli_1.6.2-standalone-activity_darwin_arm64.tar.gz | tar xz
71-
```
65+
Install with Homebrew:
7266

73-
```bash title="macOS (Intel)"
74-
curl -L https://github.com/temporalio/cli/releases/download/v1.6.2-standalone-activity/temporal_cli_1.6.2-standalone-activity_darwin_amd64.tar.gz | tar xz
67+
```bash
68+
brew install temporal
7569
```
7670

77-
```bash title="Linux (arm64)"
78-
curl -L https://github.com/temporalio/cli/releases/download/v1.6.2-standalone-activity/temporal_cli_1.6.2-standalone-activity_linux_arm64.tar.gz | tar xz
79-
```
80-
81-
```bash title="Linux (amd64)"
82-
curl -L https://github.com/temporalio/cli/releases/download/v1.6.2-standalone-activity/temporal_cli_1.6.2-standalone-activity_linux_amd64.tar.gz | tar xz
83-
```
71+
Or see the [Temporal CLI install guide](/cli#install) for other platforms.
8472

8573
Verify the installation:
8674

8775
```bash
88-
./temporal --version
89-
# temporal version 1.6.2-standalone-activity (Server 1.31.0-151.2, UI 2.47.2)
76+
temporal --version
9077
```
9178

92-
Move the binary to your PATH or run it from the current directory as `./temporal`.
93-
94-
:::warning
95-
96-
If you see `Standalone activity is disabled` when running commands, you are using the standard
97-
Temporal CLI instead of the pre-release version above. The standard `brew install temporal` or
98-
`brew upgrade temporal` does not include Standalone Activity support during Pre-release.
99-
100-
:::
101-
10279
Start the Temporal development server:
10380

10481
```
105-
./temporal server start-dev
82+
temporal server start-dev
10683
```
10784

10885
This command automatically starts the Temporal development server with the Web UI, and creates the `default` Namespace.
@@ -319,7 +296,7 @@ go run standalone-activity/helloworld/starter/main.go
319296
Or use the Temporal CLI to execute a Standalone Activity:
320297

321298
```bash
322-
./temporal activity execute \
299+
temporal activity execute \
323300
--type Activity \
324301
--activity-id standalone_activity_helloworld_ActivityID \
325302
--task-queue standalone-activity-helloworld \
@@ -347,7 +324,7 @@ the failure is returned as an error.
347324
Or use the Temporal CLI to wait for a result by Activity ID:
348325

349326
```bash
350-
./temporal activity result --activity-id my-standalone-activity-id
327+
temporal activity result --activity-id standalone_activity_helloworld_ActivityID
351328
```
352329

353330
## Get a handle to an existing Standalone Activity {#get-activity-handle}
@@ -359,7 +336,7 @@ Both `ActivityID` and `RunID` are required.
359336

360337
```go
361338
handle := c.GetActivityHandle(client.GetActivityHandleOptions{
362-
ActivityID: "my-standalone-activity-id",
339+
ActivityID: "standalone_activity_helloworld_ActivityID",
363340
RunID: "the-run-id",
364341
})
365342

@@ -399,7 +376,7 @@ for info, err := range resp.Results {
399376
Or use the Temporal CLI:
400377

401378
```bash
402-
./temporal activity list
379+
temporal activity list
403380
```
404381

405382
The `Query` field accepts the same [List Filter](/list-filter) syntax used for Workflow Visibility. For example,
@@ -426,7 +403,7 @@ log.Println("Total activities:", resp.Count)
426403
Or use the Temporal CLI:
427404

428405
```bash
429-
./temporal activity count
406+
temporal activity count
430407
```
431408

432409
## Run Standalone Activities with Temporal Cloud {#run-standalone-activities-temporal-cloud}

0 commit comments

Comments
 (0)