I am facing a strange issue in n8n where, for the exact same prompt and workflow, some nodes randomly show that no data is being returned, even though the data is actually available. Sometimes the workflow executes correctly, and other times it fails without any changes being made to the flow or configuration.
This issue appears inconsistent and difficult to reproduce reliably. I am currently trying to debug and identify the root cause of this behavior.
@Hari_Malam which node(s) specifically are returning empty intermittently — is it an AI agent / chat model node, or a regular HTTP request / database node? changes the cause entirely. if its an AI node, intermittent empty output usually = model non-determinism or the agent deciding mid-run to skip the tool call. if HTTP/DB, more likely timing or upstream rate limiting.
.item tries to trace the execution path back to the trigger, which fails intermittently in branched workflows with AI agent routing. .first() always grabs the first item from that node’s output regardless of the execution path. Since you only receive one WhatsApp message per trigger, .first() is safe and reliable here.
That’s why it works sometimes and fails other times: when the AI agent’s execution path is straightforward, .item resolves fine. When the agent makes extra tool calls or the routing is more complex, the path becomes ambiguous and .item returns undefined.