mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 03:42:16 +00:00
fix(core): Return correct trigger count for nodes with multiple webhooks (#14300)
Co-authored-by: Danny Martini <danny@n8n.io> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -673,10 +673,23 @@ export class ActiveWorkflowManager {
|
||||
const triggerFilter = (nodeType: INodeType) =>
|
||||
!!nodeType.trigger && !nodeType.description.name.includes('manualTrigger');
|
||||
|
||||
// Retrieve unique webhooks as some nodes have multiple webhooks
|
||||
const workflowWebhooks = WebhookHelpers.getWorkflowWebhooks(
|
||||
workflow,
|
||||
additionalData,
|
||||
undefined,
|
||||
true,
|
||||
);
|
||||
|
||||
const uniqueWebhooks = workflowWebhooks.reduce<Set<string>>((acc, webhook) => {
|
||||
acc.add(webhook.node);
|
||||
return acc;
|
||||
}, new Set());
|
||||
|
||||
return (
|
||||
workflow.queryNodes(triggerFilter).length +
|
||||
workflow.getPollNodes().length +
|
||||
WebhookHelpers.getWorkflowWebhooks(workflow, additionalData, undefined, true).length
|
||||
uniqueWebhooks.size
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user