Skip to main content
Glama
DrBalls

n8n MCP Server

by DrBalls

n8n_run_workflow

Execute a specific n8n workflow manually by providing its ID and optional input data to trigger automation processes.

Instructions

Execute a workflow manually with optional input data.

Args:

  • id (string): Workflow ID to run

  • data (object, optional): Input data to pass to the workflow's first node

Returns: Execution result with:

  • executionId: ID of this execution

  • status: Current status

  • data: Output data from the workflow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesWorkflow ID to run
dataNoInput data to pass to the workflow

Implementation Reference

  • The handler function for n8n_run_workflow that executes the workflow via a POST request.
    async (params: z.infer<typeof RunWorkflowSchema>) => {
      const body = params.data ? { data: params.data } : undefined;
      const execution = await post<N8nExecution>(`/workflows/${params.id}/run`, body);
      
      const text = `🚀 Workflow execution started!\n\n- Execution ID: ${execution.id}\n- Status: ${execution.status}\n- Started: ${execution.startedAt}`;
      
      return {
        content: [{ type: 'text', text }],
        structuredContent: execution
      };
  • Registration of the n8n_run_workflow tool.
      server.registerTool(
        'n8n_run_workflow',
        {
          title: 'Run n8n Workflow',
          description: `Execute a workflow manually with optional input data.
    
    Args:
      - id (string): Workflow ID to run
      - data (object, optional): Input data to pass to the workflow's first node
    
    Returns:
      Execution result with:
      - executionId: ID of this execution
      - status: Current status
      - data: Output data from the workflow`,
          inputSchema: RunWorkflowSchema,
          annotations: {
            readOnlyHint: false,
            destructiveHint: false,
            idempotentHint: false,
            openWorldHint: true
          }
        },
  • Schema definition for the n8n_run_workflow input parameters.
    export const RunWorkflowSchema = z.object({
      id: z.string().min(1)
        .describe('Workflow ID to run'),
      data: z.record(z.unknown()).optional()
        .describe('Input data to pass to the workflow')
    }).strict();

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