📱 Automatically copy & translate Telegram channel content with GPT-4o-mini

1,799 views · 📱 Social Media & Email Marketing

Description

Overview

This n8n workflow automatically fetches the latest post from a Telegram channel, translates it using OpenAI, and republishes it to another channel. It supports text, images, and videos.

Features

Prerequisites

Required Credentials

  1. Telegram Bot API

    • Create a bot via @BotFather
    • Get your bot token
    • Add the bot as an admin to your target channel
  2. OpenAI API

    • Sign up at OpenAI Platform
    • Generate an API key
    • Ensure you have sufficient credits

Channel Requirements

Setup Instructions

1. Import the Workflow

2. Configure Credentials

Telegram Bot Credentials

  1. Go to CredentialsAdd Credential
  2. Select Telegram
  3. Enter your bot token from BotFather
  4. Test the connection
  5. Save as “TelegramBot”

OpenAI Credentials

  1. Go to CredentialsAdd Credential
  2. Select OpenAI
  3. Enter your OpenAI API key
  4. Save as “OpenAI API”

3. Configure Channel Settings

Open the “Set Source Channel” node and modify:

sourceChannel: "channel_here",              // Source channel username (without @)
targetChannel: "@your_channel_here",  // Target channel (@channel or chat_id)
targetLanguage: "Persian",            // Target language for translation
channelSignature: "signature text"     // The channel signature to replaced

4. Adjust Schedule (Optional)

5. Test the Workflow

  1. Click “Execute Workflow” to test manually
  2. Check if content appears in your target channel
  3. Verify translation quality and formatting

6. Activate the Workflow

Content Filtering

Modify the “Clean Post Content” node to remove specific text patterns:

let cleanPost = $input.first().json.post
  .replaceAll('unwanted_text', '')
  .replaceAll(/regex_pattern/g, '')
  .trim();

Multiple Source Channels

To monitor multiple channels:

  1. Duplicate the workflow
  2. Change the sourceChannel in each copy
  3. Use different schedules to avoid conflicts

Custom Scheduling

The Schedule Trigger supports various patterns:

Troubleshooting

Common Issues

No content fetched

Translation fails

Can’t send to target channel

Compliance

🔗 Nodes Used

HTTP Request, Telegram, Schedule Trigger, OpenAI

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup