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

Merge node fails to output data on false branch during test step #13593

Open
antonlvovych opened this issue Feb 28, 2025 · 7 comments
Open

Merge node fails to output data on false branch during test step #13593

antonlvovych opened this issue Feb 28, 2025 · 7 comments
Labels
in linear Issue or PR has been created in Linear for internal review In Review We are reviewing the issue

Comments

@antonlvovych
Copy link

antonlvovych commented Feb 28, 2025

Bug Description

When executing a workflow containing a Merge node, the output is inconsistent depending on how the test is performed. Specifically, when using the "Test step" feature on the Merge node, the output is correct on the first execution but fails on the second execution. This issue only occurs for the FALSE branch, while the TRUE branch behaves as expected.

Possibly related to #12436

To Reproduce

  1. Open the workflow using the provided file: My_workflow.json
  2. Select the Merge node and click on Test step.
  3. Observe the output:
    • On the first execution, the Merge node outputs 1 item as expected.
      Image
    • On the second execution, the Merge node outputs nothing, which is incorrect.
      Image
  4. Click Test workflow instead of Test step and observe that the output of the Merge node is correct (1 item).
  5. Change the condition to go through the TRUE branch and repeat steps 2-4. The issue does not reproduce for the TRUE branch, and it consistently produces the output data on Test step.

Expected behavior

The Merge node should consistently output 1 item regardless of how many times Test step is executed. The output should not vary between the first and second execution, and the behavior should be identical for both the TRUE and FALSE branches.

Operating System

docker (self-hosted)

n8n Version

1.80.4

Node.js Version

20.18.3

Database

PostgreSQL

Execution mode

queue

@Joffcom
Copy link
Member

Joffcom commented Feb 28, 2025

Hey @antonlvovych,

We have created an internal ticket to look into this which we will be tracking as "GHC-999"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Feb 28, 2025
@Joffcom
Copy link
Member

Joffcom commented Feb 28, 2025

Hey @antonlvovych,

Interestingly I expect the merge node not to ever output data in the way you have it set up as it should always have the data in both inputs before moving on. I will pass this to the nodes team to resolve.

@Joffcom Joffcom added In Review We are reviewing the issue Needs Feedback Waiting for further input or clarification. labels Feb 28, 2025
@antonlvovych
Copy link
Author

@Joffcom if that’s the case, what would be the correct way to merge 2 inputs into 1 and continue the workflow regardless of which input arrives? I need the workflow to proceed with whichever branch completes and without waiting for both inputs.

Here is my workflow and it works just fine except "Test step" on Merge node in case of FALSE branch.
Image

@Joffcom Joffcom removed the Needs Feedback Waiting for further input or clarification. label Feb 28, 2025
@Joffcom
Copy link
Member

Joffcom commented Mar 1, 2025

Hey @antonlvovych

The way I have always dealt with that is just put both paths into the same input so drop the merge and have the false and edit edit field node both go into the http request node then the node will loop over the items for both inputs as needed.

@Joffcom Joffcom added the Needs Feedback Waiting for further input or clarification. label Mar 1, 2025
@antonlvovych
Copy link
Author

@Joffcom thank you 🙌

@Joffcom Joffcom removed the Needs Feedback Waiting for further input or clarification. label Mar 3, 2025
@antonlvovych
Copy link
Author

@Joffcom here is one more similar issue

Test workflow works just fine

Image

If I try to run not the entire workflow, but only a code node with Test step - getting this error

Image Image

@antonlvovych
Copy link
Author

And for the Set node it's also buggy

Executing entire workflow with Test workflow

Image

Executing just one step with Test step

Image

No output data when executing Test step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review In Review We are reviewing the issue
Projects
None yet
Development

No branches or pull requests

2 participants