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
Request Parameters
Workflow ID to delete Example: "wf_abc123"
Response
Error Codes
Cause: Workflow ID does not existResolution: Verify ID with n8n_list_workflows
Cause: Workflow is currently activeResolution: Deactivate workflow first using:{
"id" : "wf_abc123" ,
"operations" : [{ "type" : "deactivateWorkflow" }]
}
Cause: n8n API not configured or unreachableResolution: Verify configuration with n8n_health_check
Cause: Insufficient permissions (enterprise feature)Resolution: Request workflow owner or admin to delete
Examples
Delete Workflow
Safe Deletion Pattern
Bulk Deletion
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
Check Workflow Status
Verify workflow is not active and not referenced by other workflows n8n_get_workflow( {id: "wf_abc123", mode: "minimal"} )
Review Execution History
Check if execution data should be preserved n8n_executions( {
action: "list",
workflowId: "wf_abc123",
limit: 10
})
Export or Backup
Optionally export workflow definition for archival n8n_get_workflow( {id: "wf_abc123", mode: "full"} )
# Save response to file
Deactivate Workflow
Ensure workflow is inactive before deletion n8n_update_partial_workflow( {
id: "wf_abc123",
operations: [{ type : "deactivateWorkflow"}]
})
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" }
]
}
Temporarily disable without deletion: {
"id" : "wf_abc123" ,
"operations" : [
{ "type" : "deactivateWorkflow" },
{ "type" : "addTag" , "tag" : "disabled" }
]
}
Export for backup or migration: # Get full workflow
n8n_get_workflow( {id: "wf_abc123", mode: "full"} )
# Save to file or version control
# Later restore by creating new workflow
Recovery
There is NO undo for workflow deletion. Recovery options:
Version backups: If workflow versioning is enabled and backups weren’t truncated
n8n database backup: If you have database-level backups
Exported workflow JSON: If you saved the workflow definition before deletion
Without these, the workflow is permanently lost.
Best Practices
Before Deleting Workflows:
Review execution history - Check recent runs for errors or unexpected behavior
Export workflow definition - Save JSON for potential future reference
Check dependencies - Search for workflow references in other workflows
Deactivate first - Ensure no scheduled executions are pending
Tag for deletion - Mark workflows with “to-delete” tag and review after 30 days
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