Skip to content

Commit 167970b

Browse files
committed
Workflow/CLI/Reminder Documentation
Workflow: - Adds docs on retention policy - Move concurrency docs to a new page. - Clear up refs to actor state store CLI: - Update docs to remove need for --connection-string - Adds note about purge `--force`. Reminder: - Adds reference to overwrite & failure policy Signed-off-by: joshvanl <me@joshvanl.dev>
1 parent f3c0a7d commit 167970b

File tree

13 files changed

+239
-582
lines changed

13 files changed

+239
-582
lines changed

daprdocs/content/en/concepts/building-blocks-concept.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ Dapr provides the following building blocks:
3131
| [**Distributed lock**]({{% ref "distributed-lock-api-overview" %}}) | `/v1.0-alpha1/lock` | The distributed lock API enables you to take a lock on a resource so that multiple instances of an application can access the resource without conflicts and provide consistency guarantees.
3232
| [**Cryptography**]({{% ref "cryptography-overview" %}}) | `/v1.0-alpha1/crypto` | The Cryptography API enables you to perform cryptographic operations, such as encrypting and decrypting messages, without exposing keys to your application.
3333
| [**Jobs**]({{% ref "jobs-overview" %}}) | `/v1.0-alpha1/jobs` | The Jobs API enables you to schedule and orchestrate jobs. Example scenarios include: <ul><li>Schedule batch processing jobs to run every business day</li><li>Schedule various maintenance scripts to perform clean-ups</li><li>Schedule ETL jobs to run at specific times (hourly, daily) to fetch new data, process it, and update the data warehouse with the latest information.</li></ul>
34-
| [**Conversation**]({{% ref "conversation-overview" %}}) | `/v1.0-alpha2/conversation` | The Conversation API enables you to supply prompts to converse with different large language models (LLMs) and includes features such as prompt caching and personally identifiable information (PII) obfuscation.
34+
| [**Conversation**]({{% ref "conversation-overview" %}}) | `/v1.0-alpha2/conversation` | The Conversation API enables you to supply prompts to converse with different large language models (LLMs) and includes features such as prompt caching and personally identifiable information (PII) obfuscation.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ aliases:
88
- "/developing-applications/building-blocks/actors/actors-background"
99
---
1010

11-
Now that you've learned about the [actor building block]({{% ref "actors-overview" %}}) at a high level, let's deep dive into the features and concepts included with actors in Dapr.
11+
Now that you've learned about the [actor building block]({{% ref "actors-overview" %}}) at a high level, let's deep dive into the features and concepts included with actors in Dapr.
1212

1313
## Actor lifetime
1414

@@ -28,7 +28,7 @@ An actor is automatically activated (causing an actor object to be constructed)
2828

2929
To provide scalability and reliability, actors instances are distributed throughout the cluster and Dapr automatically migrates them from failed nodes to healthy ones as required.
3030

31-
Actors are distributed across the instances of the actor service, and those instance are distributed across the nodes in a cluster. Each service instance contains a set of actors for a given actor type.
31+
Actors are distributed across the instances of the actor service, and those instances are distributed across the nodes in a cluster. Each service instance contains a set of actors for a given actor type.
3232

3333
### Actor placement service
3434

daprdocs/content/en/developing-applications/building-blocks/actors/actors-timers-reminders.md

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ The functionality of timers and reminders is very similar. The main difference i
1414

1515
This distinction allows users to trade off between light-weight but stateless timers vs. more resource-demanding but stateful reminders.
1616

17-
The scheduling configuration of timers and reminders is identical, as summarized below:
17+
The scheduling configuration of timers and reminders is summarized below:
18+
19+
---
20+
`data` is an optional parameter that contains the data passed to the reminder callback method when invoked
1821

1922
---
2023
`dueTime` is an optional parameter that sets time at which or time interval before the callback is invoked for the first time. If `dueTime` is omitted, the callback is invoked immediately after timer/reminder registration.
@@ -32,7 +35,6 @@ Supported formats:
3235
- time.Duration format (Sub-second precision is supported when using duration values), e.g. `2h30m`, `500ms`
3336
- [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations) format, e.g. `PT2H30M`, `R5/PT1M30S`
3437

