Skip to content

Conversation

RomanDavydchuk
Copy link
Contributor

Summary

Fix a bug where the node with multiple outputs returns an empty object in the first output when "Always Output Data" is true, even if other outputs have data

Workflow to test:

{
  "name": "Always Output Data with Multiple Outputs",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        96
      ],
      "id": "ab24ff83-386c-4508-9766-b296ac2fe0f1",
      "name": "When clicking ‘Execute workflow’"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "f950b942-88db-4149-8186-c657d4a646b2",
              "leftValue": false,
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        224,
        0
      ],
      "id": "894869a3-7380-4728-9676-d998cb57f474",
      "name": "Always Output Data == true",
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "f950b942-88db-4149-8186-c657d4a646b2",
              "leftValue": false,
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        224,
        192
      ],
      "id": "2e2ac3d6-6694-4b44-997f-032de4af20f7",
      "name": "Always Output Data == false"
    }
  ],
  "pinData": {
    "When clicking ‘Execute workflow’": [
      {
        "json": {
          "foo": "bar"
        }
      }
    ]
  },
  "connections": {
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Always Output Data == true",
            "type": "main",
            "index": 0
          },
          {
            "node": "Always Output Data == false",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "2d0af639-3014-4491-afd3-ee81d1c1bcd9",
  "meta": {
    "instanceId": "eeda9e3069aca300d1dfceeb64beb5b53d715db44a50461bbc5cb0cf6daa01e3"
  },
  "id": "25lWZUaSQnoiwP7h",
  "tags": []
}

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/NODE-3296/community-issue-switch-node-bug-correct-eval-wrong-conclusion
Closes #14334

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 Jul 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 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 Jul 23, 2025
@ShireenMissi ShireenMissi self-requested a review August 11, 2025 08:08
@RomanDavydchuk RomanDavydchuk marked this pull request as ready for review August 14, 2025 11:48
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 3 files. Review in cubic

Copy link
Contributor

@ShireenMissi ShireenMissi left a comment

Choose a reason for hiding this comment

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

Tested locally and it works as expected 🎉

Copy link

currents-bot bot commented Aug 14, 2025

E2E Tests: n8n tests passed after 5m 19.8s

🟢 514 · 🔴 0 · ⚪️ 0

View Run Details

Run Details

  • Project: n8n

  • Groups: 3

  • Framework: Playwright

  • Run Status: Passed

  • Commit: ee7597f

  • Spec files: 107

  • Overall tests: 514

  • Duration: 5m 19.8s

  • Parallelization: 3

Groups

GroupId Results Spec Files Progress
ui 🟢 39 · 🔴 0 · ⚪️ 0 13 / 13
ui:isolated 🟢 6 · 🔴 0 · ⚪️ 0 2 / 2
No name 🟢 469 · 🔴 0 · ⚪️ 0 92 / 92


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

@ShireenMissi ShireenMissi merged commit f1a87af into master Aug 14, 2025
47 checks passed
@ShireenMissi ShireenMissi deleted the node-3296-community-issue-switch-node-bug-correct-eval-wrong-conclusion branch August 14, 2025 16:00
This was referenced Aug 18, 2025
@janober
Copy link
Member

janober commented Aug 18, 2025

Got released with n8n@1.108.0

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 Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch Node bug ("correct eval - wrong conclusion")
3 participants