Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesThe workflow ID

Implementation Reference

  • 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), }, ], }; },
  • 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'], }, },
  • 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, }; });

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/alicankiraz1/cursor-n8n-builder'

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