# Release v1.14.0: Workflow Deletion
**Release Date**: 2025-12-16
**Type**: Feature Release
---
## 🎯 Overview
Version 1.14.0 adds the ability to delete (archive) workflows from n8n through the MCP interface. This completes the CRUD operations for workflow management.
---
## 🚀 What's New
### delete_workflow Tool
**Purpose**: Delete (archive) workflows from n8n safely through the API.
**Features**:
- ✅ Safe deletion via n8n REST API
- ✅ Workflow name lookup before deletion (for audit trail)
- ✅ Clear success feedback
- ✅ Action logging in session state
- ✅ Error handling with detailed messages
**Usage**:
```python
# Delete a workflow by ID
delete_workflow(workflow_id="abc123")
# Output:
# Workflow Deleted Successfully
# ID: abc123
# Name: My Old Workflow
# ⚠️ The workflow has been removed from n8n.
```
---
## 🔧 Technical Implementation
### Client Method (client.py)
```python
async def delete_workflow(self, workflow_id: str) -> Dict:
"""Delete (archive) a workflow
Args:
workflow_id: ID of the workflow to delete
Returns:
Success message
"""
response = await self.client.delete(
f"{self.api_url}/api/v1/workflows/{workflow_id}",
headers=self.headers
)
response.raise_for_status()
return {"success": True, "message": f"Workflow {workflow_id} deleted successfully"}
```
### MCP Tool Registration (server.py)
```python
Tool(
name="delete_workflow",
description=(
"🗑️ Delete (archive) a workflow. This removes the workflow from n8n. "
"Use with caution as this action may be irreversible depending on n8n configuration."
),
inputSchema={
"type": "object",
"properties": {
"workflow_id": {
"type": "string",
"description": "ID of the workflow to delete"
}
},
"required": ["workflow_id"]
}
)
```
### Call Handler (server.py)
```python
elif name == "delete_workflow":
workflow_id = arguments["workflow_id"]
# Get workflow name before deletion for better feedback
try:
workflow = await n8n_client.get_workflow(workflow_id)
workflow_name = workflow.get('name', 'Unknown')
except:
workflow_name = "Unknown"
# Delete the workflow
result_data = await n8n_client.delete_workflow(workflow_id)
state_manager.log_action("delete_workflow", {
"workflow_id": workflow_id,
"workflow_name": workflow_name
})
result = f"# Workflow Deleted Successfully\n\n"
result += f"**ID:** {workflow_id}\n"
result += f"**Name:** {workflow_name}\n\n"
result += "⚠️ The workflow has been removed from n8n."
return [TextContent(type="text", text=result)]
```
---
## 📊 Files Changed
**Client Layer**:
- `src/n8n_workflow_builder/client.py` (+28 lines)
- Added `delete_workflow()` method
**MCP Server Layer**:
- `src/n8n_workflow_builder/server.py` (+36 lines)
- Added tool registration
- Added call handler
- Added action logging
---
## ⚠️ Important Notes
### Reversibility
The deletion behavior depends on your n8n configuration:
- **Default n8n**: Workflows are soft-deleted and can potentially be recovered from database
- **Production setups**: May have hard-deletion configured
- **Always backup** important workflows before deletion
### Permissions
Requires appropriate n8n API permissions:
- API key must have workflow deletion rights
- Check your n8n user role permissions
### Use Cases
- Cleaning up test workflows
- Removing deprecated automation
- Workflow lifecycle management
- Development environment cleanup
---
## 🎯 Complete CRUD Operations
With this release, the n8n Workflow Builder now supports complete CRUD operations:
| Operation | Tool | Description |
|-----------|------|-------------|
| **Create** | `create_workflow` | Create new workflows |
| **Read** | `list_workflows`, `get_workflow` | List and read workflows |
| **Update** | `update_workflow` | Modify existing workflows |
| **Delete** | `delete_workflow` | Delete/archive workflows |
---
## 🔄 Migration Notes
No migration required. This is a new feature with no breaking changes.
---
## 📚 Example Workflows
### Safe Deletion Pattern
```python
# 1. List workflows to find the one to delete
workflows = list_workflows()
# 2. Verify it's the right one
workflow = get_workflow(workflow_id="abc123")
print(f"About to delete: {workflow['name']}")
# 3. Optionally backup
backup = json.dumps(workflow)
# 4. Delete
delete_workflow(workflow_id="abc123")
```
### Bulk Cleanup
```python
# Delete all test workflows
workflows = list_workflows()
for workflow in workflows:
if workflow['name'].startswith('[TEST]'):
delete_workflow(workflow_id=workflow['id'])
```
---
## 🙏 Acknowledgments
Thanks for requesting this feature! Workflow deletion completes the core workflow management capabilities.