Skip to main content
Glama
spences10

mcp-n8n-builder

activate_workflow

Enable automatic execution of a workflow by its ID using triggers like schedules or webhooks. Only workflows with automatic triggers can be activated.

Instructions

Activates a workflow by its ID, enabling it to run automatically based on its trigger (schedule, webhook, etc.). Note that only workflows with automatic trigger nodes can be activated - workflows with only manual triggers cannot be activated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the workflow to activate - can be obtained from list_workflows

Implementation Reference

  • The handler function that implements the core logic for the 'activate_workflow' MCP tool. It validates the input arguments, calls the N8nApiClient to activate the workflow, formats the response, and handles specific errors like missing triggers with helpful guidance.
     * Handles the activate_workflow tool
     */
    export async function handle_activate_workflow(
    	api_client: N8nApiClient,
    	args: any,
    ) {
    	if (!args.id) {
    		throw new McpError(
    			ErrorCode.InvalidParams,
    			'Workflow ID is required',
    		);
    	}
    
    	try {
    		const result = await api_client.activate_workflow(args.id);
    		return {
    			content: [
    				{
    					type: 'text',
    					text: `Successfully activated workflow "${result.name}" (ID: ${args.id})`,
    				},
    			],
    		};
    	} catch (error: any) {
    		// Check for common activation errors
    		if (error.message && error.message.includes('trigger')) {
    			// This is likely an error about missing trigger nodes
    			const core_principles =
    				WORKFLOW_COMPOSITION_GUIDE.core_principles;
    
    			return {
    				content: [
    					{
    						type: 'text',
    						text:
    							`Error activating workflow: ${error.message}\n\n` +
    							`Note: Only workflows with automatic trigger nodes (Schedule, Webhook, etc.) can be activated. ` +
    							`Workflows with only manual triggers cannot be automatically activated.\n\n` +
    							`Here are some core principles for workflow composition:\n${core_principles}`,
    					},
    				],
    				isError: true,
    			};
    		}
    
    		return {
    			content: [
    				{
    					type: 'text',
    					text: `Error activating workflow: ${
    						error.message || String(error)
    					}`,
    				},
    			],
    			isError: true,
    		};
    	}
    }
  • Tool registration in the list_tools handler, defining the name, description, and input schema for 'activate_workflow'.
    {
    	name: 'activate_workflow',
    	description:
    		'Activates a workflow by its ID, enabling it to run automatically based on its trigger (schedule, webhook, etc.). Note that only workflows with automatic trigger nodes can be activated - workflows with only manual triggers cannot be activated.',
    	inputSchema: {
    		type: 'object',
    		properties: {
    			id: {
    				type: 'string',
    				description:
    					'ID of the workflow to activate - can be obtained from list_workflows',
    			},
    		},
    		required: ['id'],
    	},
    },
  • Dispatch logic in the call_tool handler that routes 'activate_workflow' calls to the handle_activate_workflow function.
    case 'activate_workflow':
    	return await handle_activate_workflow(api_client, args);
  • Supporting helper method in the N8nApiClient class that makes the actual HTTP POST request to the n8n API to activate a workflow by ID.
    async activate_workflow(id: string): Promise<any> {
    	return this.request<any>('POST', `/workflows/${id}/activate`);
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it enables automatic execution based on triggers, specifies prerequisites (automatic trigger nodes required), and clarifies limitations (manual-trigger workflows excluded). However, it lacks details on error handling, permissions, or side effects like rate limits.

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 front-loaded with the core purpose in the first sentence, followed by a crucial note in the second sentence. Both sentences earn their place by providing essential usage constraints without redundancy or fluff, making it highly efficient and well-structured.

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

Completeness4/5

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

Given the tool's moderate complexity (activation operation with prerequisites), no annotations, and no output schema, the description is largely complete. It covers purpose, usage guidelines, and behavioral aspects, but could benefit from mentioning response format or error cases to be fully comprehensive for an agent.

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?

The schema description coverage is 100%, with the input schema fully documenting the 'id' parameter. The description adds minimal semantic value beyond the schema, only implying the ID is for a workflow without providing additional context like format or validation rules. This meets the baseline for high schema coverage.

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

Purpose5/5

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

The description clearly states the specific action ('Activates'), the resource ('a workflow'), and the mechanism ('by its ID'), distinguishing it from siblings like deactivate_workflow or get_workflow. It explicitly mentions enabling automatic execution based on triggers, which clarifies its functional scope beyond just a state change.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool ('workflows with automatic trigger nodes') and when not to use it ('workflows with only manual triggers cannot be activated'). It also implicitly contrasts with deactivate_workflow by specifying activation, offering clear usage context.

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

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