n8n_get_workflow
Retrieve detailed workflow information including all nodes and connections to analyze and manage automation processes in n8n.
Instructions
Get detailed information about a specific workflow including all nodes and connections.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The workflow ID |
Implementation Reference
- src/tools/workflow-tools.ts:198-227 (handler)The primary handler function that executes the tool logic: validates input ID, fetches workflow data via N8nApiClient.getWorkflow(id), and returns formatted JSON response with workflow details.n8n_get_workflow: async ( client: N8nApiClient, args: Record<string, unknown> ): Promise<ToolResult> => { const id = args.id as string; if (!id) { throw new Error('Workflow ID is required'); } const workflow = await client.getWorkflow(id); return { content: [ { type: 'text' as const, text: JSON.stringify({ id: workflow.id, name: workflow.name, active: workflow.active, createdAt: workflow.createdAt, updatedAt: workflow.updatedAt, nodes: workflow.nodes, connections: workflow.connections, settings: workflow.settings, tags: workflow.tags, }, null, 2), }, ], }; },
- src/tools/workflow-tools.ts:31-44 (schema)Tool schema definition specifying name, description, and required 'id' input parameter.{ name: 'n8n_get_workflow', description: 'Get detailed information about a specific workflow including all nodes and connections.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The workflow ID', }, }, required: ['id'], }, },
- src/tools/index.ts:12-16 (registration)Aggregates workflowTools (including n8n_get_workflow schema) into allTools array exported for MCP server tool listing.export const allTools: ToolDefinition[] = [ ...documentationTools, // Documentation first for discoverability ...workflowTools, ...executionTools, ];
- src/server.ts:122-125 (registration)Runtime dispatch/registration logic that routes calls to 'n8n_get_workflow' handler when name matches in workflowToolHandlers.if (name in workflowToolHandlers) { const handler = workflowToolHandlers[name as keyof typeof workflowToolHandlers]; return handler(client, args); }
- src/server.ts:60-64 (registration)Registers the tool list endpoint with MCP server, providing allTools (including n8n_get_workflow) in response to list requests.this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: allTools, }; });