Generate Audio from Text using OpenAI with n8n Automation

Struggle to convert text into natural-sounding audio quickly? This n8n workflow leverages OpenAI’s text-to-speech capabilities to instantly generate audio files from any text input, saving hours of manual work and minimizing errors.
webhook
openAi
respondToWebhook
+1
Workflow Identifier: 1802
NODES in Use: Respond to Webhook, Sticky Note, Webhook, OpenAI
Automate audio generation 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 turns text into spoken audio automatically. It solves the common problem of wasting time copying or reading text aloud into a recorder. The final output is a natural-sounding audio file sent directly back to the user.

It works by accepting text sent through a secure Webhook node. Then, it uses an OpenAI node set to create audio using a “fable” voice. Lastly, it sends the audio back via a response node. This saving you hours and giving steady, high-quality audio files every time.


Who should use this workflow

This is for people who want quick and easy text-to-speech without running many tools. If you publish blogs, podcasts, or customer messages and want audio versions, this helps. It works well for those who use n8n and have access to OpenAI API keys.

No deep coding skills needed. Just use HTTP POST calls to send text and get audio back. It fits simple automation needs or linking to other apps.


Tools and services used

  • n8n: Workflow automation platform hosting the workflow.
  • OpenAI API: Converts text to speech using the “fable” voice preset.
  • HTTP client or app: Sends POST requests to the webhook with input text.

Inputs, processing, and outputs

Inputs

The workflow takes a POST request to the Webhook node. The JSON body must include the key text_to_convert with the text you want to change to audio.

Processing steps

  • Receive text in Webhook node.
  • The OpenAI node reads {{$json.body.text_to_convert}} and generates an audio file using the “fable” voice.
  • The resulting audio is sent in binary form to the Respond to Webhook node.

Output

The workflow returns an audio file as binary data directly in the HTTP response. Users get a ready-to-use audio file without delays or extra copying.


Beginner step-by-step: How to use this workflow in n8n production

1. Import the workflow

Download the workflow JSON file using the Download button on this page.

In your n8n editor, choose “Import from File” and load the downloaded JSON.

2. Configure settings

Go to your imported workflow:

  • Set your OpenAI API Key in the OpenAI node credentials.
  • Check if any IDs, email addresses, or folder names need updating based on your use case.

3. Test the workflow

Turn the workflow active by toggling the switch in the top-right.

Send a POST request to the Webhook node URL with JSON like:

{
  "text_to_convert": "Hello there, this is a test for audio generation."
}

Check if you receive the audio file in response.

4. Activate for production

Once tests pass, keep the workflow active. Use the webhook URL in your other apps or services to get audio from text anytime.

For hosting needs, see self-host n8n options if you want control over your environment.


How to customize this workflow

  • Change the voice style in the OpenAI node by selecting different voice presets like “narrator” or “child”.
  • Add a language parameter in the webhook JSON to support multiple languages and pass it to the OpenAI node.
  • Insert cloud storage nodes like Google Drive or AWS S3 after audio generation to save audio files automatically.
  • Add speech-to-text nodes after audio creation to produce transcripts or subtitles for the audio.

Common problems and fixes

  • Issue: Webhook URL not working or trigger not firing.
    Cause: Workflow is off or webhook node was not saved.
    Fix: Activate workflow and save webhook node, then copy URL again.
  • Issue: OpenAI API key rejected.
    Cause: Wrong or expired API key.
    Fix: Re-check and update OpenAI API credentials in the node.
  • Issue: Empty audio or no file received.
    Cause: Incorrect JSON path to input text.
    Fix: Make sure {{$json.body.text_to_convert}} is the exact input path.

Summary of benefits

✓ Save hours by automating text-to-audio conversion.
✓ Get natural, steady voice audio every time.
✓ Use easily with simple POST requests to the webhook.
✓ Customize voice and workflows for special needs.
✓ Works inside n8n with minimal setup.


Automate audio generation with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The Webhook node expects a POST request with JSON body containing the key “text_to_convert” and the text for conversion.
The workflow sends the generated audio file as binary data in the HTTP response through the Respond to Webhook node.
An empty audio response usually happens if the input text path in the OpenAI node does not match the actual JSON path from the webhook.
Yes. The OpenAI node voice preset can be changed to other supported voices like “narrator” or “child”.

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.