Skip to main content
Glama

deactivate-workflow

Deactivate a workflow by ID in the n8n MCP Server to prevent it from running. Requires clientId and workflow ID provided as compact JSON.

Instructions

Deactivate a workflow by ID. This will prevent the workflow from running. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes
idYes

Implementation Reference

  • Main execution handler for the deactivate-workflow tool. Retrieves N8nClient by clientId and calls its deactivateWorkflow method with the provided workflow ID.
    case "deactivate-workflow": { const { clientId, id } = args as { clientId: string; id: string }; const client = clients.get(clientId); if (!client) { return { content: [{ type: "text", text: "Client not initialized. Please run init-n8n first.", }], isError: true }; } try { const workflow = await client.deactivateWorkflow(id); return { content: [{ type: "text", text: `Successfully deactivated workflow:\n${JSON.stringify(workflow, null, 2)}`, }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : "Unknown error occurred", }], isError: true }; }
  • N8nClient helper method that performs the actual API call to deactivate a workflow via POST to /workflows/{id}/deactivate.
    async deactivateWorkflow(id: string): Promise<N8nWorkflow> { return this.makeRequest<N8nWorkflow>(`/workflows/${id}/deactivate`, { method: 'POST', }); }
  • src/index.ts:484-506 (registration)
    Registration of the deactivate-workflow tool in the ListTools response, including its description and input schema.
    name: "activate-workflow", description: "Activate a workflow by ID. This will enable the workflow to run. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.", inputSchema: { type: "object", properties: { clientId: { type: "string" }, id: { type: "string" } }, required: ["clientId", "id"] } }, { name: "deactivate-workflow", description: "Deactivate a workflow by ID. This will prevent the workflow from running. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.", inputSchema: { type: "object", properties: { clientId: { type: "string" }, id: { type: "string" } }, required: ["clientId", "id"] } },
  • Input schema definition for the deactivate-workflow tool, specifying clientId and id as required string parameters.
    inputSchema: { type: "object", properties: { clientId: { type: "string" }, id: { type: "string" } }, required: ["clientId", "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/illuminaresolutions/n8n-mcp-server'

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