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

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

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

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

  • n8n: Runs the automation workflow.
  • Elevenlabs API: Generates speech audio from text and voice IDs.
  • Custom Credential in n8n: Stores Elevenlabs API Key securely.
  • HTTP Clients (Postman, curl, or Apps): To send POST requests to the webhook URL.

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.


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 Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free