Skip to main content
Glama
DrBalls

n8n MCP Server

by DrBalls

n8n_list_workflows

Retrieve and filter workflows from n8n with options for active status, tags, name, project, and pagination to manage automation processes.

Instructions

List all workflows in the n8n instance with optional filtering.

Args:

  • active (boolean, optional): Filter by active status

  • tags (string, optional): Filter by tag IDs (comma-separated)

  • name (string, optional): Filter by name (partial match)

  • projectId (string, optional): Filter by project ID

  • limit (number): Maximum results (default: 100, max: 250)

  • cursor (string, optional): Pagination cursor from previous response

Returns: List of workflows with id, name, active status, created/updated timestamps, and tags. Includes nextCursor for pagination if more results exist.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
activeNoFilter by active status
tagsNoFilter by tag IDs (comma-separated)
nameNoFilter by name (partial match)
projectIdNoFilter by project ID
limitNoMaximum results to return
cursorNoPagination cursor

Implementation Reference

  • The handler function for n8n_list_workflows. It constructs query parameters, calls the API via a service client, and formats the response for the MCP client.
    async (params: z.infer<typeof ListWorkflowsSchema>) => {
      const queryParams: Record<string, unknown> = { limit: params.limit };
      if (params.active !== undefined) queryParams.active = params.active;
      if (params.tags) queryParams.tags = params.tags;
      if (params.name) queryParams.name = params.name;
      if (params.projectId) queryParams.projectId = params.projectId;
      if (params.cursor) queryParams.cursor = params.cursor;
      
      const response = await get<N8nPaginatedResponse<N8nWorkflowListItem>>('/workflows', queryParams);
      
      const formatted = response.data.map(formatWorkflow).join('\n\n---\n\n');
      const output = {
        count: response.data.length,
        workflows: response.data,
        nextCursor: response.nextCursor
      };
      
      let text = `Found ${response.data.length} workflow(s):\n\n${formatted}`;
      if (response.nextCursor) {
        text += `\n\n_More results available. Use cursor: ${response.nextCursor}_`;
      }
      
      return {
        content: [{ type: 'text', text }],
        structuredContent: output
      };
    }
  • Registration of the n8n_list_workflows tool, specifying its schema and documentation.
      server.registerTool(
        'n8n_list_workflows',
        {
          title: 'List n8n Workflows',
          description: `List all workflows in the n8n instance with optional filtering.
    
    Args:
      - active (boolean, optional): Filter by active status
      - tags (string, optional): Filter by tag IDs (comma-separated)
      - name (string, optional): Filter by name (partial match)
      - projectId (string, optional): Filter by project ID
      - limit (number): Maximum results (default: 100, max: 250)
      - cursor (string, optional): Pagination cursor from previous response
    
    Returns:
      List of workflows with id, name, active status, created/updated timestamps, and tags.
      Includes nextCursor for pagination if more results exist.`,
          inputSchema: ListWorkflowsSchema,
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false
          }
        },

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

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