You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md
+277-1Lines changed: 277 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,286 @@ weight: 6000
6
6
description: Manage and run workflows
7
7
---
8
8
9
-
Now that you've [authored the workflow and its activities in your application]({{% ref howto-author-workflow.md %}}), you can start, terminate, and get information about the workflow using HTTP API calls. For more information, read the [workflow API reference]({{% ref workflow_api.md %}}).
9
+
Now that you've [authored the workflow and its activities in your application]({{% ref howto-author-workflow.md %}}), you can start, terminate, and get information about the workflow using the CLI or API calls. For more information, read the [workflow API reference]({{% ref workflow_api.md %}}).
10
10
11
11
{{< tabpane text=true >}}
12
12
13
+
<!--CLI-->
14
+
{{% tab "CLI" %}}
15
+
16
+
## Managing Workflows with the Dapr CLI
17
+
18
+
The Dapr CLI provides powerful commands for managing workflow instances in both self-hosted and Kubernetes environments.
19
+
20
+
### Prerequisites
21
+
22
+
- Dapr CLI version 1.16.2 or later
23
+
- A running Dapr application with workflows configured
24
+
- For database operations: network access to your actor state store
25
+
26
+
### Basic Workflow Operations
27
+
28
+
#### Start a Workflow
29
+
30
+
```bash
31
+
# Start a workflow with input data
32
+
dapr workflow run OrderProcessingWorkflow \
33
+
--app-id orderprocessing \
34
+
--input '{"orderId": "12345", "amount": 100.50}'
35
+
36
+
# Start with a specific instance ID
37
+
dapr workflow run OrderProcessingWorkflow \
38
+
--app-id orderprocessing \
39
+
--instance-id order-12345 \
40
+
--input '{"orderId": "12345"}'
41
+
42
+
# Schedule a workflow to start later
43
+
dapr workflow run OrderProcessingWorkflow \
44
+
--app-id orderprocessing \
45
+
--start-time "2024-12-25T10:00:00Z"
46
+
```
47
+
48
+
#### List Workflow Instances
49
+
50
+
```bash
51
+
# List all workflows for an app
52
+
dapr workflow list --app-id orderprocessing
53
+
54
+
# Filter by status
55
+
dapr workflow list --app-id orderprocessing --filter-status RUNNING
56
+
57
+
# Filter by workflow name
58
+
dapr workflow list --app-id orderprocessing --filter-name OrderProcessingWorkflow
59
+
60
+
# Filter by age (workflows started in last 24 hours)
61
+
dapr workflow list --app-id orderprocessing --filter-max-age 24h
62
+
63
+
# Get detailed output
64
+
dapr workflow list --app-id orderprocessing --output wide
65
+
```
66
+
67
+
#### View Workflow History
68
+
69
+
```bash
70
+
# Get execution history
71
+
dapr workflow history order-12345 --app-id orderprocessing
72
+
73
+
# Get history in JSON format
74
+
dapr workflow history order-12345 --app-id orderprocessing --output json
0 commit comments