Skip to main content
Glama

n8n_trigger_webhook

Trigger active n8n workflows by sending HTTP requests to their webhook URLs, enabling automated workflow execution with custom data and headers.

Instructions

Trigger a workflow via its webhook URL. The workflow must be active and have a Webhook trigger node.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
webhookUrlYesFull webhook URL (e.g., https://n8n.example.com/webhook/xxx-xxx-xxx)
methodNoHTTP method (default: POST)
dataNoData to send with the webhook request
headersNoAdditional HTTP headers

Implementation Reference

  • The main handler function for the 'n8n_trigger_webhook' tool. It validates the webhook URL, calls the N8nApiClient to trigger the webhook with provided method, data, and headers, and returns a formatted success response with the result.
    n8n_trigger_webhook: async ( client: N8nApiClient, args: Record<string, unknown> ): Promise<ToolResult> => { const webhookUrl = args.webhookUrl as string; if (!webhookUrl) { throw new Error('Webhook URL is required'); } const result = await client.triggerWebhook(webhookUrl, { method: (args.method as 'GET' | 'POST' | 'PUT' | 'DELETE') || 'POST', data: args.data as Record<string, unknown> | undefined, headers: args.headers as Record<string, string> | undefined, }); return { content: [ { type: 'text' as const, text: JSON.stringify({ success: true, message: 'Webhook triggered successfully', response: result, }, null, 2), }, ], }; },
  • The tool definition registration in the executionTools array, including name, description, and input schema. This is included in allTools and served via MCP list tools endpoint.
    { name: 'n8n_trigger_webhook', description: 'Trigger a workflow via its webhook URL. The workflow must be active and have a Webhook trigger node.', inputSchema: { type: 'object', properties: { webhookUrl: { type: 'string', description: 'Full webhook URL (e.g., https://n8n.example.com/webhook/xxx-xxx-xxx)', }, method: { type: 'string', enum: ['GET', 'POST', 'PUT', 'DELETE'], description: 'HTTP method (default: POST)', }, data: { type: 'object', description: 'Data to send with the webhook request', }, headers: { type: 'object', description: 'Additional HTTP headers', }, }, required: ['webhookUrl'], }, },
  • src/server.ts:128-131 (registration)
    Dynamic handler dispatch in the MCP server for execution tools, including n8n_trigger_webhook, by checking if the tool name exists in executionToolHandlers and calling the corresponding handler.
    if (name in executionToolHandlers) { const handler = executionToolHandlers[name as keyof typeof executionToolHandlers]; return handler(client, args); }

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/alicankiraz1/cursor-n8n-builder'

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