#39746·n8n

`alwaysOutputData` doesn't force output on a dataTable "get" node nested inside splitInBatches + branching; execution silently ends instead of erroring

Author: gomesmariaaliceCreated Sep 28, 2026Updated Sep 28, 2026
Labelsteam:catsstatus:in-linearstatus:team-assigned

Describe the problem/error/question

A dataTable "get" node (resource: row, operation: get) with alwaysOutputData: true, querying a table that returns zero matching rows, runs successfully but emits zero output items instead of the synthetic empty item alwaysOutputData is supposed to force through. This happens specifically when the node is nested several levels deep inside a splitInBatches (batchSize: 1) loop, after branching through an if node.

Worse: a code node inserted immediately downstream — also with alwaysOutputData: true, built specifically to force exactly one item through regardless of upstream output — is never invoked at all. The whole execution silently terminates the branch the moment the original node returns zero items, without even scheduling the next node in the graph.

The execution reports status: "success" with no error, even though splitInBatches' own internal context data shows the loop did NOT actually finish (done: false, noItemsLeft: false).

Reproduced 100% consistently across 7 separate execution attempts, in both manual (test) execution mode and real production/trigger-mode execution (temporarily activated the workflow specifically to rule out a manual-mode-only limitation — same failure in both).

Workarounds tried, none worked:

  • retryOnFail: true on the affected node and all other Data Table nodes in the loop — no effect (no error for retry to react to)
  • Changed returnAll: false, limit: 1 → returnAll: true — no effect, same zero-item output
  • Inserted a fallback code node downstream with its own alwaysOutputData: true — never invoked at all
  • Tested in real production/trigger mode, not just manual — identical failure

Impact: blocks any workflow needing a "check if a state row exists yet, proceed with defaults if not" pattern (a common idempotency/dedup check) when nested inside a paced per-item loop with prior branching.

Note: this instance runs executionMode: scaling (single-main) — flagging this since the bug may be specific to how the scaling/worker execution path handles alwaysOutputData inside loops, versus regular mode.

What is the error message (if any)?

None. This is the core of the bug: no error is raised anywhere. The affected node's own run reports "executionStatus":"success", and the overall execution also reports "status":"success". The only evidence something is wrong is (a) the affected node's output is [[]] (zero items) despite alwaysOutputData:true, and (b) the splitInBatches node's internal contextData shows "done": false, "noItemsLeft": false — i.e. n8n's own bookkeeping knows the loop isn't finished, but the execution stops anyway with no error surfaced.

Please share your workflow/screenshots/recording

Minimal reproduction (trimmed from our real workflow — removed the Salesloft/Instantly dedup-reroute branches, which are never reached before the bug hits, to keep this small):

