Skip to main content
POST
Purge Work Orders

Purge Work Orders

Bulk deletes work orders matching specified criteria. Supports filtering by status and age, with a dry-run mode to preview deletions.
Purged work orders and their associated runs are permanently deleted. This action cannot be undone.

Request

statuses
array
Filter by work order statuses. If omitted, applies to all statuses. Valid values: queued, running, waiting_for_children, integrating, succeeded, failed, canceled
olderThanDays
number
Only delete work orders older than this many days
dryRun
boolean
default:"false"
If true, returns what would be deleted without actually deleting

Dry Run Example

Response

success
boolean
required
Indicates if the request was successful
data
object
required
Purge result

Example Responses

Actual Purge

Dry Run

No Matches

Common Purge Patterns

Clean Up Old Failures

Delete failed work orders older than 7 days:

Archive Completed Work

Delete successful work orders older than 90 days:

Clean All Terminal States

Delete all completed (success, fail, cancel) work orders older than 30 days:

Preview Before Delete

Always use dry run first to verify:

What Gets Deleted

When a work order is purged:
  • The work order record
  • All associated runs
  • All run audit records
  • All iteration snapshots
Logs stored externally (e.g., in a log aggregation service) are not affected by purge.

Best Practices

Recommendations:
  • Always use dryRun: true first to preview deletions
  • Set up automated purge for old successful work orders
  • Keep failed work orders longer for debugging
  • Export important data before purging