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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Workflow ID to activate |
Implementation Reference
- src/n8n-client.ts:80-84 (handler)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', }); } - src/tools.ts:103-119 (schema)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); - src/n8n-client.ts:25-47 (helper)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>; }