Skip to content

Commit d739808

Browse files
committed
add reset-with-move to docs, correct update-options version input
1 parent 16a8999 commit d739808

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

docs/production-deployment/worker-deployments/worker-versioning.mdx

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,22 +350,42 @@ If you need to move a pinned Workflow to a new version, use `temporal workflow u
350350

351351
```bash
352352
temporal workflow update-options \
353-
--workflow-id="MyWorkflowId" \
354-
--versioning-override-behavior=pinned \
355-
--versioning-override-pinned-version="$MY_DEPLOYMENT_VERSION"
353+
--workflow-id "$WORKFLOW_ID" \
354+
--versioning-override-behavior pinned \
355+
--versioning-override-deployment-name "$TARGET_DEPLOYMENT" \
356+
--versioning-override-build-id "$TARGET_BUILD_ID"
356357
```
357358

358359
You can move several Workflows at once matching a `--query` parameter:
359360

360361
```bash
361362
temporal workflow update-options \
362-
--query="TemporalWorkerDeploymentVersion=$MY_BAD_DEPLOYMENT_VERSION" \
363-
--versioning-override-behavior=pinned \
364-
--versioning-override-pinned-version="$MY_PATCH_DEPLOYMENT_VERSION"
363+
--query="TemporalWorkerDeploymentVersion=$TARGET_DEPLOYMENT:$BAD_BUILD_ID" \
364+
--versioning-override-behavior pinned \
365+
--versioning-override-deployment-name "$TARGET_DEPLOYMENT" \
366+
--versioning-override-build-id "$FIXED_BUILD_ID"
365367
```
366368

367369
In this scenario, you may also need to use the other [Versioning APIs](/workflow-definition#workflow-versioning) to patch your Workflow.
368370

371+
If the target Worker version that you want to move stuck Workflows to does not have the code paths necessary to reproduce the
372+
Events in the History of your stuck Workflows, you could use patching as mentioned above, or you could do a Workflow Reset.
373+
Only Reset your Workflow if you can tolerate losing progress and re-triggering Actions, among the other usual consequences of
374+
Workflow Reset. However, if your Workflow was broken and/or did not make much progress, Reset can be a very helpful tool!
375+
376+
"Reset-with-Move" allows you to atomically Reset your Workflow and set a Versioning Override on the newly reset workflow execution,
377+
so when it resumes execution, all new workflow tasks will be executed on your new Worker.
378+
379+
```bash
380+
temporal workflow reset with-workflow-update-options \
381+
--workflow-id "$WORKFLOW_ID" \
382+
--event-id "$EVENT_ID" \
383+
--reason "$REASON" \
384+
--versioning-override-behavior pinned \
385+
--versioning-override-deployment-name "$TARGET_DEPLOYMENT" \
386+
--versioning-override-build-id "$TARGET_BUILD_ID"
387+
```
388+
369389
## Sunsetting an old Deployment Version
370390

371391
A Worker Deployment Version moves through the following states:

0 commit comments

Comments
 (0)