Hey everyone, I’m pulling my hair out over a weird interaction between n8n and Evolution API.
I have a workflow that processes multiple contacts using the “Loop Over Items” node. Inside the loop, I’m trying to send a presence update (typing/paused) via Evolution API. I’ve tried using both the Evolution API Community Node and a manual HTTP Request node.
Here is the weird part:
-
Item 1: Executes perfectly.
-
Item 2 (and onwards): Fails with this error:
400 - {"status":400,"error":"Bad Request","response":{"message":["[object Object]"]}}
It seems like on the second iteration, n8n or the API parses the target number/delay parameter as an Object instead of a primitive String/Number, even though it’s the exact same node executing it.
What I’ve tried so far (and failed):
-
Forcing the data type to string using
{{ String($json.phone_clean) }}and{{ $json.phone_clean.toString() }}. -
Appending the JID manually like
{{ $json.phone_clean }}@s.whatsapp.net. -
Switching from raw JSON to “Using Fields Below” in the HTTP Request node to bypass n8n’s JSON parsing inside loops.
Has anyone experienced this specific issue? Does Evolution API (or n8n’s auto-casting) behave differently when evaluating expressions inside a loop? How do I force it to consistently send the correct data type for every item in the loop without it reverting to an object?
Any insights or workarounds would be greatly appreciated. Thanks!
