Skip to content

Commit c07c0bf

Browse files
committed
Added comments from PR review
Signed-off-by: Albert Callarisa <albert@diagrid.io>
1 parent a8747fd commit c07c0bf

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ Learn more in [the workflow API reference guide]({{% ref workflow_api.md %}}).
213213

214214
Workflows can run for very long periods of time, and during that time we want to still be able to introduce changes to the workflow code. When the changes are non-deterministic, we need to use a versioning scheme to version the workflow code so existing workflows can continue running in the old version of the code while new workflows run in the new version of the code.
215215

216-
Workflows can be versioned in two different ways, each of them with their own advantages and disadvantages. These are:
216+
Workflows can be versioned in two different ways, each of them with their own advantages. These are:
217217
- [Full workflow versioning](#full-workflow-versioning)
218218
- [Patching](#patching)
219219

@@ -242,15 +242,19 @@ The different SDKs will expose a way to register multiple handlers for the same
242242

243243
```go
244244
registry := task.NewTaskRegistry()
245+
// This is the previous workflow version, so `isLatest` is false
245246
registry.AddVersionedOrchestrator("ProcessOrders", false, OrderProcessingWorkflow)
247+
// This is the latest workflow version, so `isLatest` is true
246248
registry.AddVersionedOrchestrator("ProcessOrders", true, OrderProcessingWorkflowV2)
247249

250+
// This is the previous workflow version, so `isLatest` is false
248251
registry.AddVersionedOrchestratorN("ProcessPayments", "v1", false, ProcessPaymentsWorkflow)
252+
// This is the latest workflow version, so `isLatest` is true
249253
registry.AddVersionedOrchestratorN("ProcessPayments", "v2", true, ProcessPaymentsWorkflowV2)
250254

251255
```
252256

253-
**Note**: The boolean argument to `AddVersionedOrchestrator` indicates whether the workflow the latest version.
257+
**Note**: The boolean argument to `AddVersionedOrchestratorN` indicates whether the workflow is the latest version.
254258

255259
{{% /tab %}}
256260

@@ -264,7 +268,7 @@ When the SDK receives a request to run a workflow in a version that is not regis
264268

265269
### Patching
266270

267-
This is a narrower way of versioning workflows, as it allows introducing non-deterministic changes to the workflow code without duplicating the whole workflow code.
271+
This versioning approach allows you to introduce deterministic changes to a specific part of an existing workflow, rather than creating an entirely new version of the whole workflow. The patching mechanism ensures these targeted changes remain deterministic, whereas without this approach, making such modifications within the workflow code would result in non-determinism. This is especially useful when you want to update or improve just one section of a workflow without duplicating all of its logic.
268272

269273

270274
{{< tabpane text=true >}}
@@ -298,7 +302,7 @@ The list of patches that are applied to a workflow are stored in the workflow's
298302

299303
There are multiple reasons for workflows to get stalled when using this versioning scheme:
300304
- Removing (or renaming) a patch check.
301-
- Changing the order of patch checks. It's important to keep the same order of checks throughout the workflow code.
305+
- Changing the order of patch checks. It's required to keep the same order of checks throughout the workflow code.
302306

303307

304308
## Limitations

0 commit comments

Comments
 (0)