Skip to content

Commit

Permalink
edits per Chris and Mark review
Browse files Browse the repository at this point in the history
Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
  • Loading branch information
hhunter-ms committed Feb 9, 2024
1 parent 90af197 commit b6fcabe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions daprdocs/content/en/reference/api/workflow_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<workflowComponentName>/<instanceId>/purge
```

{{% alert title="Note" color="primary" %}}
Only `COMPLETED`, `FAILED`, or `TERMINATED` workflows can be purged.
{{% /alert %}}

### URL parameters

Parameter | Description
Expand Down

0 comments on commit b6fcabe

Please sign in to comment.