diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md index ca3777064b9..f9e7533e2a0 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md @@ -1179,6 +1179,46 @@ Because of how replay-based workflows execute, you'll write logic that does thin {{% /alert %}} +## Testing Your Workflow + +After authoring your workflow, test it using the Dapr CLI: + +### Start Your Workflow + +```bash +dapr workflow run OrderProcessingWorkflow \ + --app-id orderservice \ + --input '{"orderId": "test-001", "items": [{"sku": "WIDGET", "quantity": 5}]}' +``` + +### Monitor Workflow Execution + +```bash +dapr workflow list --app-id orderservice --filter-status RUNNING +``` + +### Test External Events + +```bash +# Raise an event your workflow is waiting for +dapr workflow raise-event /ApprovalReceived \ + --app-id orderservice \ + --input '{"approved": true, "approver": "manager@company.com"}' +``` + +### Debug Failed Workflows + +```bash +# List failed workflows +dapr workflow list --app-id orderservice --filter-status FAILED --output wide + +# Get detailed history of a failed workflow +dapr workflow history --app-id orderservice --output json + +# Re-run the workflow after fixing issues +dapr workflow rerun --app-id orderservice +``` + ## Next steps Now that you've authored a workflow, learn how to manage it. diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md index de4f6b23249..99416238948 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md @@ -6,10 +6,288 @@ weight: 6000 description: Manage and run workflows --- -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 %}}). +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 %}}). {{< tabpane text=true >}} + +{{% tab "CLI" %}} + +## Managing Workflows with the Dapr CLI + +The Dapr CLI provides powerful commands for managing workflow instances in both self-hosted and Kubernetes environments. + +### Prerequisites + +- Dapr CLI version 1.16.2 or later +- A running Dapr application with workflows configured +- For database operations: network access to your actor state store + +### Basic Workflow Operations + +#### Start a Workflow + +```bash +# Start a workflow with input data +dapr workflow run OrderProcessingWorkflow \ + --app-id orderprocessing \ + --input '{"orderId": "12345", "amount": 100.50}' + +# Start with a specific instance ID +dapr workflow run OrderProcessingWorkflow \ + --app-id orderprocessing \ + --instance-id order-12345 \ + --input '{"orderId": "12345"}' + +# Schedule a workflow to start later +dapr workflow run OrderProcessingWorkflow \ + --app-id orderprocessing \ + --start-time "2024-12-25T10:00:00Z" +``` + +#### List Workflow Instances + +```bash +# List all workflows for an app +dapr workflow list --app-id orderprocessing + +# Filter by status +dapr workflow list --app-id orderprocessing --filter-status RUNNING + +# Filter by workflow name +dapr workflow list --app-id orderprocessing --filter-name OrderProcessingWorkflow + +# Filter by age (workflows started in last 24 hours) +dapr workflow list --app-id orderprocessing --filter-max-age 24h + +# Get detailed output +dapr workflow list --app-id orderprocessing --output wide +``` + +#### View Workflow History + +```bash +# Get execution history +dapr workflow history order-12345 --app-id orderprocessing + +# Get history in JSON format +dapr workflow history order-12345 --app-id orderprocessing --output json +``` + +#### Control Workflow Execution + +```bash +# Suspend a running workflow +dapr workflow suspend order-12345 \ + --app-id orderprocessing \ + --reason "Waiting for manual approval" + +# Resume a suspended workflow +dapr workflow resume order-12345 \ + --app-id orderprocessing \ + --reason "Approved by manager" + +# Terminate a workflow +dapr workflow terminate order-12345 \ + --app-id orderprocessing \ + --output '{"reason": "Cancelled by customer"}' +``` + +#### Raise External Events + +```bash +# Raise an event for a waiting workflow +dapr workflow raise-event order-12345/PaymentReceived \ + --app-id orderprocessing \ + --input '{"paymentId": "pay-67890", "amount": 100.50}' +``` + +#### Re-run Workflows + +```bash +# Re-run from the beginning +dapr workflow rerun order-12345 --app-id orderprocessing + +# Re-run from a specific event +dapr workflow rerun order-12345 \ + --app-id orderprocessing \ + --event-id 5 + +# Re-run with a new instance ID +dapr workflow rerun order-12345 \ + --app-id orderprocessing \ + --new-instance-id order-12345-retry +``` + +#### Purge Completed Workflows + +Note that purging a workflow from the CLI will also delete all associated Scheduler reminders. + +```bash +# Purge a specific instance +dapr workflow purge order-12345 --app-id orderprocessing + +# Purge all completed workflows older than 30 days +dapr workflow purge --app-id orderprocessing --all-older-than 720h + +# Purge all terminal workflows (use with caution!) +dapr workflow purge --app-id orderprocessing --all +``` + +### Kubernetes Operations + +All commands support the `-k` flag for Kubernetes deployments: + +```bash +# List workflows in Kubernetes +dapr workflow list \ + --kubernetes \ + --namespace production \ + --app-id orderprocessing + +# Suspend a workflow in Kubernetes +dapr workflow suspend order-12345 \ + --kubernetes \ + --namespace production \ + --app-id orderprocessing \ + --reason "Maintenance window" +``` + +### Advanced: Direct Database Access + +For advanced operations like listing and purging workflows, you can connect directly to the actor state store database. This is useful for: + +- Querying workflows across multiple app instances +- Bulk operations on workflow metadata +- Custom filtering beyond what the API provides + +#### Self-Hosted Mode + +In self-hosted mode, the CLI can automatically discover your state store configuration: + +```bash +# The CLI reads your component configuration automatically +dapr workflow list --app-id orderprocessing +``` + +To override with a specific connection string: + +```bash +# PostgreSQL +dapr workflow list \ + --app-id orderprocessing \ + --connection-string "host=localhost user=dapr password=dapr dbname=dapr port=5432 sslmode=disable" \ + --table-name workflows + +# MySQL +dapr workflow list \ + --app-id orderprocessing \ + --connection-string "dapr:dapr@tcp(localhost:3306)/dapr?parseTime=true" \ + --table-name workflows + +# SQL Server +dapr workflow list \ + --app-id orderprocessing \ + --connection-string "sqlserver://dapr:Pass@word1@localhost:1433?database=dapr" \ + --table-name workflows +``` + +#### Kubernetes Mode with Port Forwarding + +In Kubernetes, you need to establish connectivity to your database: + +**Step 1: Port forward to your database service** + +```bash +# PostgreSQL +kubectl port-forward service/postgres 5432:5432 -n production + +# MySQL +kubectl port-forward service/mysql 3306:3306 -n production + +# SQL Server +kubectl port-forward service/mssql 1433:1433 -n production +``` + +**Step 2: Use the CLI with the connection string** + +```bash +# PostgreSQL example +dapr workflow list \ + --kubernetes \ + --namespace production \ + --app-id orderprocessing \ + --connection-string "host=localhost user=dapr password=dapr dbname=dapr port=5432 sslmode=disable" \ + --table-name workflows + +# Purge old workflows +dapr workflow purge \ + --kubernetes \ + --namespace production \ + --app-id orderprocessing \ + --connection-string "host=localhost user=dapr password=dapr dbname=dapr port=5432 sslmode=disable" \ + --table-name workflows \ + --all-older-than 2160h # 90 days +``` + +**Step 3: Stop port forwarding when done** + +```bash +# Press Ctrl+C to stop the port forward +``` + +#### Connection String Formats by Database + +**PostgreSQL / CockroachDB** +``` +host=localhost user=dapr password=dapr dbname=dapr port=5432 sslmode=disable connect_timeout=10 +``` + +**MySQL** +``` +username:password@tcp(host:port)/database?parseTime=true&loc=UTC +``` + +**SQL Server** +``` +sqlserver://username:password@host:port?database=dbname&encrypt=false +``` + +**MongoDB** +``` +mongodb://username:password@localhost:27017/database +``` + +**Redis** +``` +localhost:6379,password=secret,db=0 +``` + +### Workflow Management Best Practices + +1. **Regular Cleanup**: Schedule periodic purge operations for completed workflows + ```bash + # Weekly cron job to purge workflows older than 90 days + dapr workflow purge --app-id orderprocessing --all-older-than 2160h + ``` + +2. **Monitor Running Workflows**: Use filtered lists to track long-running instances + ```bash + dapr workflow list --app-id orderprocessing --filter-status RUNNING --filter-max-age 24h + ``` + +3. **Use Instance IDs**: Assign meaningful instance IDs for easier tracking + ```bash + dapr workflow run OrderWorkflow --app-id orderprocessing --instance-id "order-$(date +%s)" + ``` + +4. **Export for Analysis**: Export workflow data for analysis + ```bash + dapr workflow list --app-id orderprocessing --output json > workflows.json + ``` + +{{% /tab %}} + {{% tab "Python" %}} 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 e5d77c2c18e..e06ba6725b5 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 @@ -189,6 +189,34 @@ This number may be larger or smaller depending on retries or concurrency. | Raise event | 3 records | | Start child workflow | 8 records | +#### Direct Database Access + +For advanced operations, you can access workflow data directly: + +```bash +# Port forward to database in Kubernetes +kubectl port-forward service/postgres 5432:5432 + +# Query workflows directly +dapr workflow list \ + --app-id myapp \ + --connection-string "host=localhost user=dapr password=dapr dbname=dapr port=5432 sslmode=disable" \ + --table-name workflows +``` + +### Supported State Stores + +The workflow engine supports these state stores: +- PostgreSQL +- MySQL +- SQL Server +- SQLite +- Oracle Database +- CockroachDB +- MongoDB +- Redis + + ## Workflow scalability Because Dapr Workflows are internally implemented using actors, Dapr Workflows have the same scalability characteristics as actors. 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 2114b1827d7..4ef76ece687 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 @@ -24,6 +24,62 @@ There are several different kinds of tasks that a workflow can schedule, includi - [Child workflows]({{% ref "workflow-features-concepts.md#child-workflows" %}}) for breaking larger workflows into smaller pieces - [External event waiters]({{% ref "workflow-features-concepts.md#external-events" %}}) for blocking workflows until they receive external event signals. These tasks are described in more details in their corresponding sections. +## Workflow Instance Management + +### Querying Workflow State + +You can query workflow instances using the CLI: + +```bash +# Find all running workflows +dapr workflow list --app-id myapp --filter-status RUNNING + +# Find workflows by name +dapr workflow list --app-id myapp --filter-name OrderProcessing + +# Find recent workflows (last 2 hours) +dapr workflow list --app-id myapp --filter-max-age 2h + +# Get detailed JSON output +dapr workflow list --app-id myapp --output json +``` + +### Workflow History + +View the complete execution history: + +```bash +dapr workflow history wf-12345 --app-id myapp --output json +``` + +This shows all events, activities, and state transitions. + +## External Events + +### Raising Events via CLI + +```bash +dapr workflow raise-event wf-12345/ApprovalReceived \ + --app-id myapp \ + --input '{"approved": true, "comments": "Approved by manager"}' +``` + +## Workflow Suspension and Resumption + +### Using the CLI + +```bash +# Suspend for manual intervention +dapr workflow suspend wf-12345 \ + --app-id myapp \ + --reason "Awaiting customer response" + +# Resume when ready +dapr workflow resume wf-12345 \ + --app-id myapp \ + --reason "Customer responded" +``` + ### Workflow identity Each workflow you define has a type name, and individual executions of a workflow require a unique _instance ID_. Workflow instance IDs can be generated by your app code, which is useful when workflows correspond to business entities like documents or jobs, or can be auto-generated UUIDs. A workflow's instance ID is useful for debugging and also for managing workflows using the [Workflow APIs]({{% ref workflow_api.md %}}). diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-overview.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-overview.md index 5c79019fafd..a35899396d4 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-overview.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-overview.md @@ -114,6 +114,42 @@ Want to put workflows to the test? Walk through the following quickstart and tut Want to skip the quickstarts? Not a problem. You can try out the workflow building block directly in your application. After [Dapr is installed]({{% ref install-dapr-cli.md %}}), you can begin using workflows, starting with [how to author a workflow]({{% ref howto-author-workflow.md %}}). +## Managing Workflows + +Dapr provides comprehensive workflow management capabilities through both the HTTP API and the CLI. + +### Workflow Lifecycle Operations + +**Start Workflows** +```bash +dapr workflow run MyWorkflow --app-id myapp --input '{"key": "value"}' +``` + +**Monitor Workflows** +```bash +# List active workflows +dapr workflow list --app-id myapp --filter-status RUNNING + +# View execution history +dapr workflow history --app-id myapp +``` + +**Control Workflows** +```bash +# Suspend, resume, or terminate +dapr workflow suspend --app-id myapp +dapr workflow resume --app-id myapp +dapr workflow terminate --app-id myapp +``` + +**Maintenance Operations** +```bash +# Purge completed workflows +dapr workflow purge --app-id myapp --all-older-than 720h +``` + +See [How-To: Manage workflows]({{< ref howto-manage-workflow.md >}}) for detailed instructions. + ## Limitations - **State stores:** You can only use state stores which support workflows, as [described here]({{% ref supported-state-stores %}}). diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-patterns.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-patterns.md index a0f0e66bbd4..8158ddfdbbc 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-patterns.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-patterns.md @@ -307,6 +307,16 @@ In addition to the challenges mentioned in [the previous pattern]({{% ref "workf Dapr Workflows provides a way to express the fan-out/fan-in pattern as a simple function, as shown in the following example: +```bash +# Start the workflow +dapr workflow run DataProcessingWorkflow \ + --app-id processor \ + --input '{"items": ["item1", "item2", "item3"]}' + +# Monitor parallel execution +dapr workflow history --app-id processor --output json +``` + {{< tabpane text=true >}} {{% tab "Python" %}} diff --git a/daprdocs/content/en/getting-started/quickstarts/workflow-quickstart.md b/daprdocs/content/en/getting-started/quickstarts/workflow-quickstart.md index 72473207839..bfa1772635b 100644 --- a/daprdocs/content/en/getting-started/quickstarts/workflow-quickstart.md +++ b/daprdocs/content/en/getting-started/quickstarts/workflow-quickstart.md @@ -2064,6 +2064,68 @@ func RequestApprovalActivity(ctx workflow.ActivityContext) (any, error) { {{< /tabpane >}} + +## Step 5: Manage Your Workflow + +Now that your workflow is running, let's learn how to manage it using the Dapr CLI. + +### View Running Workflows + +```bash +# List all workflows +dapr workflow list --app-id orderprocessing + +# You should see output like: +# INSTANCE ID WORKFLOW NAME CREATED LAST UPDATED RUNTIME STATUS +# order-20240312-001 OrderProcessingWorkflow 2024-03-12 10:00:00 2024-03-12 10:00:05 RUNNING +``` + +### Check Workflow History + +View the detailed execution history of your workflow: + +```bash +dapr workflow history order-20240312-001 --app-id orderprocessing +``` + +### Interact with Your Workflow + +#### Raise an External Event + +If your workflow is waiting for an external event: + +```bash +dapr workflow raise-event order-20240312-001/PaymentReceived \ + --app-id orderprocessing \ + --input '{"paymentId": "pay-123", "amount": 100.00}' +``` + +#### Suspend and Resume + +```bash +# Suspend a workflow +dapr workflow suspend order-20240312-001 \ + --app-id orderprocessing \ + --reason "Waiting for inventory" + +# Resume when ready +dapr workflow resume order-20240312-001 \ + --app-id orderprocessing \ + --reason "Inventory received" +``` + +### Clean Up + +After testing, purge completed workflows: + +```bash +# Purge a specific workflow +dapr workflow purge order-20240312-001 --app-id orderprocessing + +# Or purge all completed workflows +dapr workflow purge --app-id orderprocessing --all-older-than 1h +``` + ## Tell us what you think! We're continuously working to improve our Quickstart examples and value your feedback. Did you find this Quickstart helpful? Do you have suggestions for improvement? diff --git a/daprdocs/content/en/reference/cli/dapr-workflow.md b/daprdocs/content/en/reference/cli/dapr-workflow.md new file mode 100644 index 00000000000..f2190442ca1 --- /dev/null +++ b/daprdocs/content/en/reference/cli/dapr-workflow.md @@ -0,0 +1,240 @@ +--- +type: docs +title: "workflow CLI command" +linkTitle: "workflow" +description: "Detailed information on the workflow CLI command" +--- + +Manage Dapr workflow instances. + +## Commands + +| Command | Description | +|---------|-------------| +| dapr workflow run | Start a new workflow instance | +| dapr workflow list | List workflow instances | +| dapr workflow history | Get workflow execution history | +| dapr workflow purge | Purge workflow instances | +| dapr workflow suspend | Suspend a workflow | +| dapr workflow resume | Resume a workflow | +| dapr workflow terminate | Terminate a workflow | +| dapr workflow raise-event | Raise an external event | +| dapr workflow rerun | Re-run a workflow | + +## Flags + +``` + -a, --app-id string The app ID owner of the workflow instance + -h, --help help for workflow + -k, --kubernetes Target a Kubernetes dapr installation + -n, --namespace string Namespace to perform workflow operation on (default "default") +``` + +## Examples + +### List workflows +```bash +dapr workflow list --app-id myapp +``` + +### Start a workflow +```bash +dapr workflow run MyWorkflow --app-id myapp --input '{"key": "value"}' +``` + +### Kubernetes mode +```bash +dapr workflow list -k -n production --app-id myapp +``` +``` + +### dapr-workflow-list.md + +```markdown +--- +type: docs +title: "workflow list CLI command" +linkTitle: "workflow list" +description: "Detailed information on the workflow list CLI command" +--- + +List workflow instances for a given application. + +## Usage + +```bash +dapr workflow list [flags] +``` + +## Flags + +| Name | Type | Description | +|------|------|-------------| +| `--app-id`, `-a` | string | (Required) The app ID owner of the workflow instances | +| `--filter-name`, `-w` | string | Filter workflows by name | +| `--filter-status`, `-s` | string | Filter by status: RUNNING, COMPLETED, FAILED, CANCELED, TERMINATED, PENDING, SUSPENDED | +| `--filter-max-age`, `-m` | string | Filter workflows started within duration or timestamp (e.g., "300ms", "1.5h", "2023-01-02T15:04:05") | +| `--output`, `-o` | string | Output format: short, wide, yaml, json (default "short") | +| `--connection-string`, `-c` | string | Connection string to the actor state store | +| `--table-name`, `-t` | string | Table or collection name used as the actor state store | +| `--kubernetes`, `-k` | bool | Target a Kubernetes Dapr installation | +| `--namespace`, `-n` | string | Kubernetes namespace (default "default") | + +## Examples + +### Basic usage +```bash +dapr workflow list --app-id myapp +``` + +### Filter by status +```bash +dapr workflow list --app-id myapp --filter-status RUNNING +``` + +### Filter by workflow name +```bash +dapr workflow list --app-id myapp --filter-name OrderProcessing +``` + +### Filter by age +```bash +# Workflows from last 24 hours +dapr workflow list --app-id myapp --filter-max-age 24h + +# Workflows after specific date +dapr workflow list --app-id myapp --filter-max-age 2024-01-01T00:00:00Z +``` + +### JSON output +```bash +dapr workflow list --app-id myapp --output json +``` + +### Kubernetes with port forwarding +```bash +# Terminal 1: Port forward to database +kubectl port-forward service/postgres 5432:5432 -n production + +# Terminal 2: List workflows with direct database access +dapr workflow list \ + --kubernetes \ + --namespace production \ + --app-id myapp \ + --connection-string "host=localhost user=dapr password=dapr dbname=dapr port=5432 sslmode=disable" \ + --table-name workflows +``` + +## Connection String Formats + +### PostgreSQL / CockroachDB +``` +host=localhost user=dapr password=dapr dbname=dapr port=5432 sslmode=disable +``` + +### MySQL +``` +dapr:dapr@tcp(localhost:3306)/dapr?parseTime=true +``` + +### SQL Server +``` +sqlserver://dapr:Pass@word@localhost:1433?database=dapr +``` + +### MongoDB +``` +mongodb://localhost:27017/dapr +``` + +### Redis +``` +localhost:6379,password=secret,db=0 +``` +``` + +### dapr-workflow-purge.md + +```markdown +--- +type: docs +title: "workflow purge CLI command" +linkTitle: "workflow purge" +description: "Detailed information on the workflow purge CLI command" +--- + +Purge workflow instances with terminal states (COMPLETED, FAILED, TERMINATED). + +## Usage + +```bash +dapr workflow purge [instance-id] [flags] +``` + +## Flags + +| Name | Type | Description | +|------|------|-------------| +| `--app-id`, `-a` | string | (Required) The app ID owner of the workflow instances | +| `--all` | bool | Purge all terminal workflow instances (use with caution) | +| `--all-older-than` | string | Purge instances older than duration or timestamp (e.g., "24h", "2023-01-02T15:04:05Z") | +| `--connection-string`, `-c` | string | Connection string to the actor state store | +| `--table-name`, `-t` | string | Table or collection name used as the actor state store | +| `--kubernetes`, `-k` | bool | Target a Kubernetes Dapr installation | +| `--namespace`, `-n` | string | Kubernetes namespace (default "default") | + +## Examples + +### Purge a specific instance +```bash +dapr workflow purge wf-12345 --app-id myapp +``` + +### Purge instances older than 30 days +```bash +dapr workflow purge --app-id myapp --all-older-than 720h +``` + +### Purge instances older than specific date +```bash +dapr workflow purge --app-id myapp --all-older-than 2023-12-01T00:00:00Z +``` + +### Purge all terminal instances (dangerous!) +```bash +dapr workflow purge --app-id myapp --all +``` + +### Kubernetes with database access +```bash +# Port forward to database +kubectl port-forward service/postgres 5432:5432 -n production + +# Purge old workflows +dapr workflow purge \ + --kubernetes \ + --namespace production \ + --app-id myapp \ + --connection-string "host=localhost user=dapr password=dapr dbname=dapr port=5432 sslmode=disable" \ + --table-name workflows \ + --all-older-than 2160h # 90 days +``` + +## Best Practices + +1. **Regular Cleanup**: Schedule periodic purge operations + ```bash + # Cron job to purge workflows older than 90 days + 0 2 * * 0 dapr workflow purge --app-id myapp --all-older-than 2160h + ``` + +2. **Test First**: Use list command to see what will be purged + ```bash + dapr workflow list --app-id myapp --filter-status COMPLETED --filter-max-age 2160h + ``` + +3. **Backup Before Bulk Purge**: Export data before using `--all` + ```bash + dapr workflow list --app-id myapp --output json > backup.json + ``` +```