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): Run full manual execution when a trigger is executed even if run data exists #13194

Merged

Conversation

despairblue
Copy link
Contributor

@despairblue despairblue commented Feb 11, 2025

Summary

Run a full manual execution when a trigger is executed even if run data exists. Before it would try to run a partial execution which is not possible in that case.

Doing this as a partial execution is not possible, because running the trigger will remove all run data from the trigger and all it's children, thus turning this into a full execution.
If the trigger is a webhook trigger we need to activate it and listen for incoming data. If we are in the partial execution logic we can't do that anymore as we are too deep down to go back and register the webhook.

That's why we check in the WorkflowExecutionService if the destination node is a trigger. If that is the case we remove the run data and thus force the full manual execution flow.

This is a bit of a workaround until we have decided how to structure this better, probably running the partial execution logic first (before creating the execution in the db) to find out if we can run this partially or if we need to check what trigger to use and if we need to wait for a webhook.

Before

PAY-1998-before.mp4

After

PAY-1998-after.mp4

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/PAY-1998/clicking-run-on-a-trigger-produces-an-error

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)

@despairblue despairblue force-pushed the pay-1998-clicking-run-on-a-trigger-produces-an-error branch from 265b2c7 to b59274c Compare February 11, 2025 13:27
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Feb 11, 2025
@despairblue despairblue changed the title fix: Run full manual execution when a trigger is executed even if run data exists fix(core): Run full manual execution when a trigger is executed even if run data exists Feb 11, 2025
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@despairblue despairblue marked this pull request as ready for review February 11, 2025 13:49
@despairblue despairblue force-pushed the pay-1998-clicking-run-on-a-trigger-produces-an-error branch 2 times, most recently from 26a73c4 to c2247d3 Compare February 13, 2025 13:27
Copy link

cypress bot commented Feb 13, 2025

n8n    Run #9261

Run Properties:  status check passed Passed #9261  •  git commit c2247d3934: 🌳 pay-1998-clicking-run-on-a-trigger-produces-an-error 🖥️ browsers:node18.12.0...
Project n8n
Branch Review pay-1998-clicking-run-on-a-trigger-produces-an-error
Run status status check passed Passed #9261
Run duration 04m 43s
Commit git commit c2247d3934: 🌳 pay-1998-clicking-run-on-a-trigger-produces-an-error 🖥️ browsers:node18.12.0...
Committer Danny Martini
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 3
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 436
View all changes introduced in this branch ↗︎

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.

couple questions

@despairblue despairblue force-pushed the pay-1998-clicking-run-on-a-trigger-produces-an-error branch from c2247d3 to 57f28f2 Compare February 13, 2025 17:54
@despairblue despairblue requested a review from tomi February 13, 2025 17:54
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.

🚀

Copy link
Contributor

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link
Contributor

✅ All Cypress E2E specs passed

@despairblue despairblue merged commit 66acb1b into master Feb 14, 2025
50 checks passed
@despairblue despairblue deleted the pay-1998-clicking-run-on-a-trigger-produces-an-error branch February 14, 2025 10:00
@github-actions github-actions bot mentioned this pull request Feb 17, 2025
@janober
Copy link
Member

janober commented Feb 20, 2025

Got released with n8n@1.80.1

# 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