n8n

How to Generate ElevenLabs Audio for Marketing?

Turn any text into ready to use audio through a simple API endpoint in n8n. Ideal for marketing teams and creators who need fast voiceovers for videos, ads, training, and social content.

A POST request hits a webhook at the generate voice path. An If check verifies that voice_id and text are present. When valid, an HTTP Request calls the ElevenLabs text to speech API using your API key stored as a header. The audio file that comes back is returned to the caller through Respond to Webhook in binary format, so your app gets the file right away. If inputs are missing, a friendly JSON error is sent instead. This creates a single call service that apps, forms, or scripts can call on demand.

Setup requires an ElevenLabs account and one API key saved in n8n as a custom header. Expect strong time savings when producing many clips each week because you remove manual downloads and uploads. Common uses include batch script voiceovers, product demo narration, training modules, and dynamic audio in web apps. Keep the endpoint private or place it behind your app to control usage and costs.

What are the key features?

  • Webhook endpoint accepts POST requests with voice_id and text fields
  • If node validates inputs and routes bad requests to a clear error reply
  • HTTP Request sends JSON to ElevenLabs using a custom header for the API key
  • Binary response is returned through Respond to Webhook so callers receive audio immediately
  • Content Type set to application/json for clean and reliable requests
  • Simple flow with six nodes for easy maintenance and quick changes

What are the benefits?

  • Reduce manual voice generation from many clicks to one API call
  • Deliver audio files back to your app instantly with no extra steps
  • Handle more scripts in parallel as requests can run at the same time
  • Improve data quality by checking required fields before calling the API
  • Connect any form or app to text to speech without building servers

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with ElevenLabs. See the Tools Required section above for links to create accounts with these services.
  3. Open the Generate voice node and create credentials: in the Credential to connect with dropdown click Create new credential, choose HTTP Custom Auth, add a header named xi-api-key with your ElevenLabs API key, and save with a clear name like ElevenLabs API Key.
  4. In the Generate voice node, confirm Method is POST and URL is https://api.elevenlabs.io/v1/text-to-speech/{{ $json.body.voice_id }}. Set Content Type header to application/json. Set the JSON body to { "text": "{{ $json.body.text }}" }.
  5. In the Generate voice node, set the response format to file if available so the audio returns as binary data.
  6. Open the Webhook node. Set Path to generate-voice, HTTP Method to POST, and Response Mode to Response Node so the Respond to Webhook node handles the reply.
  7. Open the If node and verify it checks that body.voice_id and body.text are not empty. Make sure both conditions must be true to continue.
  8. Open the Respond to Webhook node on the success branch. Set Respond With to Binary and choose the binary property from the Generate voice node if a property must be selected.
  9. Test with a POST request using a tool like curl or your app. Send JSON with voice_id and text to your n8n webhook URL. You should receive an audio file in the response.
  10. Test the error path by omitting one field. You should see a JSON error message that says Invalid inputs. If you get an authentication error from ElevenLabs, confirm the xi-api-key header and that your voice_id is valid.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

ElevenLabs

Sign up

Free: $0 / mo, 10k credits / mo, includes API access

Credits:
The n8Ninja

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.