Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Return correct trigger count for nodes with multiple webhooks #14300

Conversation

MarcL
Copy link
Contributor

@MarcL MarcL commented Mar 31, 2025

Summary

This PR addresses an issue where the workflow trigger count was incorrectly inflated when a single node, such as the Form Trigger, registers multiple webhooks (e.g. a form trigger has a webhook for both HTTP GET and POST methods). We want to count these as a single trigger for the node.

It adds an integration test to confirm we're now writing the correct trigger count to the database.

Related Linear tickets, Github issues, and Community forum posts

Fixes: PAY-2146
Issues: #13820

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • [ ] Docs updated or follow-up ticket created.
  • Tests included.
  • [ ] PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

Verified

This commit was signed with the committer’s verified signature.
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Mar 31, 2025
@MarcL MarcL force-pushed the pay-2146-logic-for-calculating-active-workflows-needs-adjusting-for branch from 901aadc to 6f5e6a1 Compare March 31, 2025 16:07
MarcL and others added 5 commits April 1, 2025 08:59

Verified

This commit was signed with the committer’s verified signature.

Verified

This commit was signed with the committer’s verified signature.

Verified

This commit was signed with the committer’s verified signature.
@MarcL MarcL force-pushed the pay-2146-logic-for-calculating-active-workflows-needs-adjusting-for branch from c55137f to fd53a1e Compare April 1, 2025 10:42
@despairblue
Copy link
Contributor

image
Not sure what's going on here. Locally it works. May be a caching issue 🤔

@despairblue despairblue force-pushed the pay-2146-logic-for-calculating-active-workflows-needs-adjusting-for branch from 91a3e38 to c016f98 Compare April 1, 2025 10:56
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Comment on lines -49 to -56
export async function testVersionedTriggerNode(
Trigger: new () => VersionedNodeType,
version?: number,
options: TestTriggerNodeOptions = {},
) {
return await testTriggerNode(getNodeVersion(Trigger, version), options);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find 👍🏾

Copy link

cypress bot commented Apr 3, 2025

n8n    Run #10087

Run Properties:  status check passed Passed #10087  •  git commit e23c1ae5ae: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 MarcL 🗃️ e2e/*
Project n8n
Branch Review pay-2146-logic-for-calculating-active-workflows-needs-adjusting-for
Run status status check passed Passed #10087
Run duration 03m 37s
Commit git commit e23c1ae5ae: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 MarcL 🗃️ e2e/*
Committer Marc Littlemore
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 5
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 475
View all changes introduced in this branch ↗︎

Copy link
Contributor

github-actions bot commented Apr 3, 2025

✅ All Cypress E2E specs passed

@MarcL MarcL merged commit 39e2d35 into master Apr 4, 2025
36 checks passed
@MarcL MarcL deleted the pay-2146-logic-for-calculating-active-workflows-needs-adjusting-for branch April 4, 2025 13:15
guillaumejacquart pushed a commit that referenced this pull request Apr 4, 2025
…oks (#14300)

Co-authored-by: Danny Martini <danny@n8n.io>
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
@github-actions github-actions bot mentioned this pull request Apr 7, 2025
@janober
Copy link
Member

janober commented Apr 7, 2025

Got released with n8n@1.87.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants