Random n8n Node Execution Issue for Same Prompt

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.

i have self hosted n8n in my arm vm ( ubuntu )

@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.

this is my full flow where at the end node i have actually data of first node but still some time it shows error

at last whatsapp replay node > i am getting undefined values from whatsapp trigger node even i have this…

you can see left side have data and i drag and drop this field

I think the issue is your expression syntax in the WhatsApp Reply nodes. You’re using:

{{ $('WhatsApp Trigger').item.json.metadata.phone_number_id }}

Change all references from .item.json to .first().json:

  • Sender: {{ $('WhatsApp Trigger').first().json.metadata.phone_number_id }}

  • Recipient: {{ $('WhatsApp Trigger').first().json.contacts[0].wa_id }}

.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.

Let me know if it helps

the issue was random…
some time it happening..
for now it working fine with your solution…
thanks for your support