Skip to main content

πŸŽ™οΈ VoiceFlow AI: Telegram + Deepgram + OpenAI + Supabase audio assistant

Workflow preview

Workflow preview
100%
πŸŽ™οΈ VoiceFlow AI: Telegram + Deepgram + OpenAI + Supabase audio assistant preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

️ AI Audio Assistant with Voice to Voice Response Who is this for? Businesses, customer service teams, content creators, and organizations who want to provide intelligent voice based interactions...

Best for

  • Support Chatbot automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.httprequest, n8n-nodes-base.set, n8n-nodes-base.supabasetool, @n8n/n8n-nodes-langchain.memorybufferwindow, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.if, n8n-nodes-base.telegramtrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by RedOne.

Original n8n.io source

1.1 Workflow description

Title
πŸŽ™οΈ VoiceFlow AI: Telegram + Deepgram + OpenAI + Supabase audio assistant
Workflow name
πŸŽ™οΈ VoiceFlow AI: Telegram + Deepgram + OpenAI + Supabase audio assistant

πŸŽ™οΈ AI Audio Assistant with Voice-to-Voice Response

Who is this for? Businesses, customer service teams, content creators, and organizations who want to provide intelligent voice-based interactions through Telegram. Perfect for accessibility-focused services, multilingual support, or hands-free customer assistance.

What problem does this solve?

  • Enables natural voice conversations with AI
  • Breaks down language and accessibility barriers
  • Provides instant voice responses to customer queries
  • Reduces typing requirements for users
  • Offers 24/7 voice-based customer support
  • Maintains conversation context across voice interactions

What this workflow does:

  1. Receives voice messages via Telegram bot
  2. Transcribes audio using Deepgram's advanced speech-to-text
  3. Processes transcribed text through AI agent with knowledge base access
  4. Generates intelligent responses based on conversation context
  5. Converts AI response to natural-sounding speech using Deepgram TTS
  6. Sends audio response back to user via Telegram
  7. Maintains conversation memory for contextual interactions

πŸ”§ Technical Architecture

Core Components:

  • Telegram Bot: Receives and sends voice messages
  • Deepgram STT: Transcribes voice to text with high accuracy
  • OpenAI GPT: Processes queries and generates responses
  • Supabase Knowledge Base: Stores and retrieves business information
  • Memory Management: Maintains conversation context
  • Deepgram TTS: Converts text responses to natural speech

Data Flow:

  1. Voice Message β†’ Telegram API β†’ File Download
  2. Audio File β†’ Deepgram STT β†’ Transcript
  3. Transcript β†’ AI Agent β†’ Response Generation
  4. Response β†’ Deepgram TTS β†’ Audio File
  5. Audio Response β†’ Telegram β†’ User

πŸ› οΈ Setup Instructions

Prerequisites

  1. Telegram Bot Token

    • Create bot via @BotFather
    • Get bot token and configure webhook
  2. Deepgram API Key

    • Sign up at deepgram.com
    • Get API key for STT and TTS services
    • Note: Currently hardcoded in workflow
  3. OpenAI API Key

    • OpenAI account with API access
    • Configure in OpenAI Chat Model node
  4. Supabase Database

    • Create Supabase project
    • Set up knowledge_base table
    • Configure API credentials

Step-by-Step Setup

  1. Configure Telegram Bot

    - Update telegramToken in "Prepare Voice Message Data" node
    - Set correct bot token in Telegram nodes
    - Test bot connectivity
    
  2. Set Up Deepgram Integration

    - Replace API key in "Transcribe with Deepgram" node
    - Update TTS endpoint in "HTTP Request" node
    - Test voice transcription accuracy
    
  3. Configure Knowledge Base

    -- Create knowledge_base table in Supabase
    CREATE TABLE knowledge_base (
      id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
      question TEXT NOT NULL,
      answer TEXT NOT NULL,
      category VARCHAR(100),
      keywords TEXT[],
      created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
    );
    
  4. Customize AI Prompts

    • Update system message in "Telegram AI Agent" node
    • Adjust temperature and max tokens in OpenAI model
    • Configure memory session keys
  5. Test End-to-End Flow

    • Send test voice message to bot
    • Verify transcription accuracy
    • Check AI response quality
    • Validate audio output clarity

πŸŽ›οΈ Configuration Options

