Automate YouTube Video Alerts with n8n and Telegram

This n8n workflow automatically checks a YouTube channel every 30 minutes and sends Telegram alerts for new videos, saving you time and ensuring you never miss content. It filters duplicates and posts updates directly to your Telegram group chat.
youTube
telegram
interval
+2
Workflow Identifier: 1419
NODES in Use: Set, Function, Interval, YouTube, Telegram

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

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!

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free