Skip to main content
Glama

n8n_get_workflow

Retrieve detailed information about a specific workflow including all nodes and connections by providing the workflow ID.

Instructions

Get detailed information about a specific workflow including all nodes and connections.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe workflow ID

Implementation Reference

  • The main execution handler for the 'n8n_get_workflow' tool. It validates the workflow ID, fetches the full workflow data using N8nApiClient.getWorkflow(), and returns a formatted JSON response containing workflow details, nodes, connections, settings, and tags.
    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 the name, description, and input schema (requiring 'id' string parameter) for input validation.
    {
      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'],
      },
    },
  • Central registration of all tools by spreading workflowTools into the allTools array, which provides the complete tool list to the MCP server.
    export const allTools: ToolDefinition[] = [
      ...documentationTools,  // Documentation first for discoverability
      ...workflowTools,
      ...executionTools,
    ];
  • src/server.ts:60-63 (registration)
    MCP server handler for listing tools, returning the aggregated allTools list which includes the n8n_get_workflow schema.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: allTools,
      };
  • src/server.ts:122-125 (registration)
    Dynamic dispatch to workflowToolHandlers based on tool name, routing 'n8n_get_workflow' calls to its specific handler function.
    if (name in workflowToolHandlers) {
      const handler = workflowToolHandlers[name as keyof typeof workflowToolHandlers];
      return handler(client, args);
    }

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