Skip to content

My Workflow 4 - Translation Test

A multilingual AI assistant workflow that processes both text and voice messages through WhatsApp and web chat interfaces, providing translation services and AI-powered responses in multiple languages including Luganda, Swahili, and English.

Purpose

No business context provided yet — add a context.md to enrich this documentation.

This workflow serves as a testing environment for translation capabilities and multilingual AI agent functionality. It enables users to interact with an AI assistant that can understand and respond in multiple languages, with particular focus on East African languages like Luganda and Swahili alongside English.

How It Works

The workflow operates through two main pathways:

Web Chat Interface: 1. User sends a message through the LangChain chat interface 2. The message is simultaneously sent to Google Translate for Luganda translation and to an AI Agent 3. The AI Agent, equipped with translation tools and conversation memory, processes the input 4. The agent can use Google Translate as a tool to provide multilingual responses

WhatsApp Interface (Currently Disabled): 1. WhatsApp webhook receives incoming messages 2. System checks if the message contains audio content 3. For voice messages: downloads the audio file, transcribes it using OpenAI Whisper, then processes the text 4. For text messages: directly processes the message content 5. The processed message is sent to Google Translate and an AI Agent for multilingual response generation

Both pathways utilize OpenAI's GPT-4.1-mini model with conversation memory to maintain context across interactions.

Workflow Diagram

graph TD
    A[When chat message received] --> B[Translate a language]
    A --> C[AI Agent]

    D[WhatsApp Webhook - DISABLED] --> E[If Voicenote1]
    E -->|Audio| F[Download Voice File1]
    E -->|Text| G[Text In]
    F --> H[Transcribe a recording1]
    H --> I[Voice Out]
    I --> J[User Message]
    G --> J
    J --> K[Translate a language1]
    J --> L[AI Agent1]

    M[Simple Memory] -.->|ai_memory| C
    N[Translate a language in Google Translate] -.->|ai_tool| C
    O[OpenAI Chat Model] -.->|ai_languageModel| C

    P[Simple Memory1] -.->|ai_memory| L
    Q[Translate a language in Google Translate1] -.->|ai_tool| L
    R[OpenAI Chat Model1] -.->|ai_languageModel| L

Triggers

  • LangChain Chat Trigger: Web-based chat interface for direct user interaction
  • WhatsApp Webhook (disabled): POST endpoint at /webhook/coaching-start for WhatsApp message processing

Nodes Used

Node Type Purpose
Chat Trigger Receives messages from web chat interface
Webhook Receives WhatsApp messages (currently disabled)
Google Translate Translates text to Luganda language
Google Translate Tool Provides translation capabilities to AI agents
AI Agent Processes user input with translation and conversation capabilities
OpenAI Chat Model Powers the AI agents with GPT-4.1-mini
Memory Buffer Window Maintains conversation context for AI agents
OpenAI Transcribe Converts voice messages to text
HTTP Request Downloads voice files from WhatsApp
If Condition Routes messages based on content type (audio vs text)
Set Formats and structures data between nodes

External Services & Credentials Required

  • OpenAI API: For AI chat model and audio transcription
    • Credential: "Waringa"
    • Used for: GPT-4.1-mini model and Whisper transcription
  • Google Cloud Translation API: For language translation services
    • Credential: "Google Service Account Waringa"
    • Used for: Text translation to/from Luganda, Swahili, and English

Environment Variables

No specific environment variables are required beyond the credential configurations for OpenAI and Google Cloud services.

Data Flow

Input: - Text messages via web chat or WhatsApp - Voice messages via WhatsApp (when enabled) - Supported languages: English, Luganda, Swahili

Processing: - Voice-to-text conversion for audio inputs - Language translation between supported languages - AI-powered response generation with conversation memory - Tool-assisted translation capabilities

Output: - Translated text in target language (primarily Luganda) - AI-generated responses in appropriate language - Maintained conversation context across interactions

Error Handling

The workflow includes basic error handling through: - Conditional routing for different message types (audio vs text) - Always output data configuration on AI agents to ensure execution continues - Separate processing paths for different input sources

No explicit error handling nodes are present, so failures would stop execution at the failing node.

Known Limitations

  • WhatsApp integration is currently disabled
  • Limited to specific language pairs (English, Luganda, Swahili)
  • No explicit error recovery mechanisms
  • Voice processing only available through WhatsApp pathway
  • Translation accuracy depends on Google Translate's support for Luganda

No related workflows specified in the current context.

Setup Instructions

  1. Import the Workflow

    • Import the JSON file into your n8n instance
    • The workflow will be created with the name "My workflow 4"
  2. Configure Credentials

    • Set up OpenAI API credentials named "Waringa"
    • Configure Google Cloud Service Account credentials named "Google Service Account Waringa"
    • Ensure the Google account has Translation API access enabled
  3. Enable WhatsApp Integration (Optional)

    • Enable the "WhatsApp Webhook" node if WhatsApp integration is needed
    • Configure Twilio WhatsApp webhook to point to your n8n instance
    • Update the webhook path if necessary
  4. Test the Workflow

    • Use the LangChain chat interface to send test messages
    • Verify translation functionality with messages in different languages
    • Test voice processing through WhatsApp if enabled
  5. Customize Settings

    • Adjust AI agent system messages as needed
    • Modify translation target languages in Google Translate nodes
    • Configure memory settings for conversation length

The workflow is currently active and ready for testing translation and multilingual AI capabilities.