Skip to content

Commit 968c43e

Browse files
authored
Merge branch 'main' into drewhoskins_interceptor
2 parents 4d507d9 + b904131 commit 968c43e

16 files changed

Lines changed: 843 additions & 1901 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ temp/
2525
AGENTS.md
2626
CLAUDE.md
2727
.claude/*
28+
.omc
2829

2930
npm-debug.log*
3031
yarn-debug.log*

docs/cloud/billing-api.mdx

Lines changed: 16 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ tags:
1414
---
1515

1616
The Temporal Cloud Billing API provides Namespace-level cost attribution through on-demand billing reports.
17-
These reports are generated asynchronously and can be accessed with an object endpoint or downloaded in CSV format
18-
for analysis by FinOps professionals and Temporal Cloud operators.
17+
Reports are delivered in CSV format and can be accessed via API or downloaded directly for use in FinOps tooling and cost management platforms.
1918

2019
This API is part of the [Cloud Operations API](/ops).
2120

@@ -29,67 +28,42 @@ The Billing API allows you to:
2928

3029
- Generate billing reports for specified invoice months
3130
- Retrieve report status and metadata
32-
- Correlate report generation with async operations
33-
- Download CSV reports
34-
- Integrate billing reports into internal analytics tooling and cloud cost management platforms
31+
- Download CSV reports that can be fed into internal analytics tooling or cloud cost management platforms
3532

36-
The Billing API contains:
33+
The Billing Report contains:
3734

3835
- Accurate Namespace-level cost attribution
39-
- Down to hourly granularity
40-
- Alignment with the [FOCUS schema](https://focus.finops.org/)
36+
- Hourly granularity
37+
- A [FOCUS](https://focus.finops.org/)-friendly data format
4138

42-
For complete request and response schemas, refer to the Protocol Buffer definitions below.
39+
For complete request and response schemas, refer to the Schema below.
4340

4441
Billing report generation is **asynchronous**. You initiate report creation, then poll for completion.
4542

46-
## Report data granularity
43+
## Report data limitations
4744

48-
Reports can be generated with hourly granularity only, for the current billing month, and the previous billing month.
45+
For pre-release, reports can be generated with hourly granularity only, for the current billing month, and the previous billing month.
4946

5047
## Allowed date ranges
5148

5249
Date ranges must use billing-month boundaries (MM/YYYY).
5350
Requests may include the current billing month.
5451
The data in finalized reports includes usage up to `current_time` \- 24 hours (rounded up to nearest hour).
5552

56-
:::info Limitiations
57-
58-
Data from the current billing period is not cacheable. Also, recently requested historical date ranges may complete faster due to caching.
59-
60-
:::
61-
6253
## Rate limits and concurrency
6354

64-
To ensure system stability, rate limits apply to API usage.
55+
Rate limits apply to API usage.
6556

6657
### Per-account concurrency
6758

6859
Within a single account:
6960

70-
- Only one billing report per account is processed at a time
61+
- Only one billing report per account is generated at a time
7162
- Additional requests are accepted but queued
72-
- Processing occurs serially per account
73-
74-
### Global rate limits
75-
76-
Billing report generation depends on shared infrastructure.
7763

78-
Report generation time varies based on:
64+
### Report Generation Latency
7965

80-
- Global system load
81-
- Date range size
82-
- Cache availability
83-
84-
### Caching behavior
85-
86-
If a previously requested date range is requested again:
87-
88-
- Cached precomputed data is reused
89-
- Global rate limits are skipped
90-
- Generation completes significantly faster
91-
92-
Exception: Data from the current billing period is not cached.
66+
Report generation time varies and is not guaranteed. Factors that affect it include the size of the requested date range and overall platform load.
9367

9468
## Best practices
9569

@@ -99,8 +73,6 @@ Poll `GetBillingReport` using exponential backoff.
9973

10074
Download reports immediately after generation (URLs expire).
10175

102-
Reuse previously requested date ranges when possible to benefit from caching.
103-
10476
Avoid frequent generation of large overlapping ranges in the current billing period.
10577

10678
## Billing report schema
@@ -123,7 +95,7 @@ Each row represents a charge record.
12395
| ChargePeriodStart | Time period start from when this charge took place, correlates to data granularity | 2025-10-01T00:00:00.000Z |
12496
| ContractedCost | Cost calculated by multiplying ContractedUnitPrice and PricingQuantity | 100.00 |
12597
| ContractedUnitPrice | The agreed-upon unit price for a single pricing unit of the associated SKU. Inclusive of negotiated discounts | 10.00 |
126-
| InvoiceID | The ID of the invoice for this billing period | in\_1SPN94JLJETBw2gmYWyQ71xT |
98+
| InvoiceID | The ID of the invoice for this billing period | in\_XXXXXXXXXXXXXXXXXXXX |
12799
| InvoiceIssuer | The entity responsible for issuing payable invoices | stripe |
128100
| PricingQuantity | The volume of a given SKU used or purchased | 10.00 |
129101
| PricingUnit | The measurement unit used for PricingQuantity | 1 Million Actions |
@@ -137,16 +109,13 @@ Each row represents a charge record.
137109
| ServiceSubcategory | A secondary classification of the service category for a service based on its core function | Actions |
138110
| SKUID | A unique identifier that represents a specific SKU | essentials-actions |
139111
| SKUMeter | The functionality being metered or measured by a particular SKU in a charge | Actions |
140-
| Tags | Provider and customer defined tags associated with resources | `{"$tmprl\_project":\["project-id"\],"namespace-tag-key":\["namespace-tag-value"\]}` |
112+
| Tags | Provider and customer defined tags associated with resources | `{"$tmprl_project":["project-id"],"namespace-tag-key":["namespace-tag-value"]}` |
141113

142114
## Generate a report
143115

144116
To generate a report, follow these steps:
145117

146-
1. Create a billing report using `CreateBillingReport`
147-
1. Receive:
148-
- `billing_report_id` (identifies the report artifact)
149-
- `async_operation_id` (identifies the background job)
118+
1. Create a billing report using `CreateBillingReport`. The response includes a `billing_report_id` and `async_operation_id`.
150119
1. Poll `GetBillingReport` using the `billing_report_id`
151120
1. When the report state becomes `BILLING_REPORT_STATE_GENERATED`, retrieve the download URL
152121
1. Download the report before the URL expires
@@ -155,7 +124,7 @@ To generate a report, follow these steps:
155124

156125
| Identifier | Purpose |
157126
| ----- | ----- |
158-
| `billing_report_id` | Identifies the billing report artifact and is used to retrieve metadata and download URLs |
127+
| `billing_report_id` | Identifies the billing report and is used to retrieve metadata and download URLs |
159128
| `async_operation_id` | Identifies the background operation responsible for generating the report |
160129

161130
The async operation follows the standard Cloud Operations async model (see [Async Operations](/ops#per-identity-rate-limits)).

docs/develop/dotnet/message-passing.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ Follow these guidelines when writing your message handlers:
3737

3838
- Message handlers are defined as methods on the Workflow class, using one of the three attributes: [`WorkflowQueryAttribute`](https://dotnet.temporal.io/api/Temporalio.Workflows.WorkflowQueryAttribute.html), [`WorkflowSignalAttribute`](https://dotnet.temporal.io/api/Temporalio.Workflows.WorkflowSignalAttribute.html), and [`WorkflowUpdateAttribute`](https://dotnet.temporal.io/api/Temporalio.Workflows.WorkflowUpdateAttribute.html).
3939
- The parameters and return values of handlers and the main Workflow function must be [serializable](/dataconversion).
40-
- Prefer data classes to multiple input parameters.
41-
Data class parameters allow you to add fields without changing the calling signature.
40+
- Prefer data classes to multiple input parameters. Data class parameters allow you to add fields without changing the calling signature. Keep in mind that serialization and deserialization can fail with the default data converter if the new field does not have a default value.
4241

4342
### Query handlers {#queries}
4443

docs/develop/go/error-handling.mdx

Lines changed: 0 additions & 75 deletions
This file was deleted.

docs/develop/go/failure-detection.mdx

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,97 @@ sidebar_label: Failure detection
55
toc_max_heading_level: 4
66
keywords:
77
- failure detection
8+
- error-handling
89
tags:
910
- Activities
1011
- Workflows
1112
- Failures
1213
- Errors
1314
- Go SDK
1415
- Temporal SDKs
15-
description: Configure Workflow timeouts, set Retry Policies, and manage Activity timeouts and Heartbeats using Temporal's Go SDK for optimized execution control.
16+
description: Handle errors, configure Workflow timeouts, set Retry Policies, and manage Activity timeouts and Heartbeats using Temporal's Go SDK.
1617
---
1718

1819
This page shows how to do the following:
1920

21+
- [Handle errors](#error-handling)
2022
- [Set Workflow timeouts](#workflow-timeouts)
2123
- [Set a Workflow Retry Policy](#workflow-retries)
2224
- [Set Activity timeouts](#activity-timeouts)
2325
- [Set a custom Activity Retry Policy](#activity-retries)
2426

27+
## Error handling {#error-handling}
28+
29+
Within a Workflow, an Activity or Child Workflow execution might fail. You can
30+
handle errors differently based on the error type.
31+
32+
If the Activity returns an error as `errors.New()` or `fmt.Errorf()`, that error is converted into `*temporal.ApplicationError`.
33+
34+
If the Activity returns an error as `temporal.NewNonRetryableApplicationError("error message", details)`, that error is returned as `*temporal.ApplicationError`.
35+
36+
There are other types of errors such as `*temporal.TimeoutError`, `*temporal.CanceledError` and
37+
`*temporal.PanicError`.
38+
39+
Here's an example of handling Activity errors within Workflow code that differentiates between different error types.
40+
41+
```go
42+
err := workflow.ExecuteActivity(ctx, YourActivity, ...).Get(ctx, nil)
43+
if err != nil {
44+
var applicationErr *ApplicationError
45+
if errors.As(err, &applicationErr) {
46+
// retrieve error message
47+
workflow.GetLogger(ctx).Info("Application error", "error", applicationErr.Error())
48+
49+
// handle Activity errors (created via NewApplicationError() API)
50+
var detailMsg string // assuming Activity return error by NewApplicationError("message", true, "string details")
51+
applicationErr.Details(&detailMsg) // extract strong typed details
52+
53+
// handle Activity errors (errors created other than using NewApplicationError() API)
54+
switch applicationErr.Type() {
55+
case "CustomErrTypeA":
56+
// handle CustomErrTypeA
57+
case CustomErrTypeB:
58+
// handle CustomErrTypeB
59+
default:
60+
// newer version of Activity could return new errors that Workflow was not aware of.
61+
}
62+
}
63+
64+
var canceledErr *CanceledError
65+
if errors.As(err, &canceledErr) {
66+
// handle cancellation
67+
}
68+
69+
var timeoutErr *TimeoutError
70+
if errors.As(err, &timeoutErr) {
71+
// handle timeout, could check timeout type by timeoutErr.TimeoutType()
72+
switch err.TimeoutType() {
73+
case commonpb.ScheduleToStart:
74+
// Handle ScheduleToStart timeout.
75+
case commonpb.StartToClose:
76+
// Handle StartToClose timeout.
77+
case commonpb.Heartbeat:
78+
// Handle heartbeat timeout.
79+
default:
80+
}
81+
}
82+
83+
var panicErr *PanicError
84+
if errors.As(err, &panicErr) {
85+
// handle panic, message and call stack are available by panicErr.Error() and panicErr.StackTrace()
86+
}
87+
}
88+
```
89+
90+
### Panics and deferred functions
91+
92+
In Go, [`defer` schedules cleanup functions and `recover()` catches panics](https://go.dev/blog/defer-panic-and-recover) to prevent them from crashing the program.
93+
This doesn't work the same way in Temporal Workflow code — you cannot `recover()` from a panic inside a `defer`.
94+
Deferred functions that try to interact with the Temporal SDK during panic unwinding will re-panic immediately.
95+
96+
Use `defer` only for local cleanup.
97+
Handle Temporal API cleanup through explicit error checks instead.
98+
2599
## Workflow timeouts {#workflow-timeouts}
26100

27101
**How to set Workflow timeouts using the Temporal Go SDK**

docs/develop/python/message-passing.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ Follow these guidelines when writing your message handlers:
4242

4343
- Message handlers are defined as methods on the Workflow class, using one of the three decorators: [`@workflow.query`](https://python.temporal.io/temporalio.workflow.html#query), [`@workflow.signal`](https://python.temporal.io/temporalio.workflow.html#signal), and [`@workflow.update`](https://python.temporal.io/temporalio.workflow.html#update).
4444
- The parameters and return values of handlers and the main Workflow function must be [serializable](/dataconversion).
45-
- Prefer [data classes](https://docs.python.org/3/library/dataclasses.html) to multiple input parameters.
46-
Data class parameters allow you to add fields without changing the calling signature.
45+
- Prefer [data classes](https://docs.python.org/3/library/dataclasses.html) to multiple input parameters. Data class parameters allow you to add fields without changing the calling signature. Keep in mind that serialization and deserialization can fail with the default data converter if the new field does not have a default value.
4746

4847
### Query handlers {#queries}
4948

docs/develop/python/temporal-nexus.mdx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ import { CaptionedImage } from '@site/src/components';
1818

1919
:::tip SUPPORT, STABILITY, and DEPENDENCY INFO
2020

21-
Temporal Python SDK support for Nexus is at [Public Preview](/evaluate/development-production-features/release-stages#public-preview).
22-
23-
Features in public preview may undergo further development and testing before they are made Generally Available.
24-
These features are being refined and are recommended for production usage.
25-
The APIs may undergo changes; however, Temporal's goal is to maintain backward compatibility.
21+
Temporal Python SDK support for Nexus is now [Generally Available](/evaluate/development-production-features/release-stages#general-availability).
2622

2723
:::
2824

docs/encyclopedia/workers/worker-versioning.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Since Independent Activities aren't part of a Workflow's version, they can run i
7474

7575
- **Current Worker Deployment Version**: The version where Workflows are routed to unless they were previously pinned on a different version. Other versions can continue polling to allow pinned Workflows to finish executing or in case you need to roll back. If no current version is specified, the default is unversioned.
7676
- **Ramping Worker Deployment Version**: The version where a configurable percentage of Workflows are routed to unless they were previously pinned on a different version. The ramp percentage can be in the range [0, 100]. Workflows that don't go to the Ramping Version will go to the Current Version. If no Ramping Version is specified, 100% of new Workflows and Auto-Upgrade Workflows will go to the Current Version.
77-
- **Target Worker Deployment Version**: The version your Workflow will move to next. This could be the Deployment's Current Version or the Ramping Version. For example, if an Auto-Upgrade Workflow was running on Version A, the Current Version is B, and there is a 5% ramp to C, there is a 95% chance that its Target Version is B and 5% that it's C.
77+
- **Target Worker Deployment Version**: The version your Workflow will upgrade to next. This could be the Deployment's Current Version or the Ramping Version. For example, if an Auto-Upgrade Workflow was running on Version A, the Current Version is B, and there is a 5% ramp to C, there is a 95% chance that its Target Version is B and 5% that it's C. Workflow ID determines whether the workflow falls into the 95% group or the 5% group.
7878

7979
## Versioning Statuses {#versioning-statuses}
8080

0 commit comments

Comments
 (0)