From 59d0101c6756bdcad5331bfb5740cc5de96c4823 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Tue, 6 Feb 2024 16:45:15 -0500 Subject: [PATCH 1/5] add purge to workflow docs Signed-off-by: Hannah Hunter --- .../building-blocks/workflow/workflow-architecture.md | 2 ++ .../workflow/workflow-features-concepts.md | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md index 18ec9110b30..8d9494cd31c 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md @@ -145,6 +145,8 @@ Different state store implementations may implicitly put restrictions on the typ Similarly, if a state store imposes restrictions on the size of a batch transaction, that may limit the number of parallel actions that can be scheduled by a workflow. +Workflow state can be purged from a state store, purging all its history. Purging removes all metadata related to a specific workflow instance. + ## Workflow scalability Because Dapr Workflows are internally implemented using actors, Dapr Workflows have the same scalability characteristics as actors. The placement service: diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md index ce39d4bac96..fe35284a959 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md @@ -151,6 +151,15 @@ Learn more about [external system interaction.]({{< ref "workflow-patterns.md#ex ## Limitations +### Purging + +Workflow state can be purged from a state store, purging all its history and removing all metadata related to a specific workflow instance. The purge capability is typically used for workflows that have run to a `COMPLETED` or `TERMINATED` state. + +There are other times you may choose to purge a workflow history and reuse a workflow instance with new inputs, like: + +- `CONTINUED_AS_NEW` state +- A `FAILED` workflow instance + ### Workflow determinism and code restraints To take advantage of the workflow replay technique, your workflow code needs to be deterministic. For your workflow code to be deterministic, you may need to work around some limitations. From e94babe8d78f5ef40fb33d8634906386a63066bd Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Wed, 7 Feb 2024 12:42:22 -0500 Subject: [PATCH 2/5] cross link and update daprbot doc Signed-off-by: Hannah Hunter --- CONTRIBUTING.md | 2 +- daprdocs/content/en/contributing/daprbot.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 259662622d9..35945d05d5d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ # Contributing to Dapr docs -Please see [this docs section](https://docs.dapr.io/contributing/) for general guidance on contributions to the Dapr project as well as specific guidelines on contributions to the docs repo. \ No newline at end of file +Please see [this docs section](https://docs.dapr.io/contributing/) for general guidance on contributions to the Dapr project as well as specific guidelines on contributions to the docs repo. Learn more about [Dapr bot commands and labels](https://docs.dapr.io/contributing/daprbot/) to improve your docs contributing experience. \ No newline at end of file diff --git a/daprdocs/content/en/contributing/daprbot.md b/daprdocs/content/en/contributing/daprbot.md index 64a50a664a3..14fb29373f0 100644 --- a/daprdocs/content/en/contributing/daprbot.md +++ b/daprdocs/content/en/contributing/daprbot.md @@ -12,7 +12,7 @@ Dapr bot is triggered by a list of commands that helps with common tasks in the | Command | Target | Description | Who can use | Repository | | ---------------- | --------------------- | -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------- | -| `/assign` | Issue | Assigns an issue to a user or group of users | Anyone | `dapr`, `components-contrib`, `go-sdk` | +| `/assign` | Issue | Assigns an issue to a user or group of users | Anyone | `dapr`, `docs`, `quickstarts`, `cli`, `components-contrib`, `go-sdk`, `js-sdk`, `java-sdk`, `python-sdk`, `dotnet-sdk` | | `/ok-to-test` | Pull request | `dapr`: trigger end to end tests
`components-contrib`: trigger conformance and certification tests | Users listed in the [bot](https://github.com/dapr/dapr/blob/master/.github/scripts/dapr_bot.js) | `dapr`, `components-contrib` | | `/ok-to-perf` | Pull request | Trigger performance tests. | Users listed in the [bot](https://github.com/dapr/dapr/blob/master/.github/scripts/dapr_bot.js) | `dapr` | | `/make-me-laugh` | Issue or pull request | Posts a random joke | Users listed in the [bot](https://github.com/dapr/dapr/blob/master/.github/scripts/dapr_bot.js) | `dapr`, `components-contrib` | From 90af1972f72428e2481f3494329c20224b490c5e Mon Sep 17 00:00:00 2001 From: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Date: Fri, 9 Feb 2024 11:10:15 -0500 Subject: [PATCH 3/5] Update daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md Co-authored-by: Chris Gillum Signed-off-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> --- .../building-blocks/workflow/workflow-architecture.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md index 8d9494cd31c..dffea560d0c 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md @@ -145,7 +145,7 @@ Different state store implementations may implicitly put restrictions on the typ Similarly, if a state store imposes restrictions on the size of a batch transaction, that may limit the number of parallel actions that can be scheduled by a workflow. -Workflow state can be purged from a state store, purging all its history. Purging removes all metadata related to a specific workflow instance. +Workflow state can be purged from a state store, including all its history. Each Dapr SDK exposes APIs for purging all metadata related to specific workflow instances. ## Workflow scalability From b6fcabeb0704811426a49d78b7e7c067e3b40a65 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Fri, 9 Feb 2024 11:23:43 -0500 Subject: [PATCH 4/5] edits per Chris and Mark review Signed-off-by: Hannah Hunter --- .../workflow/workflow-features-concepts.md | 13 ++++++------- daprdocs/content/en/reference/api/workflow_api.md | 4 ++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md index fe35284a959..71d146cafa6 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md @@ -63,6 +63,8 @@ You can use the following two techniques to write workflows that may need to sch 1. **Use the _continue-as-new_ API**: Each workflow SDK exposes a _continue-as-new_ API that workflows can invoke to restart themselves with a new input and history. The _continue-as-new_ API is especially ideal for implementing "eternal workflows", like monitoring agents, which would otherwise be implemented using a `while (true)`-like construct. Using _continue-as-new_ is a great way to keep the workflow history size small. + + > The _continue-as-new_ API truncates the existing history, replacing it with a new history. 1. **Use child workflows**: Each workflow SDK exposes an API for creating child workflows. A child workflow behaves like any other workflow, except that it's scheduled by a parent workflow. Child workflows have: @@ -149,16 +151,13 @@ Workflows can also wait for multiple external event signals of the same name, in Learn more about [external system interaction.]({{< ref "workflow-patterns.md#external-system-interaction" >}}) -## Limitations - -### Purging +## Purging -Workflow state can be purged from a state store, purging all its history and removing all metadata related to a specific workflow instance. The purge capability is typically used for workflows that have run to a `COMPLETED` or `TERMINATED` state. +Workflow state can be purged from a state store, purging all its history and removing all metadata related to a specific workflow instance. The purge capability is typically used for workflows that have run to a `COMPLETED`, `FAILED`, or `TERMINATED` state. -There are other times you may choose to purge a workflow history and reuse a workflow instance with new inputs, like: +Learn more in [the workflow API reference guide]({{< ref workflow_api.md >}}). -- `CONTINUED_AS_NEW` state -- A `FAILED` workflow instance +## Limitations ### Workflow determinism and code restraints diff --git a/daprdocs/content/en/reference/api/workflow_api.md b/daprdocs/content/en/reference/api/workflow_api.md index ca272d0faec..aea4234a108 100644 --- a/daprdocs/content/en/reference/api/workflow_api.md +++ b/daprdocs/content/en/reference/api/workflow_api.md @@ -174,6 +174,10 @@ Purge the workflow state from your state store with the workflow's instance ID. POST http://localhost:3500/v1.0-beta1/workflows///purge ``` +{{% alert title="Note" color="primary" %}} +Only `COMPLETED`, `FAILED`, or `TERMINATED` workflows can be purged. +{{% /alert %}} + ### URL parameters Parameter | Description From 912e3ace5ac259c4527b85f02baefcd8320dd743 Mon Sep 17 00:00:00 2001 From: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Date: Fri, 9 Feb 2024 11:51:40 -0500 Subject: [PATCH 5/5] Update daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md Co-authored-by: Mark Fussell Signed-off-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> --- .../building-blocks/workflow/workflow-features-concepts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md index 71d146cafa6..fdd06701e04 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md @@ -153,7 +153,7 @@ Learn more about [external system interaction.]({{< ref "workflow-patterns.md#ex ## Purging -Workflow state can be purged from a state store, purging all its history and removing all metadata related to a specific workflow instance. The purge capability is typically used for workflows that have run to a `COMPLETED`, `FAILED`, or `TERMINATED` state. +Workflow state can be purged from a state store, purging all its history and removing all metadata related to a specific workflow instance. The purge capability is used for workflows that have run to a `COMPLETED`, `FAILED`, or `TERMINATED` state. Learn more in [the workflow API reference guide]({{< ref workflow_api.md >}}).