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
- Works Without Admin Privileges - Does not require any bot to be an admin in the source channel.
- Scheduled execution - Runs daily at a configurable time
- AI-powered translation - Uses OpenAI GPT-4o-mini for natural translations
- Multi-media support - Handles text, images, and videos
- Easy configuration - All settings in one centralized node
- Automatic content cleaning - Removes original channel signatures
Prerequisites
Required Credentials
-
Telegram Bot API
- Create a bot via @BotFather
- Get your bot token
- Add the bot as an admin to your target channel
-
OpenAI API
- Sign up at OpenAI Platform
- Generate an API key
- Ensure you have sufficient credits
Channel Requirements
- Source Telegram channel must be public
- Bot must have admin rights in the target channel
Setup Instructions
1. Import the Workflow
- Copy the workflow JSON and import it into your n8n instance
- The workflow will be imported in inactive state
2. Configure Credentials
Telegram Bot Credentials
- Go to Credentials → Add Credential
- Select Telegram
- Enter your bot token from BotFather
- Test the connection
- Save as "TelegramBot"
OpenAI Credentials
- Go to Credentials → Add Credential
- Select OpenAI
- Enter your OpenAI API key
- 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)
- Open the "Daily Schedule" node
- Default: Runs daily at 9:00 AM
- Modify
triggerAtHour
and triggerAtMinute
as needed
5. Test the Workflow
- Click "Execute Workflow" to test manually
- Check if content appears in your target channel
- Verify translation quality and formatting
6. Activate the Workflow
- Toggle the workflow to Active status
- Monitor execution logs for any errors
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:
- Duplicate the workflow
- Change the
sourceChannel
in each copy
- Use different schedules to avoid conflicts
Custom Scheduling
The Schedule Trigger supports various patterns:
- Hourly:
{ "triggerAtMinute": 0 }
- Weekly:
{ "triggerAtWeekday": 1, "triggerAtHour": 9 }
- Multiple times: Use multiple schedule nodes
Troubleshooting
Common Issues
No content fetched
- Verify source channel is public
- Check if channel name is correct (without @)
- Ensure channel has recent posts
Translation fails
- Verify OpenAI API key is valid
- Check API usage limits and credits
- Ensure content is not empty
Can't send to target channel
- Verify bot is admin in target channel
- Check channel username/ID format
- Test bot permissions manually
Compliance
- Respect copyright and fair use policies
- Add proper attribution when required
- Follow Telegram's Terms of Service