get_workflow_webhooks
Retrieve webhook URLs for a specific n8n workflow. Provide the workflow ID to get its webhook endpoints.
Instructions
Get webhook URLs for a workflow
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | Yes | The ID of the workflow |
Implementation Reference
- src/handlers.ts:166-169 (handler)Handler case for 'get_workflow_webhooks': validates args with WorkflowIdSchema and calls client.getWorkflowWebhooks(workflowId)
case "get_workflow_webhooks": { const { workflowId } = WorkflowIdSchema.parse(args); return await client.getWorkflowWebhooks(workflowId); } - src/handlers.ts:12-14 (schema)WorkflowIdSchema: Zod schema used to validate the workflowId argument for get_workflow_webhooks (and other workflow tools)
const WorkflowIdSchema = z.object({ workflowId: z.string(), }); - src/tools.ts:329-342 (registration)Tool registration metadata: name 'get_workflow_webhooks', description 'Get webhook URLs for a workflow', inputSchema requiring workflowId string
{ name: "get_workflow_webhooks", description: "Get webhook URLs for a workflow", inputSchema: { type: "object", properties: { workflowId: { type: "string", description: "The ID of the workflow", }, }, required: ["workflowId"], }, }, - src/n8n-client.ts:166-179 (helper)Client implementation getWorkflowWebhooks(): fetches the workflow, filters for n8n-nodes-base.webhook nodes, and returns an array of webhook objects with nodeId, nodeName, path, method, and webhookUrl
async getWorkflowWebhooks(workflowId: string) { const workflow = await this.getWorkflow(workflowId); const webhookNodes = workflow.nodes.filter( (node: any) => node.type === "n8n-nodes-base.webhook" ); return webhookNodes.map((node: any) => ({ nodeId: node.id, nodeName: node.name, path: node.parameters?.path || node.webhookId, method: node.parameters?.httpMethod || "GET", webhookUrl: `${process.env.N8N_URL}/webhook/${node.parameters?.path || node.webhookId}`, })); }