Skip to main content
Glama

deactivate_workflow

Deactivate a specific workflow by ID to stop automatic execution while retaining it for manual use or future reactivation. Ideal for temporarily pausing workflows without deletion.

Instructions

Deactivates a workflow by its ID, preventing it from running automatically. The workflow will still exist and can be manually executed or reactivated later. Use this instead of deleting workflows that you might need again.

Input Schema

NameRequiredDescriptionDefault
idYesID of the workflow to deactivate - can be obtained from list_workflows

Input Schema (JSON Schema)

{ "properties": { "id": { "description": "ID of the workflow to deactivate - can be obtained from list_workflows", "type": "string" } }, "required": [ "id" ], "type": "object" }

Implementation Reference

  • The primary handler function that implements the deactivate_workflow tool logic. It validates the workflow ID, calls the N8nApiClient to perform the deactivation, and returns a formatted success or error message.
    * Handles the deactivate_workflow tool */ export async function handle_deactivate_workflow( api_client: N8nApiClient, args: any, ) { if (!args.id) { throw new McpError( ErrorCode.InvalidParams, 'Workflow ID is required', ); } try { const result = await api_client.deactivate_workflow(args.id); return { content: [ { type: 'text', text: `Successfully deactivated workflow "${result.name}" (ID: ${args.id})`, }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error deactivating workflow: ${ error.message || String(error) }`, }, ], isError: true, }; } }
  • Defines the tool's input schema, specifying that it requires a 'id' string parameter for the workflow ID.
    { name: 'deactivate_workflow', description: 'Deactivates a workflow by its ID, preventing it from running automatically. The workflow will still exist and can be manually executed or reactivated later. Use this instead of deleting workflows that you might need again.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'ID of the workflow to deactivate - can be obtained from list_workflows', }, }, required: ['id'], }, },
  • Wires the deactivate_workflow tool name to the handle_deactivate_workflow function in the central tool dispatching switch statement.
    case 'deactivate_workflow': return await handle_deactivate_workflow(api_client, args);
  • Helper method in the N8nApiClient class that performs the actual HTTP POST request to the n8n API endpoint to deactivate the specified workflow.
    /** * Deactivate a workflow */ async deactivate_workflow(id: string): Promise<any> { return this.request<any>('POST', `/workflows/${id}/deactivate`); }

Other Tools

Related Tools

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/spences10/mcp-n8n-builder'

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