Skip to main content
Glama

get_workflow

Retrieve a specific n8n workflow by its unique ID to access, analyze, or manage automation processes within the n8n platform.

Instructions

Get a specific n8n workflow by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe workflow ID

Implementation Reference

  • MCP tool handler for 'get_workflow'. Resolves workflow ID alias if needed, fetches the workflow using N8nClient, attaches numeric alias, and returns the workflow as JSON success response.
    private async handleGetWorkflow(args: { id: string | number }) { const id = this.resolveWorkflowId(args.id); const workflow = await this.n8nClient.getWorkflow(id); this.withAlias(workflow); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(workflow), null, 2) }] }; }
  • src/index.ts:70-70 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    { name: 'get_workflow', description: 'Get a specific n8n workflow by ID', inputSchema: { type: 'object', properties: { id: { oneOf: [{ type: 'string' }, { type: 'number' }], description: 'The workflow ID' } }, required: ['id'] } },
  • Input schema definition for the get_workflow tool, specifying the required 'id' parameter as string or number.
    { name: 'get_workflow', description: 'Get a specific n8n workflow by ID', inputSchema: { type: 'object', properties: { id: { oneOf: [{ type: 'string' }, { type: 'number' }], description: 'The workflow ID' } }, required: ['id'] } },
  • N8nClient helper method that makes the actual API call to retrieve a workflow by ID from the n8n server.
    async getWorkflow(id: string | number): Promise<N8nWorkflow> { const response = await this.api.get<N8nApiResponse<N8nWorkflow> | N8nWorkflow>(`/workflows/${id}`); 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