Skip to main content

Overview

Permanently delete a workflow and its associated execution history. This action cannot be undone.
Deleting a workflow removes:
  • The workflow definition (nodes, connections, settings)
  • All execution history
  • Version backups (if using workflow versioning)
  • Associated pinned data
This operation is irreversible.

Endpoint

DELETE /workflows/:id

Request Parameters

id
string
required
Workflow ID to deleteExample: "wf_abc123"

Response

success
boolean
Operation success status
data
object
Deletion confirmation
message
string
Confirmation message

Error Codes

NOT_FOUND
string
Cause: Workflow ID does not existResolution: Verify ID with n8n_list_workflows
WORKFLOW_ACTIVE
string
Cause: Workflow is currently activeResolution: Deactivate workflow first using:
{
  "id": "wf_abc123",
  "operations": [{"type": "deactivateWorkflow"}]
}
API_ERROR
string
Cause: n8n API not configured or unreachableResolution: Verify configuration with n8n_health_check
PERMISSION_DENIED
string
Cause: Insufficient permissions (enterprise feature)Resolution: Request workflow owner or admin to delete

Examples

curl -X DELETE "https://n8n.example.com/api/v1/workflows/wf_abc123" \
  -H "X-N8N-API-KEY: your-api-key"

Response Example

{
  "success": true,
  "data": {
    "id": "wf_abc123",
    "name": "Old Workflow",
    "deleted": true
  },
  "message": "Workflow 'Old Workflow' deleted successfully."
}

Safe Deletion Checklist

1

Check Workflow Status

Verify workflow is not active and not referenced by other workflows
n8n_get_workflow({id: "wf_abc123", mode: "minimal"})
2

Review Execution History

Check if execution data should be preserved
n8n_executions({
  action: "list",
  workflowId: "wf_abc123",
  limit: 10
})
3

Export or Backup

Optionally export workflow definition for archival
n8n_get_workflow({id: "wf_abc123", mode: "full"})
# Save response to file
4

Deactivate Workflow

Ensure workflow is inactive before deletion
n8n_update_partial_workflow({
  id: "wf_abc123",
  operations: [{type: "deactivateWorkflow"}]
})
5

Delete Workflow

Perform the deletion
n8n_delete_workflow({id: "wf_abc123"})

What Gets Deleted

Workflow Data

  • Workflow definition
  • Node configurations
  • Connection topology
  • Workflow settings

Execution Data

  • All execution history
  • Execution logs
  • Output data
  • Error traces

Version History

  • All version backups
  • Rollback history
  • Change metadata

Metadata

  • Workflow tags
  • Pinned test data
  • Static data
  • Credentials references (not actual credentials)
Credentials are NOT deleted. Workflow deletion only removes credential references from nodes. The credentials themselves remain in your n8n instance and can be reused.

Dependencies and References

Before deleting a workflow, check if it’s referenced by:
  • Error workflows: Other workflows using this as errorWorkflow setting
  • Execute Workflow nodes: Other workflows calling this workflow
  • External systems: Webhooks or APIs expecting this workflow to exist
  • Scheduled triggers: Active schedules that will fail
Deleting a referenced workflow will break these dependencies.

Alternatives to Deletion

Instead of deleting, archive workflows for future reference:
{
  "id": "wf_abc123",
  "operations": [
    {"type": "deactivateWorkflow"},
    {"type": "addTag", "tag": "archived"},
    {"type": "addTag", "tag": "2024-03"}
  ]
}

Recovery

There is NO undo for workflow deletion.Recovery options:
  1. Version backups: If workflow versioning is enabled and backups weren’t truncated
  2. n8n database backup: If you have database-level backups
  3. Exported workflow JSON: If you saved the workflow definition before deletion
Without these, the workflow is permanently lost.

Best Practices

Before Deleting Workflows:
  1. Review execution history - Check recent runs for errors or unexpected behavior
  2. Export workflow definition - Save JSON for potential future reference
  3. Check dependencies - Search for workflow references in other workflows
  4. Deactivate first - Ensure no scheduled executions are pending
  5. Tag for deletion - Mark workflows with “to-delete” tag and review after 30 days
  6. Document reason - Keep a log of why workflows were deleted

Batch Deletion

For deleting multiple workflows:
// Example: Delete all workflows tagged "deprecated"
const workflows = n8n_list_workflows({tags: ["deprecated"]})

for (const workflow of workflows.data.workflows) {
  // Deactivate
  await n8n_update_partial_workflow({
    id: workflow.id,
    operations: [{type: "deactivateWorkflow"}]
  })
  
  // Delete
  await n8n_delete_workflow({id: workflow.id})
  
  console.log(`Deleted: ${workflow.name}`)
}
Conceived by Romuald Członkowski - www.aiadvisors.pl/en

Build docs developers (and LLMs) love