How to loop through a JSON response and process each node seperately?

Hello - I have a workflow setup which will run every hour, get a JSON from an HTTP request and send out a Telegram message with the results in the JSON. So far so good except the JSON request has multiple nodes in it (can be 1, can be dozens depending on how much content is in it that moment).

I would like to send a separate Telegram message for EACH node. How is this possible?

IE: one node can look like this:

{{ $node[“HTTP Request”].json[“results”][0][“MetroName”]

Any info is appreciated :slight_smile: thank you

Can you provide a copy of the JSON from the HTTP request?

Hi @cleveradmin, it looks like this:

https://www.tesla.com/inventory/api/v1/inventory-results?query={"query"%3A{"model"%3A"m3"%2C"condition"%3A"used"%2C"options"%3A{}%2C"arrangeby"%3A"Price"%2C"order"%3A"asc"%2C"market"%3A"US"%2C"language"%3A"en"%2C"super_region"%3A"north%20america"%2C"lng"%3A-118.4104684%2C"lat"%3A34.1030032%2C"zip"%3A"90210"%2C"range"%3A0%2C"region"%3A"CA"}%2C"offset"%3A0%2C"count"%3A50%2C"outsideOffset"%3A0%2C"outsideSearch"%3Afalse}

:slight_smile:

Hey @n8n_rookie, thanks for the additional info. If I understand correctly, this should do what you need. FYI, the “Limit” node is just so that I’m not hammering the webhook.site endpoint with requests, but you can remove it to get access to the full 49 items in the result. And obviously you’ll need to change the last HTTP Request to use the Telegram node instead. But this should get you started.

1 Like

@cleveradmin you rock!!! Thank you for the solution, I am looking forward to trying this out! I didnt know about the split + limit… I was using HTTP instead of Get Data too.

1 Like

I just renamed it to Get Data. It’s the same HTTP Request node you used.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.