Describe the problem/error/question
What is the problem?
I am trying to build an automated video content creation workflow. My Basic LLM Chain node (Google Gemini) generates a video script formatted as a JSON Array. I parse this array using the Edit Fields (Set) node with {{ JSON.parse($json.text) }} and then pass it to a Loop Over Items node to process each scene sequentially.
Inside the loop, I have an HTTP Request node meant to send each scene text to a free TTS API (StreamElements) and download the audio as a binary file. However, instead of getting an .mp3 play button/binary file, the HTTP Request node downloads the website’s HTML source code (data.html, text/html), or gives an incorrect host / domain value / Invalid URL error when I try to reference the dynamic data.
My Workflow Structure
-
Chat Trigger
Starts the flow. -
Basic LLM Chain (Gemini)
Generates JSON Array script string. -
Edit Fields (Set)
Uses {{ JSON.parse($json.text) }}to create an actionable array calledsahneler. -
Loop Over Items
Splits the array into individual items (Batch Size: 1). -
HTTP Request (Ses Ăśretici)
Set to GET method, Response Format is set to File. Loop output points back to the loop node.
The Error & Current State
When I try to use the dynamic text inside the URL string like this:
https://streamelements.com{{ encodeURIComponent($json.sahneler.metin) }}
The node preview shows undefined or throws an Invalid URL error. It seems the HTTP Request node loses track of the data structure coming out of the Loop node or cannot handle the encoding properly, resulting in downloading the base domain’s HTML instead of the audio payload.
What I need help with:
How can I correctly reference the text property of the current loop item inside the HTTP Request URL so that it dynamically passes the script paragraph and correctly triggers the .mp3 file download?
Thank you in advance!
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system:

