Automate Text-to-Speech with Elevenlabs API in n8n

Struggling to convert text into natural-sounding speech efficiently? This n8n workflow uses Elevenlabs’ API to automate text-to-speech generation, saving time and reducing errors in content creation processes.
webhook
if
httpRequest
+1
Workflow Identifier: 1773
NODES in Use: Webhook, If, HTTP Request, Respond to Webhook
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 webhook.
It checks the inputs, sends those to Elevenlabs API for text-to-speech, and returns the audio file directly.
If inputs are missing, it responds with a clear error message.
This saves time and stops manual steps to create speech from text.

The workflow starts by taking a POST request with voice and text.
Then it verifies those inputs exist and are valid.
Next, it calls Elevenlabs API with that text and voice info.
The output audio is sent back as a binary response to the original sender.
If input is invalid, it sends JSON showing the error.

In short, it makes turning scripts into spoken audio fast and automatic without manual copying or software switching.


Tools and Services Used


Inputs, Processing Steps, and Outputs

Inputs: The workflow takes a POST request with JSON body containing two key fields: voice_id and text.

Processing Steps:

  • Check if both voice_id and text exist in the incoming request.
  • If valid, send a POST call to Elevenlabs API’s text-to-speech endpoint using the given voice ID and text content.
  • Receive the streamed audio binary from the API.
  • Send this binary back as the response to the webhook caller.
  • If inputs missing, respond with JSON error message instead.

Outputs: A direct binary audio file if successful, or JSON error info if inputs are invalid.


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

Step 1: Download and Import Workflow

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor.
  3. Import the downloaded file by clicking “Import from File” in the editor.

Step 2: Configure Credentials and Settings

  1. Add your Elevenlabs API Key in n8n under Custom Credentials for the HTTP Request node.
  2. Check if you need to update any voice IDs, emails, or channels in the workflow to fit your use case.
  3. Verify the webhook path matches your setup if changed.

Step 3: Test the Workflow

  1. Send a test POST request to the webhook URL with a JSON body containing voice_id and text.
  2. Check if you get an audio binary response.
  3. If the input is missing a parameter, confirm the JSON error response is returned.

Step 4: Activate for Production Use

  1. Save and activate the workflow inside n8n by toggling the workflow active switch.
  2. The webhook URL becomes live and starts accepting real requests.
  3. Monitor executions in n8n and check logs for errors or warnings.

Common Issues and Failure Handling

Input Missing: If voice_id or text is not included, the workflow detects this and responds with { "error": "Invalid inputs." }.

API Key Unauthorized: If the Elevenlabs API Key is wrong or missing in credentials, the HTTP Request node gets 401 errors.
Check credentials and update the key.

No Audio Returned: If the voice ID is incorrect or the request body is wrongly formatted, the Elevenlabs API call fails.
Confirm the URL uses the dynamic expression {{ $json.body.voice_id }} and JSON body has { "text": "{{ $json.body.text }}" }.


Customization Ideas

  • Change the output audio format via the Respond to Webhook node if Elevenlabs API supports other types.
  • Enhance validation by checking text length or voice ID format in the If node.
  • Add logging nodes to watch requests or collect usage stats before calling the API.
  • Allow multiple or default voices dynamically in the webhook payload.
  • Send generated audio to storage or messaging services for automated delivery.

Deployment Notes

After testing, enable the workflow by activating it in the n8n interface.
Your webhook endpoint will accept real requests from this moment.

Monitor all runs inside n8n’s execution logs.
Fix any issues by reviewing error messages and node outputs.

For reliable hosting and scalability, consider self-host n8n on your own server or cloud environment.


Summary

→ This workflow turns text and voice ID into audio files automatically.
→ It checks inputs, calls Elevenlabs API, then returns audio directly.
→ Invalid inputs get clear JSON error messages.
→ Users save time and avoid manual text-to-speech steps.
→ Workflow works inside n8n with simple setup and activation.


Automate text to speech with n8n and Elevenlabs

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The workflow checks for both parameters and returns a JSON error message stating “Invalid inputs.” if either is missing.
It uses a custom credential inside n8n where the user stores the Elevenlabs API Key securely and the HTTP Request node uses it for authorization.
Yes, but the HTTP Request node’s URL, headers, and body must be updated according to the alternate API’s specs.
Yes, users can deploy the workflow on private infrastructure by using self-host n8n solutions for better control and uptime.

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.