Skip to main content
Glama

activate

Activate or deactivate n8n workflows to control automation execution and manage workflow states within the McFlow server.

Instructions

Activate or deactivate a workflow in n8n

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesWorkflow ID
activeYesSet to true to activate, false to deactivate

Implementation Reference

  • The handler function for the 'activate' tool in the ToolHandler class's handleTool method. It delegates to n8nManager.updateWorkflowStatus with the provided workflow ID and active status.
    case 'activate':
      return await this.n8nManager.updateWorkflowStatus(
        args?.id as string,
        args?.active as boolean
      );
  • Defines the tool schema including name, description, and input schema (requires id and active boolean) for the 'activate' tool.
      name: 'activate',
      description: 'Activate or deactivate a workflow in n8n',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'Workflow ID',
          },
          active: {
            type: 'boolean',
            description: 'Set to true to activate, false to deactivate',
          },
        },
        required: ['id', 'active'],
      },
    },
  • Registers all tools, including 'activate', by providing getToolDefinitions() in response to ListToolsRequestSchema in the MCP server setup.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: getToolDefinitions(),
    }));
  • The core helper function that executes the n8n CLI command to activate or deactivate a workflow by ID and returns success/error messages.
    async updateWorkflowStatus(id: string, activate: boolean): Promise<any> {
      try {
        const command = activate 
          ? `n8n update:workflow --id=${id} --activate`
          : `n8n update:workflow --id=${id} --deactivate`;
        
        console.error(`Executing: ${command}`);
        const { stdout, stderr } = await execAsync(command);
        
        if (this.hasRealError(stderr, stdout)) {
          throw new Error(stderr);
        }
    
        return {
          content: [
            {
              type: 'text',
              text: `✅ Workflow ${activate ? 'activated' : 'deactivated'} successfully!\n\n` +
                    `🆔 Workflow ID: ${id}\n` +
                    `${activate ? '▶️ Status: Active' : '⏸️ Status: Inactive'}\n`,
            },
          ],
        };
      } catch (error: any) {
        throw new Error(`Failed to update workflow status: ${error.message}`);
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'activate or deactivate' implies a state change operation, it doesn't specify whether this requires special permissions, what happens to running instances during deactivation, whether changes are reversible, or what the response looks like. For a mutation tool with zero annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core functionality without any wasted words. It's appropriately sized for a tool with two parameters and gets straight to the point with no unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a state-changing tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'activate' or 'deactivate' mean operationally, what permissions are required, what happens to active executions during state changes, or what the tool returns. Given the complexity of workflow management and the rich sibling toolset, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema already fully documents both parameters (id and active). The description doesn't add any meaningful parameter semantics beyond what's in the schema - it mentions 'workflow' which aligns with the schema's 'Workflow ID' but provides no additional context about valid IDs or activation implications.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('activate or deactivate') and resource ('a workflow in n8n'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential siblings like 'start' or 'deploy' that might have overlapping functionality in workflow management.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'start', 'deploy', and 'execute' available, there's no indication whether this is for toggling workflow status versus initiating execution, nor any prerequisites or context for activation/deactivation decisions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/mckinleymedia/mcflow-mcp'

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