Why Your n8n HTTP Request Node Returns HTML Instead of Audio - Debugging TTS in Looped Gemini Workflows
When converting Gemini-generated JSON arrays into sequential TTS calls inside n8n, users see HTML responses instead of audio binaries-an indicator of an upstream error page or misconfigured request/response handling. Effective fixes target content-type handling, authentication, and binary-mode configuration in the HTTP Request node.
This problem typically surfaces in multi-step automation where an LLM (Google Gemini) generates scene text which is looped and sent to a third-party TTS API. Receiving HTML instead of a binary audio file usually means the HTTP request hit an HTML error page - common causes are authentication failures, rate limits, incorrect endpoint or headers, or a redirect to a human-facing status page. In n8n, another frequent cause is not handling binary responses correctly: the node may treat the response as text if 'Response Format' isn't set to 'File' or 'Binary'.
For businesses running automated content pipelines, this failure halts media production and can cascade into missed deadlines or increased manual work. The first steps are to inspect the HTTP node configuration: confirm URL/HTTP method, include required auth headers or API keys, and set the response format to return binary attachments. Check for redirects (3xx) and follow them if the API requires it. Examine response headers for content-type; an HTML content-type signals an error page rather than audio/mpeg or audio/wav.
Operational resilience requires robust error handling inside the loop: add a try/catch pattern or conditional node that inspects response status codes and headers, then retries with backoff for transient 429/5xx errors. When working with free or rate-limited TTS services, implement throttling at the loop level or batch scenes to avoid service rejection. For deterministic pipelines, prefer TTS providers with explicit binary streaming support and documented SDKs.
Leaders should prioritize observability and SLA alignment for media automation. Ensure logs capture full request/response metadata (without exposing secrets), create automated alerts for repeated HTML responses, and standardize credential management. Where content volume is strategic, consider paid TTS contracts or caching layers to avoid transient failures and ensure predictable throughput.
Original Source
n8n Community
