Skip to content

fix(core): Prevent re-entry during workflow activation #17965

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

Conversation

ivov
Copy link
Member

@ivov ivov commented Aug 4, 2025

Summary

We have a guarantee that an instance is a leader or a follower by the time we reach workflow activation, but there is a race condition where workflow activation is triggered in reaction to a leadership acquisition while regular workflow activation on bootup is ongoing.

Workflow activation logic ideally should be atomic, possibly by queuing activations, but that is a larger refactor that will need to be its own dedicated effort. For now this PR prevents re-entry to protect against the race condition.

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/CAT-1069

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)

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

cubic analysis

No issues found across 2 files. Review in cubic

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Aug 4, 2025
@ivov ivov requested a review from tomi August 4, 2025 11:32
Copy link
Collaborator

@tomi tomi left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Copy link

currents-bot bot commented Aug 4, 2025

E2E Tests: n8n tests passed after 4m 7.4s

🟢 500 · 🔴 0 · ⚪️ 0

View Run Details

Run Details

  • Project: n8n

  • Groups: 1

  • Framework: Currents

  • Run Status: Passed

  • Commit: 22cc07a

  • Spec files: 105

  • Overall tests: 500

  • Duration: 4m 7.4s

  • Parallelization: 1


This message was posted automatically by currents.dev | Integration Settings

@ivov ivov merged commit e8dad4e into master Aug 4, 2025
47 checks passed
@ivov ivov deleted the cat-1069-bug-enterprise-client-bakkt-schedule-trigger-node-firing branch August 4, 2025 18:43
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants