Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/n8nPublic

fix(nodes): Prevent duplicate webhooks on GitLab/GitHub trigger publish#25996

Open
nielskaspers wants to merge 1 commit inton8n-io:masterfrom
nielskaspers:fix/webhook-duplicate-on-publish
Open

fix(nodes): Prevent duplicate webhooks on GitLab/GitHub trigger publish#25996
nielskaspers wants to merge 1 commit inton8n-io:masterfrom
nielskaspers:fix/webhook-duplicate-on-publish

Conversation

@nielskaspers
Copy link

Summary

  • FixescheckExists() in bothGitlabTrigger.node.ts andGithubTrigger.node.ts to fall back to URL-based webhook matching when the stored webhook ID becomes stale
  • When the stored ID returns 404, the method now lists all repository webhooks and matches by the n8n webhook URL before giving up
  • Adds tests for the new fallback behavior inGithubTrigger.node.test.ts

The problem

When publishing a workflow,checkExists() only checks if the storedwebhookData.webhookId exists on the platform. If that ID becomes stale (after workflow import, node copy, or database reset), the check returnsfalse andcreate() adds a new webhook — creating a duplicate on every publish.

The fix

Both trigger nodes now follow this strategy incheckExists():

  1. Fast path: Try the stored webhook ID (existing behavior, no extra API call)
  2. Fallback: If stored ID returns 404, list all webhooks for the repo and match by URL
  3. Recovery: If a URL match is found, update the stored ID so future checks use the fast path

This is the same pattern GitHub'screate() method already uses in its 422 error handler — moved tocheckExists() where it prevents the problem instead of recovering from it.

Fixes#25381

Test plan

  • Updated existingcheckExists test to includegetNodeWebhookUrl mock
  • Added test: returns true when stored webhook ID exists (fast path)
  • Added test: falls back to URL matching when stored ID returns 404
  • Added test: returns false when stored ID is 404 and no URL match
  • Added test: finds webhook by URL when no stored ID exists
  • Added test: returns false when no stored ID and no URL match
  • Manual testing with GitLab/GitHub webhook trigger workflows

When a workflow with a GitLab or GitHub trigger is published, thecheckExists() method only verifies the stored webhook ID. If that IDbecomes stale (e.g. after workflow import, node copy, or databasereset), the lookup returns 404 and a new duplicate webhook is created.This adds a URL-based fallback: when the stored ID fails, list allwebhooks for the repository and match by the n8n webhook URL. Thisprevents duplicate webhook creation while preserving the fast-pathID lookup for the common case.Fixesn8n-io#25381
@n8n-assistantn8n-assistantbot added communityAuthored by a community member node/improvementNew feature or request in linearIssue or PR has been created in Linear for internal review labelsFeb 19, 2026
@n8n-assistant
Copy link
Contributor

Hey@nielskaspers,

Thank you for your contribution. We appreciate the time and effort you’ve taken to submit this pull request.

Before we can proceed, please ensure the following:
•Tests are included for any new functionality, logic changes or bug fixes.
•The PR aligns with our contribution guidelines.

Regarding new nodes:
We no longer accept new nodes directly into the core codebase. Instead, we encourage contributors to follow our Community Node Submission Guide to publish nodes independently.

If your node integrates with an AI service that you own or represent, please emailnodes@n8n.io and we will be happy to discuss the best approach.

About review timelines:
This PR has been added to our internal tracker as "GHC-6929". While we plan to review it, we are currently unable to provide an exact timeframe. Our goal is to begin reviews within a month, but this may change depending on team priorities. We will reach out when the review begins.

Thank you again for contributing to n8n.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

communityAuthored by a community memberin linearIssue or PR has been created in Linear for internal reviewnode/improvementNew feature or request

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Webhook duplicates on each publish Gitlab

1 participant

@nielskaspers

Comments


[8]ページ先頭

©2009-2026 Movatter.jp