Skip to main content
Glama

delete_workflow

Remove workflows from n8n automation platform using workflow ID to manage automation lifecycle and maintain clean workflow inventory.

Instructions

Delete an n8n workflow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • The primary handler function for the 'delete_workflow' tool. It resolves the workflow ID using an alias mapping if applicable, calls the N8nClient's deleteWorkflow method, and returns a success response with the original ID.
    private async handleDeleteWorkflow(args: { id: string | number }) { const id = this.resolveWorkflowId(args.id); await this.n8nClient.deleteWorkflow(id); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess({ id: args.id }), null, 2) }] };
  • src/index.ts:73-73 (registration)
    Registers the 'delete_workflow' tool in the MCP server's tool list, including its name, description, and input schema defining the required 'id' parameter.
    { name: 'delete_workflow', description: 'Delete an n8n workflow', inputSchema: { type: 'object', properties: { id: { oneOf: [{ type: 'string' }, { type: 'number' }] } }, required: ['id'] } },
  • Defines the input schema for the 'delete_workflow' tool, specifying an object with a required 'id' field that can be string or number.
    { name: 'delete_workflow', description: 'Delete an n8n workflow', inputSchema: { type: 'object', properties: { id: { oneOf: [{ type: 'string' }, { type: 'number' }] } }, required: ['id'] } },
  • Helper method in N8nClient that performs the actual HTTP DELETE request to the n8n API endpoint `/workflows/{id}` to delete the workflow.
    async deleteWorkflow(id: string | number): Promise<void> { await this.api.delete(`/workflows/${id}`); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/get2knowio/n8n-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server