35-
Note: Actual trigger resolution may vary by runtime and environment.
3638
---
3739
`ttl` is an optional parameter that sets time at which or time interval after which the timer/reminder will be expired and deleted. If `ttl` is omitted, no restrictions are applied.
3840

@@ -42,13 +44,34 @@ Supported formats:
4244
* [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations) format. Example: `PT2H30M`
4345

4446
---
47+
Only available on **reminders**.
48+
49+
`overwrite` is an optional boolean parameter that indicates whether to overwrite an existing reminder with the same name.
50+
If `overwrite` is set to `true`, any existing reminder with the same name will be replaced by the new configuration.
51+
If `overwrite` is set to `false` or omitted, and a reminder with the same name already exists, the operation will fail with a already exists error.
52+
Note that overwriting an existing reminder will reset its an error.state, including the number of invocations and the next trigger time, just like creating a new reminder.
53+
54+
---
55+
Only available on **reminders**.
56+
57+
`failurePolicy` is an optional parameter that defines the behavior when a reminder invocation fails.
58+
The supported failure policies are:
59+
- `drop`: The failed invocation is dropped, and the reminder continues with the next scheduled invocation, as if the failure did not occur.
60+
- `constant`: The reminder will retry the failed invocation a specified number of times with a fixed interval between each attempt.
61+
* `interval`: The time interval between each retry attempt. If not specified, the interval becomes "0s", meaning retries is attempted immediately.
62+
* `maxRetries`: The maximum number of retry attempts. If not specified, the invocation will be retried indefinitely at the specified interval until it succeeds.
63+
64+
If no failure policy is specified, the default failure policy of 3 retries with an interval of 1 second will be applied.
65+
66+
---
67+
4568
The actor runtime validates correctness of the scheduling configuration and returns error on invalid input.
4669

47-
When you specify both the number of repetitions in `period` as well as `ttl`, the timer/reminder will be stopped when either condition is met.
70+
When you specify both the number of repetitions in `period` as well as `ttl`, the timer/reminder will be stopped when either condition is met, whichever occurs first.
4871

4972
## Actor timers
5073

51-
You can register a callback on actor to be executed based on a timer.
74+
You can register a callback on the actor to be executed based on a timer.
5275

5376
The Dapr actor runtime ensures that the callback methods respect the turn-based concurrency guarantees. This means that no other actor methods or timer/reminder callbacks will be in progress until this callback completes execution.
5477

@@ -108,15 +131,15 @@ Refer [api spec]({{% ref "actors_api#invoke-timer" %}}) for more details.
108131

109132
## Actor reminders
110133

111-
Reminders are a mechanism to trigger *persistent* callbacks on an actor at specified times. Their functionality is similar to timers. But unlike timers, reminders are triggered under all circumstances until the actor explicitly unregisters them or the actor is explicitly deleted or the number in invocations is exhausted. Specifically, reminders are triggered across actor deactivations and failovers because the Dapr actor runtime persists the information about the actors' reminders using Dapr actor state provider.
134+
Reminders are a mechanism to trigger *persistent* callbacks on an actor at specified times. Their functionality is similar to timers. But unlike timers, reminders are triggered under all circumstances until the actor explicitly unregisters them or the number in invocations is exhausted. Specifically, reminders are triggered across actor deactivations and failovers because the Dapr actor runtime persists the information about the actors' reminders using the Dapr [Scheduler service]({{% ref scheduler.md %}}).
112135

113136
You can create a persistent reminder for an actor by calling the HTTP/gRPC request to Dapr as shown below, or via Dapr SDK.
114137

115138
```md
116139
POST/PUT http://localhost:3500/v1.0/actors/<actorType>/<actorId>/reminders/<name>
117140
```
118141

119-
The request structure for reminders is identical to those of actors. Please refer to the [actor timers examples]({{% ref "#actor-timers" %}}).
142+
Unlike timers, reminders support an `overwrite` option that allows you to replace an existing reminder with the same name, as well as a `failurePolicy` option that defines the behavior when a reminder invocation fails.
120143

