Skip to content

Commit 42c2b50

Browse files
authored
Merge pull request #4020 from hhunter-ms/issue_4003
[Workflow] Add more documentation around purging
2 parents f62bef5 + 32662ae commit 42c2b50

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ Different state store implementations may implicitly put restrictions on the typ
145145

146146
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.
147147

148+
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.
149+
148150
## Workflow scalability
149151

150152
Because Dapr Workflows are internally implemented using actors, Dapr Workflows have the same scalability characteristics as actors. The placement service:

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

+8
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ You can use the following two techniques to write workflows that may need to sch
6363

6464
1. **Use the _continue-as-new_ API**:
6565
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.
66+
67+
> The _continue-as-new_ API truncates the existing history, replacing it with a new history.
6668
6769
1. **Use child workflows**:
6870
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,6 +151,12 @@ Workflows can also wait for multiple external event signals of the same name, in
149151

150152
Learn more about [external system interaction.]({{< ref "workflow-patterns.md#external-system-interaction" >}})
151153

154+
## Purging
155+
156+
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.
157+
158+
Learn more in [the workflow API reference guide]({{< ref workflow_api.md >}}).
159+
152160
## Limitations
153161

154162
### Workflow determinism and code restraints

daprdocs/content/en/reference/api/workflow_api.md

+4
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ Purge the workflow state from your state store with the workflow's instance ID.
174174
POST http://localhost:3500/v1.0-beta1/workflows/<workflowComponentName>/<instanceId>/purge
175175
```
176176

177+
{{% alert title="Note" color="primary" %}}
178+
Only `COMPLETED`, `FAILED`, or `TERMINATED` workflows can be purged.
179+
{{% /alert %}}
180+
177181
### URL parameters
178182

179183
Parameter | Description

0 commit comments

Comments
 (0)