1. Opening Problem Statement
Meet Marco, a YouTube channel manager who oversees the content updates for a tech influencer. Every day, Marco had to manually check the YouTube channel for new videos and post the updates manually to a Telegram group chat consisting of followers and team members. This repetitive task consumed at least 30 minutes daily and sometimes resulted in delays or missed announcements, causing frustration and loss of engagement.
Marco needed an automated way to monitor new videos from the channel and instantly notify the Telegram community. The challenge was to avoid duplicate messages for the same video, filter only the latest videos, and do this regularly without manual intervention.
2. What This Automation Does
This specialized n8n workflow automates the process of monitoring new videos on a specific YouTube channel and sending formatted notifications to a Telegram group. When triggered, here’s what happens:
- Automatically checks the chosen YouTube channel every 30 minutes for the 4 most recent videos.
- Filters out any videos already notified to avoid duplicate alerts.
- Formats the video title and URL into a Telegram message with HTML markup.
- Posts the new video announcements directly into a specific Telegram group chat.
- Keeps internal tracking of notified video IDs to prevent repeat messages.
- Saves Marco at least 15 minutes daily by fully automating the notification process.
3. Prerequisites ⚙️
- n8n account with access rights to create workflows.
- YouTube account with API access and OAuth2 credentials configured in n8n.
- Telegram bot token authorized to post messages in your target Telegram group.
- Basic familiarity with the n8n interface.
4. Step-by-Step Guide
Step 1: Setup the Interval Trigger
In the n8n editor, click + Add Node, search for “Interval” or “CheckTime” node, then select it.
Configure the node:
Set the unit to minutes and interval to 30.
You should see the node configured to run every half hour. This triggers the workflow automatically without manual input.
Common mistake: Forgetting to set the unit correctly (seconds instead of minutes) will cause excessive triggers.
Step 2: Configure the YouTube Node
Add the YouTube node and link it to the Interval node.
Set resource to video.
Under filters, enter the channel ID you want to monitor (for example, UCTe5YtigJdZZ3i-za6IkbGQ).
Limit results to 4 and sort by date so it pulls the newest videos.
Ensure OAuth2 credentials are connected for the YouTube API.
You will get JSON data containing video details when triggered.
Common mistake: Using incorrect channel ID or missing API credentials.
Step 3: Extract Video Info with the Set Node
Add a Set node linked to the YouTube node.
Use expressions to extract relevant fields:
- id:
{{$node["GetVideosYT"].json["id"]["videoId"]}} - url:
https://youtu.be/{{$node["GetVideosYT"].json["id"]["videoId"]}} - title:
{{$node["GetVideosYT"].json["snippet"]["title"]}}
Set the option Keep Only Set to true to output only these fields.
This prepares clean, simplified data for further processing.
Step 4: Filter Previously Sent Videos with the Function Node
Add a Function node to remove duplicates by comparing video IDs to previously stored IDs.
Paste the following JavaScript code inside the Function node editor:
const new_items = [];
const data = this.getWorkflowStaticData('node');
data.ids = data.ids || [];
for (var i=0; i item.json.id)
return new_items;
This script compares current videos to the saved list and returns only new videos to notify.
Common mistake: Not initializing the stored ID array, resulting in all videos being treated as new.
Step 5: Send Notifications via Telegram
Add a Telegram node linked to the Function node.
Configure the node with your Telegram bot API credentials.
Set the chat ID of your Telegram group chat where notifications will post.
Use this message template:=Nuovo video di almi su YouTube!
{{$node["Function"].json["title"]}}
{{$node["Function"].json["url"]}}
Enable HTML parse mode for message formatting.
When the workflow runs, new videos trigger these formatted messages directly to Telegram.
Common mistake: Using an incorrect chat ID or not setting parse mode causes delivery or formatting issues.
5. Customizations ✏️
- Change YouTube Channel: In the GetVideosYT node filters, update the channelId field to watch a different YouTube channel.
- Add More Videos Limit: Adjust the ‘limit’ parameter in the YouTube node to fetch more or fewer videos per check.
- Modify Telegram Message: In the SendVideo node, update the ‘text’ field to add hashtags or customize the message style.
- Adjust Interval Frequency: In the CheckTime node, set the interval to a different number of minutes depending on your need for update frequency.
- Store Additional Video Info: In the Set node, add more fields such as video duration or publication date for richer notifications.
6. Troubleshooting 🔧
Problem: “No new videos detected or notifications not sent.”
Cause: The Function node’s stored ID list may be empty or not correctly updated.
Solution: Check that the Function node initializes and updates the static data store properly. Reset stored IDs to empty to reprocess videos.
Problem: “Telegram message formatting broken or not delivered.”
Cause: Incorrect chat ID or missing parse mode in Telegram node.
Solution: Verify Telegram chat ID is correct and enable parse_mode to HTML.
7. Pre-Production Checklist ✅
- Verify YouTube OAuth2 credentials are correctly set and working.
- Confirm Telegram bot token is active and allowed to post in the group.
- Test the Interval node triggers and check execution logs.
- Run the workflow manually to simulate new video notifications.
- Confirm the Function node filters duplicates accurately by testing with repeated video IDs.
8. Deployment Guide
Activate the workflow in n8n by toggling it ON.
Monitor the first few runs via n8n execution logs to ensure messages are posted correctly.
Schedule regular checks and confirm Telegram notifications arrive every 30 minutes.
Optionally, self-host n8n for full control and secure your workflow on your own server with solutions like Hostinger (https://buldrr.com/hostinger).
9. FAQs
Q: Can I monitor multiple YouTube channels?
A: Yes, but you’d need to duplicate the workflow or enhance it to poll multiple channel IDs sequentially.
Q: Does this workflow consume YouTube API quota?
A: Yes, each call to fetch videos counts towards your quota. Limit the frequency and number fetched to manage usage.
Q: Is my video data secure?
A: Your data stays within n8n’s environment. Using OAuth2 means credentials are securely handled.
10. Conclusion
By following this step-by-step guide, you transformed a time-consuming manual task into a seamless automatic YouTube video alert system with n8n and Telegram. You saved at least 15 minutes daily and improved communication speed with your audience.
Next, consider expanding this by integrating video analytics to gain insights or creating Twitter alerts for your YouTube updates. With n8n, your automation possibilities are vast and adaptable.
Start automating today and keep your communities instantly informed and engaged!