121144
### Retrieve actor reminder
122145

@@ -134,20 +157,18 @@ You can remove the actor reminder by calling
134157
DELETE http://localhost:3500/v1.0/actors/<actorType>/<actorId>/reminders/<name>
135158
```
136159

137-
If an actor reminder is triggered and the app does not return a 2** code to the runtime (for example, because of a connection issue),
138-
actor reminders will be retried up to three times with a backoff interval of one second between each attempt. There may be
139-
additional retries attempted in accordance with any optionally applied [actor resiliency policy]({{% ref "override-default-retries" %}}).
160+
If an actor reminder is triggered and the app does not return a 2** code to the runtime (for example, because of a connection issue), actor reminders will be retried according to its failure policy, which by default is three times with a backoff interval of one second between each attempt.
161+
There may be additional retries attempted in accordance with any optionally applied [actor resiliency policy]({{% ref "override-default-retries" %}}).
140162

141163
Refer [api spec]({{% ref "actors_api#invoke-reminder" %}}) for more details.
142164

143165
## Error handling
144166

145-
When an actor's method completes successfully, the runtime will continue to invoke the method at the specified timer or reminder schedule. However, if the method throws an exception, the runtime catches it and logs the error message in the Dapr sidecar logs, without retrying.
146-
147-
To allow actors to recover from failures and retry after a crash or restart, you can persist an actor's state by configuring a state store, like Redis or Azure Cosmos DB.
167+
When an actor's method completes successfully, the runtime will continue to invoke the method at the specified timer or reminder schedule.
168+
To allow actors to recover from failures and retry after a crash or restart, you can persist an actor's state by configuring a state store, like Redis or Azure Cosmos DB.
148169

149170
If an invocation of the method fails, the timer is not removed. Timers are only removed when:
150-
- The sidecar crashes
171+
- The sidecar terminates
151172
- The executions run out
152173
- You delete it explicitly
153174

@@ -191,6 +212,19 @@ Delete all reminders for a specific actor instance:
191212
dapr scheduler delete-all actor/MyActorType/actorid1
192213
```
193214

215+
Delete all reminders for a specific actor type:
216+
217+
```bash
218+
dapr scheduler delete-all actor/MyActorType
219+
```
220+
221+
Delete all reminders
222+
223+
```bash
224+
dapr scheduler delete-all actor
225+
```
226+
227+
194228
#### Backup and restore reminders
195229

196230
Export all reminders:

