Skip to main content
Glama

deployed

Lists all workflows in an n8n instance, replacing the "n8n list:workflow" command for workflow management and deployment.

Instructions

List all workflows in n8n instance - replaces "n8n list:workflow" command

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool registration and schema definition for the 'deployed' tool. Provides empty input schema (no parameters) and description.
      name: 'deployed',
      description: 'List all workflows in n8n instance - replaces "n8n list:workflow" command',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Tool handler dispatch case for 'deployed' tool within the central ToolHandler.handleTool() method. Delegates to N8nManager.listDeployedWorkflows().
    case 'deployed':
      return await this.n8nManager.listDeployedWorkflows();
  • Core handler implementation in N8nManager. Executes 'n8n list:workflow --all', parses id|name output, checks active status separately, filters warnings, and returns formatted markdown list of deployed workflows with status indicators.
    async listDeployedWorkflows(): Promise<any> {
      try {
        const command = 'n8n list:workflow --all';
        
        console.error(`Executing: ${command}`);
        const { stdout, stderr } = await execAsync(command);
        
        if (this.hasRealError(stderr, stdout)) {
          throw new Error(stderr);
        }
    
        // Parse the output - format is "id|name"
        const lines = stdout.split('\n').filter(line => line.trim() && !line.includes('deprecation'));
        const workflows = [];
        
        // Get active workflow IDs for status
        let activeIds: string[] = [];
        try {
          const activeCommand = 'n8n list:workflow --active=true --onlyId';
          const { stdout: activeStdout } = await execAsync(activeCommand);
          activeIds = activeStdout.split('\n').filter(id => id.trim()).map(id => id.trim());
        } catch {
          // If we can't get active status, continue without it
        }
        
        for (const line of lines) {
          // Skip warning lines
          if (line.includes('There are deprecations') || line.includes('DB_SQLITE') || line.includes('N8N_RUNNERS')) {
            continue;
          }
          
          // Parse n8n list output format: id|name
          const parts = line.split('|');
          if (parts.length >= 2) {
            const id = parts[0].trim();
            workflows.push({
              id: id,
              name: parts[1].trim(),
              status: activeIds.includes(id) ? 'active' : 'inactive',
            });
          }
        }
    
        let output = `📋 Deployed Workflows (${workflows.length}):\n\n`;
        
        if (workflows.length === 0) {
          output += 'No workflows found in n8n instance.\n';
        } else {
          for (const wf of workflows) {
            const statusIcon = wf.status === 'active' ? '🟢' : '⚪';
            output += `${statusIcon} [${wf.id}] ${wf.name}\n`;
          }
        }
    
        return {
          content: [
            {
              type: 'text',
              text: output,
            },
          ],
        };
      } catch (error: any) {
        throw new Error(`Failed to list workflows: ${error.message}`);
      }

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/mckinleymedia/mcflow-mcp'

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