Skip to main content
Glama

list-workflows

Retrieve all available workflows from n8n to view and manage automation processes. Use this tool to see existing workflows after initializing the n8n connection.

Instructions

List all workflows from n8n. Use after init-n8n to see available workflows. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes

Implementation Reference

  • The primary handler function for executing the 'list-workflows' tool. It validates the client ID, fetches workflows using N8nClient.listWorkflows(), formats the data, and returns it as JSON or handles errors.
    case "list-workflows": { const { clientId } = args as { clientId: string }; const client = clients.get(clientId); if (!client) { return { content: [{ type: "text", text: "Client not initialized. Please run init-n8n first.", }], isError: true }; } try { const workflows = await client.listWorkflows(); const formattedWorkflows = workflows.data.map(wf => ({ id: wf.id, name: wf.name, active: wf.active, created: wf.createdAt, updated: wf.updatedAt, tags: wf.tags, })); return { content: [{ type: "text", text: JSON.stringify(formattedWorkflows, null, 2), }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : "Unknown error occurred", }], isError: true }; } }
  • src/index.ts:413-422 (registration)
    Registration of the 'list-workflows' tool in the ListToolsRequestSchema handler's tools array, including name, description, and input schema.
    name: "list-workflows", description: "List all workflows from n8n. Use after init-n8n to see available workflows. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.", inputSchema: { type: "object", properties: { clientId: { type: "string" } }, required: ["clientId"] } },
  • Input schema definition for the 'list-workflows' tool, specifying the required 'clientId' parameter.
    inputSchema: { type: "object", properties: { clientId: { type: "string" } }, required: ["clientId"] }
  • Helper method in N8nClient class that performs the API request to list workflows from the n8n server.
    async listWorkflows(): Promise<N8nWorkflowList> { return this.makeRequest<N8nWorkflowList>('/workflows'); }
  • TypeScript interface defining the structure of the workflows list response from n8n API.
    interface N8nWorkflowList { data: N8nWorkflow[]; nextCursor?: string; }

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/illuminaresolutions/n8n-mcp-server'

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