Skip to content

Commit 85f59af

Browse files
dandavisondrewhoskins-temporalbrianmacdonald-temporalgithub-actions[bot]
authored
Update Update-With-Start docs for GA (#3705)
* Update UwS docs to reflect GA * Pricing updates * PHP supports side effects * Tweak availability wording * Correct signal-with-start docs per Stephan * Remove Generally Available notices * Rebase on #3640 * CI: Automatic .md and .mdx formatting --------- Co-authored-by: Drew Hoskins <drew.hoskins@temporal.io> Co-authored-by: Brian MacDonald <brian.macdonald@temporal.io> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent da31f54 commit 85f59af

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

docs/encyclopedia/workflow-message-passing/sending-messages.mdx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,13 @@ For open source server users, Temporal Server version [Temporal Server version 1
130130

131131
:::
132132

133-
Update-With-Start sends an Update that checks whether an already-running Workflow with that ID exists.
134-
If it does, the Update is processed normally.
135-
If not, it starts a new Workflow Execution with the supplied ID, and immediately processes the Update.
133+
Update-with-Start sends an Update request, starting a Workflow if necessary.
134+
A [`WorkflowIDConflictPolicy`](https://docs.temporal.io/workflow-execution/workflowid-runid#workflow-id-conflict-policy) must be specified.
135+
Workflow ID and Update ID can be used as idempotency keys as follows:
136+
137+
- If the Workflow exists and you provided an Update ID, and the Update exists in the latest Workflow Run, then Update-With-Start attaches to the existing Update (regardless of `WorkflowIDConflictPolicy`)
138+
- If the Workflow is closed, it attaches only if the Update has completed.
139+
- Otherwise it uses [`WorkflowIDConflictPolicy`](https://docs.temporal.io/workflow-execution/workflowid-runid#workflow-id-conflict-policy) and [`WorkflowIDReusePolicy`](https://docs.temporal.io/workflow-execution/workflowid-runid#workflow-id-reuse-policy) as usual to determine whether to start a Workflow, and then starts a new Update immediately.
136140

137141
Update-With-Start is great for latency-sensitive use cases:
138142

@@ -142,10 +146,12 @@ Update-With-Start is great for latency-sensitive use cases:
142146
Updates let you add and remove items from the cart.
143147
Update-With-Start lets the customer start shopping, whether the cart already exists or they've just started shopping.
144148
It ensures the cart, modeled by a Workflow Execution, exists before applying any Update that changes the state of items within the cart.
149+
Set your `WorkflowIDConflictPolicy` to `USE_EXISTING` for this pattern.
145150
- **Early Return** -
146151
Using Update-With-Start you can begin a new Workflow Execution and synchronously receive a response, while the Workflow Execution continues to run to completion.
147152
For example, you might model a payment process using Update-With-Start.
148153
This allows you to send the payment validation results back to the client synchronously, while the transaction Workflow continues in the background.
154+
Set your `WorkflowIDConflictPolicy` to `FAIL` and use a unique Update ID for this pattern if you want to assert it does not reuse an existing Workflow.
149155

150156
:::caution
151157

0 commit comments

Comments
 (0)