Repository navigation
Conversation
The Go, Python, and Java tabs now come from tested samples in documentation-sdk-code-examples (design-patterns/saga in each sandbox), alongside the TypeScript tab that already did. The samples run compensations after cancellation and keep going when one fails, so the prose that compares the SDKs and the cancellation best practice now describe that. The inline Go sample, which had no Activity options and couldn't run, is gone.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Snipsync coverageSDK code lines in
All sectionsAll languages: 53.9% (27,545 of 51,075 lines).
Compared with |
📖 Docs PR preview links
|
There was a problem hiding this comment.
🟡 Changes recommended
The Solution section still says to register compensations after each step completes, contradicting the new before-execution rule and potentially leaving partial side effects uncompensated.
1 open issue
What changed in this PR
Updates the Saga pattern documentation to use Snipsync-managed samples across all four SDK tabs.
Changes:
- Replaces inline Go, Python, and Java examples with synced samples and refreshes TypeScript.
- Updates guidance on compensation ordering, failure handling, and cancellation.
| File | Description |
|---|---|
docs/design-patterns/saga-pattern.mdx |
Syncs SDK examples and revises compensation guidance. |
Review effort: Balanced
|
|
||
| The following examples show how each SDK implements the Saga pattern. | ||
| Each language uses a different mechanism to register and execute compensations, but the core principle is the same: register a compensation before or after each step, and run all compensations in reverse order on failure. | ||
| Each language uses a different mechanism to register and execute compensations, but the core principle is the same: register a compensation before each step, and run all compensations in reverse order on failure. |

What changed
The Saga pattern page's Go, Python, and Java tabs now come from tested samples in documentation-sdk-code-examples, like the TypeScript tab already did. The TypeScript snippet is resynced too.
workflow.NewDisconnectedContext(Go), catchingasyncio.CancelledError(Python),Workflow.newDetachedCancellationScopewithSaga.Options.setContinueWithError(true)(Java), andCancellationScope.nonCancellable(TypeScript).Design-patterns Snipsync coverage goes from 26 to 161 lines.
Blocked on
temporalio/documentation-sdk-code-examples#320, which adds the samples, unit tests, runner manifests, and CI jobs. This PR stays a draft until that merges. The snippets were synced from that PR's branch, with source links rewritten to
blob/main, so they resolve once it merges.Checks
yarn buildpasses.vale --config .vale-ci.iniis clean on the changed file.yarn check:snipsync-markerspasses.