webhook_urls
Retrieve webhook URLs for workflow nodes to enable external system integration and trigger automation processes.
Instructions
Get webhook URLs for a webhook node in a workflow
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | Yes | ||
| nodeId | Yes |
Implementation Reference
- src/index.ts:498-502 (handler)MCP server handler for webhook_urls tool: resolves workflow ID alias and delegates to n8nClient.getWebhookUrlsprivate async handleWebhookUrls(args: { workflowId: string | number; nodeId: string }) { const workflowId = this.resolveWorkflowId(args.workflowId); const urls = await this.n8nClient.getWebhookUrls(workflowId, args.nodeId); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(urls), null, 2) }] }; }
- src/n8n-client.ts:753-765 (helper)Core implementation: fetches workflow, finds webhook node by ID, validates type and path param, constructs testUrl and productionUrl based on n8n baseUrlasync getWebhookUrls(workflowId: string | number, nodeId: string): Promise<N8nWebhookUrls> { const workflow = await this.getWorkflow(workflowId); const webhookNode = workflow.nodes.find((node) => node.id === nodeId); if (!webhookNode) throw new Error(`Node with ID '${nodeId}' not found in workflow ${workflowId}`); if (webhookNode.type !== 'n8n-nodes-base.webhook') { throw new Error(`Node '${nodeId}' is not a webhook node (type: ${webhookNode.type})`); } const path = webhookNode.parameters?.path || ''; if (!path) throw new Error(`Webhook node '${nodeId}' does not have a path configured`); const testUrl = `${this.baseUrl}/webhook-test/${path}`; const productionUrl = `${this.baseUrl}/webhook/${path}`; return { testUrl, productionUrl }; }
- src/index.ts:199-200 (registration)Tool registration entry in ListToolsResponse, defines name, description, and input schema{ name: 'webhook_urls', description: 'Get webhook URLs for a webhook node in a workflow', inputSchema: { type: 'object', properties: { workflowId: { oneOf: [{ type: 'string' }, { type: 'number' }] }, nodeId: { type: 'string' } }, required: ['workflowId', 'nodeId'] } }, { name: 'run_once', description: 'Execute a workflow manually once and return execution details', inputSchema: { type: 'object', properties: { workflowId: { oneOf: [{ type: 'string' }, { type: 'number' }] }, input: { type: 'object' } }, required: ['workflowId'] } },
- src/types.ts:291-294 (schema)TypeScript interface defining the output shape of webhook URLs (testUrl and productionUrl)export interface N8nWebhookUrls { testUrl: string; productionUrl: string; }