npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-google-cloud-tts

v0.2.1

Published

n8n community node for Google Cloud Text-to-Speech API

Downloads

27

Readme

npm install n8n-nodes-google-cloud-tts

For Docker-based deployments, add the following to your n8n Dockerfile:

RUN npm install -g n8n-nodes-google-cloud-tts

Operations

Speech Resource

Synthesize

  • Description: Convert text to speech using Google Cloud Text-to-Speech API
  • Parameters:
    • text: The text to convert to speech (required)
    • languageCode: Language code (e.g., 'de-DE', 'en-US')
    • voiceName: Specific voice name (optional)
    • voiceGender: Voice gender (NEUTRAL, MALE, FEMALE)
    • audioEncoding: Audio format (MP3, LINEAR16, OGG_OPUS)
    • speakingRate: Speaking speed (0.25 to 4.0)
    • pitch: Voice pitch (-20.0 to 20.0)
    • outputFormat: Return format (Base64 String or Binary Data)

Voice Resource

List

  • Description: List available voices from Google Cloud Text-to-Speech
  • Parameters:
    • languageCodeFilter: Filter voices by language code (optional)

Credentials

This node supports two authentication methods:

  1. Google OAuth2 API (Recommended) - Use n8n's built-in Google OAuth2 credentials
  2. Service Account Key - Traditional JSON key file approach

Method 1: Google OAuth2 API (Recommended)

  1. Create a Google Cloud Project:

  2. Enable the Text-to-Speech API:

    • Navigate to "APIs & Services" > "Library"
    • Search for "Cloud Text-to-Speech API"
    • Click "Enable"
  3. Configure in n8n:

    • Create new credentials of type "Google OAuth2 API" (this is n8n's standard Google OAuth2 credential)
    • Set the scope to include: https://www.googleapis.com/auth/cloud-platform
    • Complete the OAuth flow by signing in with Google
    • This credential can be reused for multiple Google Cloud services

Method 2: Service Account Key

  1. Create Service Account:

    • Go to "IAM & Admin" > "Service Accounts"
    • Click "Create Service Account"
    • Give it a name and description
    • Assign the "Cloud Text-to-Speech User" role
    • Generate and download the JSON key file
  2. Configure in n8n:

    • Create new credentials of type "Google Cloud Text-to-Speech API"
    • Paste the entire JSON key file content into the "Service Account Key" field
    • Optionally set the Project ID

Compatibility

  • n8n version: 0.198.0 or later
  • Node.js: 18.10 or later

Usage

Basic Text-to-Speech Example

  1. Add the Google Cloud TTS node to your workflow
  2. Select "Speech" > "Synthesize"
  3. Configure the parameters:
    Text: "Hello, this is a test message in German."
    Language Code: de-DE
    Voice Gender: FEMALE
    Audio Encoding: MP3
  4. Run the workflow

The node will return the synthesized speech as either:

  • Base64 String: Audio data encoded as base64
  • Binary Data: Direct binary audio file

Advanced Example with Dynamic Text

{
  "nodes": [
    {
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "position": [250, 300]
    },
    {
      "name": "Google Cloud TTS",
      "type": "n8n-nodes-google-cloud-tts.googleCloudTts",
      "position": [450, 300],
      "parameters": {
        "resource": "speech",
        "operation": "synthesize",
        "text": "={{ $json.message }}",
        "languageCode": "de-DE",
        "voiceGender": "FEMALE",
        "outputFormat": "binary"
      }
    }
  ]
}

List Available Voices

Use the "Voice" > "List" operation to discover available voices:

{
  "parameters": {
    "resource": "voice",
    "operation": "list",
    "languageCodeFilter": "de-DE"
  }
}

Supported Languages

The node supports all languages available in Google Cloud Text-to-Speech, including:

  • German (de-DE): Multiple neural and WaveNet voices
  • English (en-US, en-GB): Wide variety of voices
  • Spanish (es-ES): Male and female voices
  • French (fr-FR): Multiple voice options
  • Italian (it-IT): Neural voices available
  • Portuguese (pt-BR): Brazilian Portuguese
  • Japanese (ja-JP): Natural-sounding voices
  • Chinese (zh-CN): Mandarin Chinese
  • Korean (ko-KR): Korean voices

For a complete list, use the "List Voices" operation.

Examples

1. Multi-Language Text-to-Speech

// Input data
[
  {
    "text": "Hello World",
    "language": "en-US"
  },
  {
    "text": "Hallo Welt",
    "language": "de-DE"
  },
  {
    "text": "Bonjour le monde",
    "language": "fr-FR"
  }
]

// Node configuration
{
  "text": "={{ $json.text }}",
  "languageCode": "={{ $json.language }}",
  "voiceGender": "NEUTRAL",
  "outputFormat": "binary"
}

2. Dynamic Voice Selection

// Use different voices based on content type
{
  "text": "={{ $json.message }}",
  "languageCode": "de-DE",
  "voiceName": "={{ $json.isNews ? 'de-DE-News-K' : 'de-DE-Wavenet-F' }}",
  "speakingRate": "={{ $json.isUrgent ? 1.2 : 1.0 }}"
}

3. Batch Processing

// Process multiple texts in one workflow
{
  "resource": "speech",
  "operation": "synthesize",
  "text": "={{ $json.texts.join('. ') }}",
  "languageCode": "de-DE",
  "outputFormat": "binary"
}

Error Handling

The node includes comprehensive error handling:

  • Authentication errors: Invalid service account credentials
  • API errors: Quota exceeded, invalid parameters
  • Network errors: Connection timeout, DNS resolution
  • Validation errors: Missing required parameters

Enable "Continue on Fail" in the node settings to handle errors gracefully in your workflow.

Performance Tips

  1. Batch Processing: Combine multiple short texts into longer requests
  2. Caching: Store frequently used audio files to avoid repeated API calls
  3. Audio Format: Use MP3 for smaller file sizes, LINEAR16 for highest quality
  4. Voice Selection: Neural voices provide better quality but consume more quota

Resources

Support

For issues with this community node:

  1. Check the n8n community forum
  2. Review Google Cloud Text-to-Speech documentation
  3. Open an issue in the project repository

License

MIT

Version History

0.2.0

  • NEW: OAuth2 authentication support
  • Added Google Cloud Text-to-Speech OAuth2 API credentials
  • Improved authentication handling with fallback support
  • Updated documentation with OAuth2 setup instructions

0.1.0

  • Initial release
  • Speech synthesis with full parameter control
  • Voice listing functionality
  • Base64 and binary output formats
  • Support for all Google Cloud TTS languages
  • Comprehensive error handling