Overview

The delete_workflow function permanently deletes an AI workflow from the system.

Function Signature

pub async fn delete_workflow(workflow_id: &str) -> Result<()>

Parameters

workflow_id
&str
required
The unique identifier of the workflow to delete

Return Value

Returns Result<()> indicating success or failure.

Basic Usage

use wacht::api::workflows::*;

delete_workflow("52057194421551105").await?;
println!("Workflow deleted successfully");

Error Handling

match delete_workflow("52057194421551105").await {
    Ok(()) => {
        println!("Workflow deleted successfully");
    }
    Err(Error::Api { status, message, .. }) => {
        match status.as_u16() {
            404 => println!("Workflow not found"),
            403 => println!("Access denied: {}", message),
            409 => println!("Cannot delete active workflow: {}", message),
            _ => println!("API error {}: {}", status, message),
        }
    }
    Err(e) => println!("Request failed: {}", e),
}

Important Notes

  • This operation is irreversible
  • All workflow data including execution history will be deleted
  • Active workflows must be deactivated before deletion
  • You must have appropriate permissions to delete workflows

Rate Limits

  • Delete operations: 20 requests per minute
  • Burst limit: 5 requests per second