Skip to content
New issue

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

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

Already on GitHub? # to your account

fix(core): Fix manually running a pinned trigger with offloading enabled #12491

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Jan 7, 2025

Summary

Until recently, manual executions in scaling mode ran in the main process, so some execution details were never persisted in the database - those details remained in memory and were used in the same process. But as #11284, we offload manual executions from mains to workers if a flag is enabled. Offloading persists manual execution details to the DB, so that the worker can retrieve them to know how to run the manual execution.

There is an edge case where, if the manual execution has one or more pinned triggers, we set the first pinned trigger in the execution details. In this case we collect execution details too early, failing to account for the pinned trigger that was set. This PR fixes this edge case.

Test

The execution flow is not yet easily testable.

To test manually:

  • Start a main with export OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true
  • Start a worker
  • Create a workflow with a webhook node, pin its output, run the workflow
  • Unpin the webhook node, run the workflow

Expected: The webhook should use its pinned data the first time, and wait for a webhook the second time.

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/PAY-2442/fix-manually-running-a-pinned-webhook-with-offloading-enabled

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

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...es/cli/src/workflows/workflow-execution.service.ts 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Jan 7, 2025
Copy link
Contributor

@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.

Works as described 🚀

Copy link
Contributor

github-actions bot commented Jan 8, 2025

✅ All Cypress E2E specs passed

Copy link

cypress bot commented Jan 8, 2025

n8n    Run #8657

Run Properties:  status check passed Passed #8657  •  git commit 5724270d27: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ivov 🗃️ e2e/*
Project n8n
Branch Review pay-2442
Run status status check passed Passed #8657
Run duration 04m 54s
Commit git commit 5724270d27: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ivov 🗃️ e2e/*
Committer Iván Ovejero
View all properties for this run ↗︎

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

@ivov ivov merged commit be2dcff into master Jan 8, 2025
37 checks passed
@ivov ivov deleted the pay-2442 branch January 8, 2025 12:39
@github-actions github-actions bot mentioned this pull request Jan 8, 2025
@janober
Copy link
Member

janober commented Jan 9, 2025

Got released with n8n@1.74.0

# for free to join this conversation on GitHub. Already have an account? # 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.

3 participants