Skip to main content
Glama

activate_workflow

Start an n8n workflow by providing its ID to execute automated processes and trigger workflow actions.

Instructions

Activate an n8n workflow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • src/index.ts:74-74 (registration)
    Tool registration in the list_tools response, including name, description, and input schema.
    { name: 'activate_workflow', description: 'Activate an n8n workflow', inputSchema: { type: 'object', properties: { id: { oneOf: [{ type: 'string' }, { type: 'number' }] } }, required: ['id'] } },
  • Input schema definition for the activate_workflow tool.
    { name: 'activate_workflow', description: 'Activate an n8n workflow', inputSchema: { type: 'object', properties: { id: { oneOf: [{ type: 'string' }, { type: 'number' }] } }, required: ['id'] } },
  • The main handler function for the activate_workflow tool. Resolves workflow ID alias, activates via N8nClient, adds numeric alias, and returns success response.
    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) }] }; }
  • Dispatch case in the main CallToolRequestSchema handler that routes to the specific activate_workflow handler.
    case 'activate_workflow': return await this.handleActivateWorkflow(request.params.arguments as { id: string | number });
  • N8nClient helper method that performs the actual API POST to /workflows/{id}/activate endpoint.
    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; }

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