daprdocs/content/en/developing-applications/building-blocks/actors/howto-actors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Alternatively, you can use [Dapr SDKs to use actors]({{% ref "developing-applica
2828

2929
You can interact with Dapr via HTTP/gRPC endpoints to save state reliably using the Dapr actor state management capabaility.
3030

31-
To use actors, your state store must support multi-item transactions. This means your state store component must implement the `TransactionalStore` interface.
31+
To use actors, your state store must support multi-item transactions. This means your state store component must implement the `TransactionalStore` interface.
3232

3333
[See the list of components that support transactions/actors]({{% ref supported-state-stores %}}). Only a single state store component can be used as the state store for all actors.
3434

@@ -40,4 +40,4 @@ To use actors, your state store must support multi-item transactions. This means
4040

4141
- Refer to the [Dapr SDK documentation and examples]({{% ref "developing-applications/sdks/_index.md#sdk-languages" %}}).
4242
- [Actors API reference]({{% ref actors_api %}})
43-
- [Actors overview]({{% ref actors-overview %}})
43+
- [Actors overview]({{% ref actors-overview %}})

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,12 +1173,12 @@ dapr workflow run hello_world_wf --app-id workflow-app --input 'hello world' --i
11731173

11741174
#### Check the workflow status
11751175
```bash
1176-
dapr workflow list --app-id workflow-app --connection-string=redis://127.0.0.1:6379 -o wide
1176+
dapr workflow list --app-id workflow-app -o wide
11771177
```
11781178

11791179
#### Check completed workflows
11801180
```bash
1181-
dapr workflow list --app-id workflow-app --connection-string=redis://127.0.0.1:6379 --filter-status COMPLETED -o wide
1181+
dapr workflow list --app-id workflow-app --filter-status COMPLETED -o wide
11821182
```
11831183

11841184
#### View workflow history
@@ -1208,7 +1208,7 @@ dapr workflow run sequence --app-id workflow-app --input 'hello world' --instanc
12081208

12091209
#### Check the workflow status
12101210
```bash
1211-
dapr workflow list --app-id workflow-app --connection-string=redis://127.0.0.1:6379 -o wide
1211+
dapr workflow list --app-id workflow-app -o wide
12121212
```
12131213

12141214
#### Raise the waiting external event
@@ -1218,7 +1218,7 @@ dapr workflow raise-event --app-id workflow-app test-run/businessEvent
12181218

12191219
#### Check completed workflows
12201220
```bash
1221-
dapr workflow list --app-id workflow-app --connection-string=redis://127.0.0.1:6379 --filter-status COMPLETED -o wide
1221+
dapr workflow list --app-id workflow-app --filter-status COMPLETED -o wide
12221222
```
12231223

12241224
#### View workflow history
@@ -1248,7 +1248,7 @@ dapr workflow run OrderProcessingWorkflow --app-id workflow-app --instance-id t
12481248

12491249
#### Check the workflow status
12501250
```bash
1251-
dapr workflow list --app-id workflow-app --connection-string=redis://127.0.0.1:6379 -o wide
1251+
dapr workflow list --app-id workflow-app -o wide
12521252
```
12531253

12541254
#### Raise the waiting external event
@@ -1258,7 +1258,7 @@ dapr workflow raise-event --app-id workflow-app test-run/incoming-purchase-order
12581258

12591259
#### Check completed workflows
12601260
```bash
1261-
dapr workflow list --app-id workflow-app --connection-string=redis://127.0.0.1:6379 --filter-status COMPLETED -o wide
1261+
dapr workflow list --app-id workflow-app --filter-status COMPLETED -o wide
12621262
```
12631263

12641264
#### View workflow history
@@ -1289,7 +1289,7 @@ dapr workflow run DemoWorkflow --app-id workflow-app --instance-id test-run --i
12891289

12901290
#### Check the workflow status
12911291
```bash
1292-
dapr workflow list --app-id workflow-app --connection-string=redis://127.0.0.1:6379 -o wide
1292+
dapr workflow list --app-id workflow-app -o wide
12931293
```
12941294

12951295
#### Raise the waiting external event
@@ -1302,7 +1302,7 @@ dapr workflow raise-event --app-id workflow-app test-run/event3 --input 'TestEve
13021302

13031303
#### Check completed workflows
13041304
```bash
1305-
dapr workflow list --app-id workflow-app --connection-string=redis://127.0.0.1:6379 --filter-status COMPLETED -o wide
1305+
dapr workflow list --app-id workflow-app --filter-status COMPLETED -o wide
13061306
```
13071307

13081308
#### View workflow history
@@ -1332,7 +1332,7 @@ dapr workflow run BusinessWorkflow --app-id workflow-app --input '1' --instance-
13321332

13331333
#### Check the workflow status
13341334
```bash
1335-
dapr workflow list --app-id workflow-app --connection-string=redis://127.0.0.1:6379 -o wide
1335+
dapr workflow list --app-id workflow-app -o wide
13361336
```
13371337

13381338
#### Raise the waiting external event
@@ -1342,7 +1342,7 @@ dapr workflow raise-event --app-id workflow-app test-run/businessEvent
13421342

13431343
#### Check completed workflows
13441344
```bash
1345-
dapr workflow list --app-id workflow-app --connection-string=redis://127.0.0.1:6379 --filter-status COMPLETED -o wide
1345+
dapr workflow list --app-id workflow-app --filter-status COMPLETED -o wide
13461346
```
13471347

13481348
#### View workflow history

0 commit comments

Comments
 (0)