Problem Description: Workflow fails to iterate correctly through all items when using nodes involving asynchronous operations (HTTP Request or Code node with await this.helpers.httpRequest) within a loop structure. The primary symptom is the workflow halting or erroring out after processing only the first item (index 0), despite receiving multiple items and having “Execute Once” disabled on all relevant nodes.
Additionally, when attempting a sub-workflow workaround using a Webhook trigger, persistent HTTP 500 errors (“Workflow could not be started!”) occur when the parent workflow calls the child’s active Production Webhook URL via POST, even for a minimal child workflow.
Workflow Structures Tested:
1. Initial Attempt (Parent Workflow): Start → Set (Define Vars) → Google Sheets (Filter) → SplitInBatches(1) → Wait → HTTP Request (Perplexity Call)
○ Error: ExpressionError: No data found for item-index: “1” occurred in the HTTP Request node’s body expression evaluation ($json[“Prompt text”]), despite input data for item 1 being present. Similar errors occurred when trying to access $node[“Set”]… data in Set nodes within the loop.
2. Sub-Workflow Attempt (Parent): Start → Set (Define Vars) → Google Sheets (No Filter) → Merge (Combine Vars + Sheet data) → SplitInBatches(1) → HTTP Request (Calls Child Webhook)
3. Sub-Workflow Attempt (Child): Webhook → Set (Extract Input) → Code (Perplexity Call w/ await this.helpers.httpRequest) → Wait → Respond to Webhook (also tested simplified version Webhook → Respond to Webhook)
Specific Errors Encountered During Troubleshooting:
• ExpressionError: No data found for item-index: “1”: Occurred consistently on nodes (Set, HTTP Request, Code) inside loops when trying to evaluate expressions (like $node[“Set”]… or $json[…] / $input…) for the second item (index 1), even when input data was confirmed present.
• HTTP 429 Too Many Requests: Resolved by adding Wait node and switching to a higher-limit Perplexity model.
• HTTP 401 Unauthorized: Resolved by correcting API key entry in Code node.
• TypeError: Cannot assign to read only property ‘name’ of object ‘Error: Referenced node doesn’t exist’: Occurred when Code node incorrectly tried to reference parent node ($node[“Set”]). Resolved by correcting variable access.
• Error: Code doesn’t return an object (‘undefined’ was returned instead): Occurred when a code path potentially didn’t hit a return statement. Resolved by correcting code.
• HTTP 404 The requested webhook “[id]” is not registered: Resolved by ensuring Child workflow was Active and the correct Production URL was used in the Parent’s HTTP Request node.
• HTTP 500 Workflow Webhook Error: Workflow could not be started!: Persistent error when Parent HTTP Request node calls Child’s active Production Webhook URL via POST, even when the Child workflow is minimal (Webhook → Respond to Webhook). Occurs immediately on item 0.
Expected Behavior: The workflow should iterate through all 150 items sequentially, successfully executing the HTTP Request or Code node for each item without “No data found” expression errors or internal “Workflow could not be started” errors on the webhook trigger.
Actual Behavior: Workflow fails to iterate past item 0 due to suspected expression evaluation/context bugs in loops, OR fails immediately with an HTTP 500 error when using the sub-workflow/webhook pattern, preventing the child from starting.
Troubleshooting Steps Taken: Verified Execute Once is OFF on all nodes; confirmed input data structure; used variable picker for expressions; isolated nodes; added logging; used intermediate Set nodes; tried HTTP Request vs Code node; implemented sub-workflow via Webhook; recreated Webhook node; confirmed child activation & Production URL.
Conclusion: The persistent failure across different approaches points strongly towards potential bugs in n8n v1.86.1 Cloud related to (1) expression context/data access during iteration, especially after item 0, and/or (2) the internal handling of POST requests triggering active workflows via Production Webhook URLs.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.