json
{
  "nodes": [
    { "id": "trigger", "name": "Daily 07:00 Trigger", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.3, "position": [0, 0], "parameters": { "rule": { "interval": [{ "triggerAtHour": 7 }] } } },
    { "id": "readqueue", "name": "Read Allbound Queue", "type": "n8n-nodes-base.dataTable", "typeVersion": 1.1, "position": [224, 0], "parameters": { "operation": "get", "dataTableId": { "__rl": true, "mode": "id", "value": "vUL90T2AKJ2k0cqd" }, "returnAll": true } },
    { "id": "testgroup", "name": "Test group only", "type": "n8n-nodes-base.filter", "typeVersion": 2.2, "position": [336, 160], "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "loose", "version": 2 }, "conditions": [{ "leftValue": "={{ $json.holdout_group }}", "rightValue": "test", "operator": { "type": "string", "operation": "equals" } }], "combinator": "and" } } },
    { "id": "mmseg", "name": "MM Segments Only", "type": "n8n-nodes-base.filter", "typeVersion": 2.2, "position": [224, 912], "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "loose", "version": 2 }, "conditions": [{ "leftValue": "={{ $json.segment }}", "rightValue": "General", "operator": { "type": "string", "operation": "equals" } }], "combinator": "or" } } },
    { "id": "cap", "name": "Cap Daily Volume", "type": "n8n-nodes-base.limit", "typeVersion": 1, "position": [448, 912], "parameters": { "maxItems": 20 } },
    { "id": "loop", "name": "Loop Enrollment", "type": "n8n-nodes-base.splitInBatches", "typeVersion": 3, "position": [672, 912], "parameters": { "options": {} } },
    { "id": "resolvestage", "name": "Resolve Desired Stage", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [448, 0], "parameters": { "assignments": { "assignments": [{ "id": "desired-stage", "name": "desiredStage", "value": "={{ $json.stage || \"Total SAM\" }}", "type": "string" }] }, "includeOtherFields": true, "options": {} } },
    { "id": "verifyemail", "name": "Verify Contact Email", "type": "@n8n/n8n-nodes-langchain.mcpClient", "typeVersion": 1.1, "position": [912, 912], "parameters": { "endpointUrl": "https://mcp.example.com/mcp", "authentication": "mcpOAuth2Api", "tool": { "__rl": true, "mode": "list", "value": "VerifyEmail" }, "parameters": { "mappingMode": "defineBelow", "value": { "email": "={{ $json.email }}" }, "schema": [{ "id": "email", "displayName": "email", "required": true, "type": "string" }] }, "options": { "timeout": 60000 } }, "retryOnFail": true, "maxTries": 3, "waitBetweenTries": 2000 },
    { "id": "attachstatus", "name": "Attach Verify Status", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [1120, 912], "parameters": { "mode": "runOnceForEachItem", "jsCode": "const orig = $('Resolve Desired Stage').item.json;\nconst r = $json;\nconst status = (r.structuredContent && r.structuredContent.status) || r.status || 'Unknown';\nreturn { json: Object.assign({}, orig, { emailStatus: status }) };" }, "retryOnFail": true, "maxTries": 3, "waitBetweenTries": 2000 },
    { "id": "emailverified", "name": "Email Verified?", "type": "n8n-nodes-base.if", "typeVersion": 2.3, "position": [1344, 912], "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "loose", "version": 2 }, "conditions": [{ "leftValue": "={{ $json.emailStatus }}", "rightValue": "Verified", "operator": { "type": "string", "operation": "equals" } }], "combinator": "and" } } },
    { "id": "logskipemail", "name": "Log Skip — Email Not Verified", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [1344, 1104], "parameters": { "assignments": { "assignments": [{ "id": "skip", "name": "skip_reason", "value": "={{ 'Email not verified: ' + $json.emailStatus }}", "type": "string" }] }, "includeOtherFields": true, "options": {} } },
    { "id": "lookupcadence", "name": "Lookup Cadence Map", "type": "n8n-nodes-base.dataTable", "typeVersion": 1.1, "position": [672, 0], "parameters": { "operation": "get", "dataTableId": { "__rl": true, "mode": "id", "value": "iEAwp8kZa2mUJBWY" }, "matchType": "allConditions", "filters": { "conditions": [{ "keyName": "segment", "keyValue": "={{ $json.segment }}" }, { "keyName": "persona", "keyValue": "={{ $json.persona }}" }, { "keyName": "stage", "keyValue": "={{ $json.desiredStage }}" }] }, "limit": 1 }, "alwaysOutputData": true, "retryOnFail": true, "maxTries": 3, "waitBetweenTries": 2000 },
    { "id": "cadencemapped", "name": "Cadence Mapped?", "type": "n8n-nodes-base.if", "typeVersion": 2.3, "position": [880, 0], "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "loose", "version": 2 }, "conditions": [{ "leftValue": "={{ $json.cadence_id }}", "rightValue": "", "operator": { "type": "string", "operation": "notEmpty", "singleValue": true } }], "combinator": "and" } } },
    { "id": "logskipcadence", "name": "Log Skip — No Cadence", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [1104, 224], "parameters": { "assignments": { "assignments": [{ "id": "skip", "name": "skip_reason", "value": "=No cadence mapped", "type": "string" }] }, "includeOtherFields": true, "options": {} } },
    { "id": "routebytool", "name": "Route by Tool", "type": "n8n-nodes-base.if", "typeVersion": 2.3, "position": [1088, 480], "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "loose", "version": 2 }, "conditions": [{ "leftValue": "={{ $json.tool }}", "rightValue": "instantly", "operator": { "type": "string", "operation": "equals" } }], "combinator": "and" } } },
    { "id": "lookupstate", "name": "Lookup Enrollment State (Instantly)", "type": "n8n-nodes-base.dataTable", "typeVersion": 1.1, "position": [1328, 480], "parameters": { "operation": "get", "dataTableId": { "__rl": true, "mode": "id", "value": "aJxsf48AnGGPNEFj" }, "matchType": "allConditions", "filters": { "conditions": [{ "keyName": "contact_id", "keyValue": "={{ $(\"Resolve Desired Stage\").item.json.contact_id }}" }] }, "returnAll": true }, "retryOnFail": true, "maxTries": 3, "waitBetweenTries": 2000 },
    { "id": "ensurestate", "name": "Ensure Instantly State Item", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [1424, 480], "parameters": { "jsCode": "const items = $input.all();\nif (items.length > 0) return items;\nreturn [{ json: { current_stage: '', status: '', current_tool: '' } }];" }, "retryOnFail": true, "maxTries": 3, "waitBetweenTries": 2000, "alwaysOutputData": true },
    { "id": "alreadyenrolled", "name": "Already Enrolled (Instantly)?", "type": "n8n-nodes-base.if", "typeVersion": 2.3, "position": [1568, 480], "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "loose", "version": 2 }, "conditions": [{ "leftValue": "={{ $json.current_stage }}", "rightValue": "={{ $(\"Resolve Desired Stage\").item.json.desiredStage }}", "operator": { "type": "string", "operation": "equals" } }, { "leftValue": "={{ $json.status }}", "rightValue": "enrolled", "operator": { "type": "string", "operation": "equals" } }], "combinator": "and" } } },
    { "id": "logskipalready", "name": "Log Skip — Already Enrolled (Instantly)", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [1792, 352], "parameters": { "assignments": { "assignments": [{ "id": "skip", "name": "skip_reason", "value": "=Already enrolled", "type": "string" }] }, "includeOtherFields": true, "options": {} } },
    { "id": "wait", "name": "Wait Between Enrollments", "type": "n8n-nodes-base.wait", "typeVersion": 1.1, "position": [3744, 912], "parameters": { "amount": 1 } }
  ],
  "connections": {
    "Daily 07:00 Trigger": { "main": [[{ "node": "Read Allbound Queue", "type": "main", "index": 0 }]] },
    "Read Allbound Queue": { "main": [[{ "node": "Test group only", "type": "main", "index": 0 }]] },
    "Test group only": { "main": [[{ "node": "MM Segments Only", "type": "main", "index": 0 }]] },
    "MM Segments Only": { "main": [[{ "node": "Cap Daily Volume", "type": "main", "index": 0 }]] },
    "Cap Daily Volume": { "main": [[{ "node": "Loop Enrollment", "type": "main", "index": 0 }]] },
    "Loop Enrollment": { "main": [[], [{ "node": "Resolve Desired Stage", "type": "main", "index": 0 }]] },
    "Resolve Desired Stage": { "main": [[{ "node": "Verify Contact Email", "type": "main", "index": 0 }]] },
    "Verify Contact Email": { "main": [[{ "node": "Attach Verify Status", "type": "main", "index": 0 }]] },
    "Attach Verify Status": { "main": [[{ "node": "Email Verified?", "type": "main", "index": 0 }]] },
    "Email Verified?": { "main": [[{ "node": "Lookup Cadence Map", "type": "main", "index": 0 }], [{ "node": "Log Skip — Email Not Verified", "type": "main", "index": 0 }]] },
    "Log Skip — Email Not Verified": { "main": [[{ "node": "Wait Between Enrollments", "type": "main", "index": 0 }]] },
    "Lookup Cadence Map": { "main": [[{ "node": "Cadence Mapped?", "type": "main", "index": 0 }]] },
    "Cadence Mapped?": { "main": [[{ "node": "Route by Tool", "type": "main", "index": 0 }], [{ "node": "Log Skip — No Cadence", "type": "main", "index": 0 }]] },
    "Log Skip — No Cadence": { "main": [[{ "node": "Wait Between Enrollments", "type": "main", "index": 0 }]] },
    "Route by Tool": { "main": [[{ "node": "Lookup Enrollment State (Instantly)", "type": "main", "index": 0 }], []] },
    "Lookup Enrollment State (Instantly)": { "main": [[{ "node": "Ensure Instantly State Item", "type": "main", "index": 0 }]] },
    "Ensure Instantly State Item": { "main": [[{ "node": "Already Enrolled (Instantly)?", "type": "main", "index": 0 }]] },
    "Already Enrolled (Instantly)?": { "main": [[{ "node": "Log Skip — Already Enrolled (Instantly)", "type": "main", "index": 0 }], []] },
    "Log Skip — Already Enrolled (Instantly)": { "main": [[{ "node": "Wait Between Enrollments", "type": "main", "index": 0 }]] },
    "Wait Between Enrollments": { "main": [[{ "node": "Loop Enrollment", "type": "main", "index": 0 }]] }
  }
}