Skip to main content
Glama

n8n_activate_workflow

Activate a workflow to begin listening for triggers like webhooks or schedules, enabling automatic execution when conditions are met.

Instructions

Start a workflow to listen for triggers (webhooks, schedules, etc). Activating enables automatic execution when trigger conditions are met. Workflow must have valid trigger nodes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesWorkflow ID to activate

Implementation Reference

  • Handler method that activates a workflow by making a POST request to the n8n API endpoint /workflows/{id}/activate
    async activateWorkflow(id: string) {
      return this.request(`${this.apiBase}/workflows/${id}/activate`, {
        method: 'POST',
      });
    }
  • Tool schema definition with name, description, input parameters (workflow ID), and behavioral annotations
      name: 'n8n_activate_workflow',
      description: 'Start a workflow to listen for triggers (webhooks, schedules, etc). Activating enables automatic execution when trigger conditions are met. Workflow must have valid trigger nodes.',
      inputSchema: {
        type: 'object',
        properties: {
          id: { type: 'string', description: 'Workflow ID to activate' },
        },
        required: ['id'],
      },
      annotations: {
        title: 'Activate Workflow',
        readOnlyHint: false,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: true,
      },
    },
  • src/server.ts:35-36 (registration)
    Tool registration in the request handler switch statement that routes the tool call to the activateWorkflow client method
    case 'n8n_activate_workflow':
      return client.activateWorkflow(args.id);
  • Private helper method that handles authenticated HTTP requests to the n8n API with error handling and timeout support
    private async request<T>(
      endpoint: string,
      options: RequestInit = {}
    ): Promise<T> {
      const url = `${this.config.apiUrl}${endpoint}`;
    
      const response = await fetch(url, {
        ...options,
        signal: AbortSignal.timeout(this.timeout),
        headers: {
          'X-N8N-API-KEY': this.config.apiKey,
          'Content-Type': 'application/json',
          ...options.headers,
        },
      });
    
      if (!response.ok) {
        const error = await response.text();
        throw new Error(`n8n API Error (${response.status}): ${error}`);
      }
    
      return response.json() as Promise<T>;
    }

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/node2flow-th/n8n-management-mcp-community'

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