Automate Text to Speech with OpenAI in n8n: Step-by-Step Guide

Save time and enhance your projects by converting text to speech using OpenAI’s API within n8n. This workflow automates TTS generation with configurable voices and straightforward setup.
manualTrigger
set
httpRequest
+1
Workflow Identifier: 1608
NODES in Use: Manual Trigger, Set, HTTP Request, Sticky Note
Automate text to speech with n8n and OpenAI

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

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow takes written text and turns it into speech audio with an OpenAI API inside n8n.

It solves the problem of manual or slow text-to-speech work by sending text to OpenAI’s TTS service and getting back an MP3 audio file.

The result is a ready-to-use spoken audio clip based on your text and voice choice.

This saves time and effort by automating speech generation in content production.


Who Should Use This Workflow


Tools and Services Used

  • n8n Platform: For designing and running the workflow.
  • OpenAI TTS API: The service that converts text to speech.
  • Manual Trigger node: To start workflow manually.
  • Set node: To provide input text and voice parameters.
  • HTTP Request node: To send requests and receive audio from OpenAI.
  • OpenAI API Key: Needed in n8n credentials to authenticate calls.

Inputs, Processing Steps, and Output

Inputs

  • Trigger to start the workflow (manual trigger)
  • Text string to convert (input_text in JSON)
  • Voice choice string (voice in JSON)

Processing Steps

  • The workflow sends a POST request to OpenAI’s /audio/speech endpoint.
  • It includes the model tts-1, the input text, and voice choice.
  • OpenAI returns a binary MP3 file of the spoken text.

Output

The final output is an MP3 audio file ready for saving or streaming.


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

Step 1: Download and Import the Workflow

  1. Use the Download button on this page to save the workflow JSON file.
  2. Go to your n8n editor and select Import from File.
  3. Upload the downloaded workflow JSON file.

Step 2: Configure Credentials and Parameters

  1. Add your OpenAI API Key credential in n8n if not done yet.
  2. In the Set node, update input_text with the text to speak.
  3. Change the voice value to the preferred voice name if needed.
  4. If there are any IDs, emails, channels, or storage folders, update them here as required.

Step 3: Test the Workflow

  1. Click Execute Workflow to run the flow manually.
  2. Check the HTTP Request node output for a binary MP3 file.
  3. Download or play the MP3 to verify the speech conversion.

Step 4: Activate for Production

  1. Turn the workflow on in n8n for scheduled or other triggers.
  2. Replace the Manual Trigger node with Schedule node or Webhook node for automation if needed.

Note: If using your own server, visit self-host n8n for reliable setup.


Customization Ideas

  • Change the spoken text by editing the input_text in the Set node to any sentence.
  • Switch voices by updating the voice parameter to other supported OpenAI voices like adam or alloy.
  • Automate by replacing the manual trigger with a Webhook node or Schedule node.
  • Add nodes to save audio output to cloud storage like AWS S3, Google Drive, or Dropbox.

Common Issues and Troubleshooting

  • 401 Unauthorized or Invalid API Key: Check that OpenAI API key is correct in n8n credentials and selected in the HTTP Request node.
  • No Audio or Empty Response: Verify that the parameters model, input, and voice are exactly as documented.
  • Workflow Not Triggering: Ensure the Manual Trigger node is connected and the Execute Workflow button is pressed.

Pre-Production Checklist

  • Make sure the OpenAI API key is valid and has permissions for TTS.
  • Confirm the Manual Trigger fires and passes data.
  • Check the Set node contains correct JSON keys and values.
  • Verify HTTP Request node returns a binary MP3 audio file.
  • Test saving or further processing nodes if audio file storage is added.

Deployment Guide

Turn the workflow on inside n8n to run automatically if desired.

Use logs and the execution list to monitor success or errors.

Add error handling nodes to improve stability for production use.


Summary and Results

✓ Converts written text into MP3 speech audio fast.

✓ Saves time by automating text-to-speech conversion using OpenAI.

✓ Works with customizable voice options to match brand tone.

✓ Easy to integrate into larger content workflows inside n8n.

→ Output is a downloadable audio file ready for podcasting or accessibility.

→ Setup requires simple import, configuration, and testing inside n8n.


Automate text to speech with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The user can change the voice by editing the voice parameter in the Set node to any supported OpenAI TTS voice name.
The user should check that the OpenAI API key is correct, updated in n8n credentials, and properly selected in the HTTP Request node settings.
Yes, replacing the Manual Trigger node with a Webhook node or Schedule node in n8n enables automatic triggering.
The workflow outputs the speech as a binary MP3 audio file suitable for download or further processing.

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.