Voice Recognition Settings

  • Model: nova-2 (Deepgram's latest model)
  • Language: English (en) - can be changed
  • Smart Format: Enabled for better punctuation

AI Response Settings

  • Temperature: 0.3 (conservative responses)
  • Max Tokens: 100 (adjust based on needs)
  • Memory: Session-based conversation context

Text-to-Speech Settings

  • Model: aura-2-thalia-en (natural female voice)
  • Alternative voices: Available in Deepgram TTS API
  • Audio Format: Optimized for Telegram

πŸ”’ Security Considerations

API Key Management

// Current implementation has hardcoded tokens
// Recommended: Use environment variables
const telegramToken = process.env.TELEGRAM_BOT_TOKEN;
const deepgramKey = process.env.DEEPGRAM_API_KEY;

Data Privacy

  • Voice messages are processed by external APIs
  • Consider data retention policies
  • Implement user consent mechanisms
  • Ensure GDPR compliance if applicable

πŸ“Š Monitoring & Analytics

Key Metrics to Track

  • Voice message processing time
  • Transcription accuracy rates
  • AI response quality scores
  • User engagement metrics
  • Error rates and failure points

Recommended Logging

// Add to workflow for monitoring
console.log({
  timestamp: new Date().toISOString(),
  user_id: userData.user_id,
  transcript_confidence: transcriptData.confidence,
  response_length: aiResponse.length,
  processing_time: processingTime
});

πŸš€ Customization Ideas

Enhanced Features

  1. Multi-language Support

    • Add language detection
    • Support multiple TTS voices
    • Translate responses
  2. Voice Commands

    • Implement wake words
    • Add voice shortcuts
    • Create voice menus
  3. Advanced AI Features

    • Sentiment analysis
    • Intent classification
    • Escalation triggers
  4. Integration Expansions

    • Connect to CRM systems
    • Add calendar scheduling
    • Integrate with help desk tools

Performance Optimizations

  • Implement audio preprocessing
  • Add response caching
  • Optimize API call sequences
  • Implement retry mechanisms

πŸ› Troubleshooting

Common Issues

Voice Not Transcribing

  • Check Deepgram API key validity
  • Verify audio format compatibility
  • Test with shorter voice messages

Poor Audio Quality

  • Adjust TTS model settings
  • Check network connectivity
  • Verify Telegram audio limits

AI Responses Too Generic

  • Improve knowledge base content
  • Adjust system prompts
  • Increase context window

Memory Not Working

  • Check session key configuration
  • Verify user ID extraction
  • Test conversation continuity

πŸ’‘ Best Practices

Voice Interface Design

  • Keep responses concise and clear
  • Use natural speech patterns
  • Avoid technical jargon
  • Provide clear next steps

Knowledge Base Management

  • Regular content updates
  • Clear categorization
  • Keyword optimization
  • Quality assurance testing

User Experience

  • Fast response times (<5 seconds)
  • Consistent voice personality
  • Graceful error handling
  • Clear capability communication

πŸ“ˆ Success Metrics

Technical KPIs

  • Response time: <3 seconds average
  • Transcription accuracy: >95%
  • User satisfaction: >4.5/5
  • Uptime: >99.5%

Business KPIs

  • Customer query resolution rate
  • Support ticket reduction
  • User engagement increase
  • Cost per interaction decrease

πŸ”„ Maintenance Schedule

Daily

  • Monitor error logs
  • Check API rate limits
  • Verify service uptime

Weekly

  • Review conversation quality
  • Update knowledge base
  • Analyze usage patterns

Monthly

  • Performance optimization
  • Security audit
  • Feature updates
  • User feedback review

πŸ“š Additional Resources

Documentation Links

Community Support

  • n8n Community Forum
  • Telegram Bot Developers Group
  • Deepgram Developer Discord
  • OpenAI Developer Community

Note: This template requires active API subscriptions for Deepgram and OpenAI services. Costs may apply based on usage volume.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Transcribe with Deepgram

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 3

Block 2 - Download Voice File

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 3

Block 3 - Get File Path

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 4 - Prepare Voice Message Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - Prepare Text Message Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 6 - Knowledge base

Type / Role
n8n-nodes-base.supabaseTool - supabaseTool
Config choices
Version 1

Block 7 - Telegram Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 8 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.1

Block 9 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 10 - Has Transcript?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 11 - Is Voice Message?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 12 - Telegram Trigger

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.1

Block 13 - Generate Audio Response

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 14 - Send Audio Response

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 15 - Workflow Guide

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Was Voice Input?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 17 - Send Text Response

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

3. Summary Table

Workflow πŸŽ™οΈ VoiceFlow AI: Telegram + Deepgram + OpenAI + Supabase audio assistant
Complexity advanced
Nodes 17
Categories Support Chatbot, AI Chatbot
Author RedOne
Published 04 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4638/4638.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does πŸŽ™οΈ VoiceFlow AI: Telegram + Deepgram + OpenAI + Supabase audio assistant do?

️ AI Audio Assistant with Voice to Voice Response Who is this for? Businesses, customer service teams, content creators, and organizations who want to provide intelligent voice based interactions...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Support Chatbot, AI Chatbot use case.