Skip to main content
Glama

activate_workflow

Activate an n8n workflow by providing its ID to start automated processes and trigger workflow execution.

Instructions

Activate an n8n workflow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Main MCP tool handler: resolves workflow ID alias, activates via n8nClient, adds numeric alias to response, returns JSON-formatted workflow.
    private async handleActivateWorkflow(args: { id: string | number }) {
      const id = this.resolveWorkflowId(args.id);
      const workflow = await this.n8nClient.activateWorkflow(id);
      this.withAlias(workflow);
      return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(workflow), null, 2) }] };
    }
  • N8nClient helper: Performs the core HTTP POST to n8n API /workflows/{id}/activate endpoint and normalizes the response.
    async activateWorkflow(id: string | number): Promise<N8nWorkflow> {
      const response = await this.api.post<N8nApiResponse<N8nWorkflow> | N8nWorkflow>(`/workflows/${id}/activate`);
      const payload: any = response.data as any;
      return (payload && typeof payload === 'object' && 'data' in payload) ? payload.data : payload;
    }
  • src/index.ts:74-74 (registration)
    Tool registration in list_tools response: defines name, description, and input schema (id: string|number required).
    { name: 'activate_workflow', description: 'Activate an n8n workflow', inputSchema: { type: 'object', properties: { id: { oneOf: [{ type: 'string' }, { type: 'number' }] } }, required: ['id'] } },
  • src/index.ts:236-237 (registration)
    Dispatch routing in CallToolRequest handler: matches tool name and invokes the handler method.
    case 'activate_workflow':
      return await this.handleActivateWorkflow(request.params.arguments as { id: string | number });

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

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