Automate Text-to-Speech with Elevenlabs & n8n Webhook

Save hours in your content creation by automating text-to-speech generation using n8n’s webhook and Elevenlabs API. This workflow ensures seamless audio generation from text inputs, eliminating manual conversion errors and delays.
webhook
if
httpRequest
+2
Workflow Identifier: 1517
NODES in Use: Webhook, If, HTTP Request, Respond to Webhook, Sticky Note
Automate text to speech with n8n and Elevenlabs

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow receives text and a voice ID through a simple HTTP POST request.
It sends the text to Elevenlabs API to create speech audio.
Finally, it sends back the audio file as a binary response to the requester.
It solves the problem of spending long time recording voice overs manually.
The outcome is an instant, natural-sounding voice audio from any text.

You get an easy to call API that produces speech in many voices without extra setup.
If inputs are wrong, user gets a clear JSON error instead of silence.


How the Workflow Works: Inputs, Processing, Outputs

Inputs

  • voice_id: Identifier for the voice to use, sent in the POST body.
  • text: The text script to convert to speech, sent in the POST body.

Processing Steps

  • Webhook node receives the POST request at path generate-voice.
  • If node checks if both voice_id and text exist in the request.
  • HTTP Request node calls Elevenlabs API at https://api.elevenlabs.io/v1/text-to-speech/{{ $json.body.voice_id }} with the text in JSON body.
  • Elevenlabs returns speech audio in response.
  • Respond to Webhook node sends this audio back as binary data to the caller.
  • If the parameters are missing, a different Respond to Webhook node sends JSON error { "error": "Invalid inputs." } as response.

Outputs

The output is the audio speech in a binary format playable by clients.
If input is bad, the output is a JSON error message instead.


Who Should Use This Workflow

Anyone who needs fast, reliable text-to-speech generation without manual recording.
Content creators who want multiple voice options and languages easily.

Also helpful for developers building apps or sites needing instant voice narration.
People wanting to cut down hours of voice recording work.


Tools and Services Involved

  • n8n Automation Platform: Runs the workflow and webhook.
  • Elevenlabs API: Provides text-to-speech voice synthesis.
  • HTTP POST Requests: Used to trigger the webhook and send input data.
  • Custom HTTP Credentials: Store Elevenlabs API key securely in n8n.

Beginner Step-by-Step: How to Use This Workflow in Production

Importing the Workflow

  1. Click the Download button on this page to get the workflow file.
  2. Inside the n8n editor, click “Import from File”.
  3. Select the downloaded workflow JSON file and import it.

Configuring Credentials

  1. Go to “Credentials” in n8n and add new HTTP Request credentials for Elevenlabs API.
  2. In the headers, enter { "xi-api-key": "your-elevenlabs-api-key" } replacing with your real API key.
  3. Assign this credential to the HTTP Request node named Generate voice.

Updating Parameters

  1. Check if the workflow requires changes in voice ID or text fields in input.
  2. Modify paths or add extra parameters if needed for your use.

Testing and Activating

  1. Send a test POST request to the webhook URL with JSON body containing voice_id and text.
  2. Verify if the response returns audio as binary data playable in your system.
  3. If test succeeds, activate the workflow in n8n for real use.
  4. Share the webhook URL safely with your app or team.

For extra stability and more control, consider running self-host n8n on a server.


Customizations and Extensions

  • You can add support for more voice options by changing the API call body or URL.
  • You can change the webhook path from generate-voice to any URL you like for multiple endpoints.
  • Insert nodes to log input and output info to external storage like Google Sheets.
  • Add security by checking API keys before voice generation to keep your webhook safe.

Common Errors and How to Fix

Error: 401 Unauthorized

Check if the Elevenlabs API key is correct in credentials.
Make sure the header is exactly xi-api-key and key is valid.

Error: If node does not pass inputs

Ensure you check body.voice_id and body.text exactly as spelled.
Use the “exists” operator and AND condition.


Pre-Production Checklist

  • Verify Elevenlabs API key is active and allows TTS.
  • Test webhook with sample POST requests having valid voice_id and text.
  • Confirm audio output works in your client system.
  • Check that invalid requests get clear error JSON output.
  • Backup workflow JSON before final deployment.

Deployment Guide

Once ready, activate the workflow inside n8n for production.
Keep webhook URL private and do not share publicly.

Monitor call usage on Elevenlabs dashboard to avoid hitting limits.
Add monitoring or alerts if needed for volume spikes.

This workflow can grow with your needs and integrate into other automation steps.


Summary of Results

✓ Saves time by auto-generating speech from typed text instantly.
✓ Supports many voices via Elevenlabs API in one simple HTTP POST API.
✓ Returns ready-to-use audio files fast without manual recording.
✓ Gives clear errors if input is missing or wrong.
✓ Easy to test, configure and activate within n8n platform.


Automate text to speech with n8n and Elevenlabs

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes, by changing the HTTP Request node URL and its authentication details, the workflow can connect to other TTS APIs. The request payload may need adjusting to fit those services.
Yes, each voice generation call counts as one API request billed according to Elevenlabs pricing. Monitoring usage helps control costs.
Data is processed securely within the n8n environment. Communication to Elevenlabs uses HTTPS to protect information during transit.
Add a node before the If node to validate API keys in requests or use n8n’s built-in access controls to secure the webhook from unauthorized calls.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.