Effortless Text-to-Speech API with Elevenlabs
detail.loadingPreview
Integrate powerful text-to-speech capabilities into your applications using the Elevenlabs API via this n8n workflow. Generate natural-sounding speech from text with a simple webhook trigger and minimal setup.
About This Workflow
This n8n workflow empowers you to leverage Elevenlabs, a leading text-to-speech (TTS) service, directly through a customizable API endpoint. By setting up a webhook, you can easily trigger voice generation by sending a POST request with the required voice_id and text parameters. The workflow validates these inputs before making a secure API call to Elevenlabs, returning the generated audio directly. This solution is ideal for developers and content creators looking to add dynamic voiceovers to their projects without complex backend implementations.
Key Features
- Simple Webhook Integration: Trigger voice generation via a POST request to a dedicated API endpoint.
- Elevenlabs Power: Utilize Elevenlabs' advanced TTS engine for natural and expressive speech.
- Input Validation: Ensures
voice_idandtextparameters are provided before API calls. - Direct Audio Response: Receives and can forward the generated audio binary data.
- Secure API Key Management: Uses n8n's credential management for secure Elevenlabs API key handling.
How To Use
- Configure Elevenlabs Credentials in n8n: Create a new custom authentication entry in n8n with the following JSON structure:
{"headers": {"xi-api-key": "your-elevenlabs-api-key"}}. Replace"your-elevenlabs-api-key"with your actual Elevenlabs API key. - Set up the Webhook Node: Ensure the Webhook node's
pathis set togenerate-voiceand thehttpMethodisPOST. - Configure the 'If params correct' Node: This node checks for the presence of
voice_idandtextin the incoming request body. - Configure the 'Generate voice' Node: Set the
urltohttps://api.elevenlabs.io/v1/text-to-speech/{{ $json.body.voice_id }}, specifyPOSTas the method, and provide thejsonBodyas{"text": "{{ $json.body.text }}"}. Ensure your custom Elevenlabs credentials are selected. - Connect Nodes: Connect the Webhook to the 'If params correct' node. Connect the 'If params correct' node (true branch) to the 'Generate voice' node. Connect the 'Generate voice' node to the 'Respond to Webhook' node.
- Handle Errors: Connect the 'If params correct' node (false branch) to the 'Error' node (which is also a
respondToWebhooknode). - Activate the Workflow: Once configured, activate your n8n workflow and send POST requests to your webhook URL with the required
voice_idandtextin the request body.
Apps Used
Workflow JSON
{
"id": "167b43e3-8ddf-4744-b30f-cfa5d0dc8d21",
"name": "Effortless Text-to-Speech API with Elevenlabs",
"nodes": 17,
"category": "Marketing",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 167b43e3-8ddf...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Automated AI Motion Illustration Workflow with Midjourney and Kling
Unleash your creativity with this n8n workflow that automates the generation of stunning motion illustrations. It leverages the power of Midjourney for static image creation and Kling AI to transform them into dynamic videos, all managed through the PiAPI. Perfect for content creators, marketers, and social media professionals looking to produce engaging visuals at scale.
Automated Multi-Platform Social Media Publisher
Streamline your social media content creation and publishing with this n8n workflow. Simply fill out a web form with your caption, media (image or video), and target platforms, and let n8n automate the posting process across multiple social networks.
WhatsApp AI Assistant: LLaMA 4 & Google Search for Real-Time Insights
Instantly deploy a smart AI assistant on WhatsApp, powered by Groq's lightning-fast LLaMA 4 model. This workflow enables real-time conversations, remembers context, and provides up-to-date answers by integrating live Google Search results.