Automate YouTube-to-Email Alerts with n8n
If you love keeping up with your favorite YouTube channels but hate constantly refreshing your subscriptions page, this workflow template is going to feel like a relief. With n8n, you can automatically get an email whenever a channel you follow publishes a new long-form video, without touching the YouTube app.
This workflow quietly runs in the background, checks your YouTube subscriptions, reads each channel’s RSS feed to find fresh uploads, enriches those videos with YouTube API data like thumbnails and duration, filters out shorts and irrelevant items, then sends you a clean email for every new long video.
Let’s walk through what it does, when you’d actually want to use it, and how the whole thing is wired together in n8n.
What this n8n template actually does
At a high level, the workflow:
- Runs on a schedule (for example, every hour).
- Pulls your YouTube subscriptions via the YouTube Data v3 API.
- Checks which channels have new or unwatched items.
- Optionally skips channels you do not want alerts for.
- Reads each channel’s RSS feed to grab its latest 15 videos.
- Keeps only videos that were published since the last run.
- Calls the YouTube API again to get thumbnails and duration.
- Filters out shorts and very short videos.
- Sends you an HTML email for each new long-form video.
So instead of endlessly scrolling through YouTube, you just open your inbox and see exactly what is new and worth watching.
Why this approach works so well
You might be wondering: why not just use the YouTube API for everything? The short answer is quota and cost.
The template relies on YouTube’s RSS feeds for each channel:
https://www.youtube.com/feeds/videos.xml?channel_id=CHANNEL_ID
Those feeds are free to use and do not touch your YouTube Data API quota. The workflow uses them to fetch the latest 15 videos per channel, then only calls the YouTube Data API when it truly has to, mainly to get:
- Video duration (to separate shorts from long-form content).
- Thumbnails (so your email looks good and clickable).
By doing it this way, you:
- Save API quota for when you actually need it.
- Keep the workflow light and cheap to run.
- Still get rich metadata for your emails.
In other words, RSS does the heavy lifting, and the YouTube API just fills in the gaps.
When to use this YouTube-to-email automation
This template is perfect if you:
- Follow a lot of channels and miss uploads in the noise.
- Prefer email over app notifications or YouTube’s random recommendations.
- Want to avoid spammy shorts and only get longer videos.
- Care about API quota and do not want to burn through it on every check.
- Like the idea of building your own “personal YouTube digest” in n8n.
You can even tune it to be as quiet or as chatty as you want by changing the schedule or filtering out specific channels.
How the workflow runs from start to finish
Let’s go through the node chain in a more natural story flow, from the moment the workflow wakes up to the moment the email lands in your inbox.
1. Schedule Trigger – deciding how often to check YouTube
Everything starts with the Schedule Trigger node. This is where you tell n8n how often to look for new videos. The example workflow is set to run every hour, but you can adjust that:
- Run more often if you never want to miss a video.
- Run less often if you want fewer emails and fewer API calls.
Just open the Schedule Trigger node and change the interval. Increasing the interval automatically reduces how many times the workflow runs and how often it hits the YouTube API.
2. Fetching your YouTube subscriptions
Next, the workflow uses the YouTube Data v3 API to grab your subscriptions. It calls the subscriptions endpoint and pulls your channel list in pages of 50 items per request, with pagination handled for you.
The request looks like this:
GET https://www.googleapis.com/youtube/v3/subscriptions?mine=true&part=snippet,contentDetails&maxResults=50
Each call uses some API quota, but this is kept under control because:
- The subscriptions endpoint is called only once per run.
- Detailed video info is gathered later via RSS first, not via the API directly.
3. Error checking and splitting subscriptions
Once the response comes back, a node checks if the API returned an error object. If something went wrong, the workflow stops and gives you a helpful error message instead of silently failing.
If everything is fine, the workflow splits the list of subscriptions so that each channel is processed as its own item. This makes it easy to filter, query RSS feeds, and call the YouTube API on a per-channel basis.
4. Keeping only channels with new or unwatched videos
To avoid doing unnecessary work, the workflow looks at contentDetails.newItemCount for each subscription and only keeps channels where:
contentDetails.newItemCount > 0
This field roughly indicates that there are new uploads you have not seen yet. It is not perfect, but it dramatically cuts down the number of channels that need to be checked every run.
5. Optional channel filter – skipping noisy channels
There are always a few channels that upload too often or just are not “email-worthy.” You can easily exclude them.
In the workflow, there is a Filter node where you can add channel IDs to a notContains array. Any channel whose ID matches that list will be skipped.
You can grab a channel ID from YouTube by using Share → Copy channel ID, then paste it into that filter. This is handy for:
- High-volume channels that would flood your inbox.
- Channels you still want to follow in YouTube but not via email.
6. Using RSS to get the latest 15 videos per channel
For each remaining channel, the workflow builds the YouTube RSS feed URL using the channel ID from the subscription snippet. In the RSS node, the expression looks like this:
=https://www.youtube.com/feeds/videos.xml?channel_id={{ $json.snippet.resourceId.channelId }}
That feed returns the 15 most recent videos for that channel, and the best part is that it does not cost you any YouTube Data API quota.
7. Only keeping videos published since the last run
Now that we have the latest videos, we do not want to email you about the same ones over and over. So the workflow compares each video’s publish date with the time window since the last run.
The Schedule Trigger node exposes a timestamp, and the workflow uses that along with the configured interval to compute when the previous run started. The expression looks like this:
= $('Schedule Trigger').item.json.timestamp.toDateTime().minus( $('Schedule Trigger').params.rule.interval[0].hoursInterval, $('Schedule Trigger').params.rule.interval[0].field ).toISO()
Then the filter checks:
= {{ $json.pubDate.toDateTime() }} is after the computed ISO timestamp
Only videos published after that timestamp pass through. This is what keeps your inbox free of duplicates, as long as your schedule and filter window line up correctly.
8. Calling the YouTube API for video details
At this point, we have a list of fresh videos from RSS. Now we need richer metadata so we can filter out shorts and build a nice email.
The workflow calls the YouTube Data v3 videos endpoint with:
part=contentDetails,snippet,id
From this, we get:
contentDetails.duration– to see how long the video is.snippet.thumbnails– a set of thumbnails in different resolutions.
The RSS ID looks like yt:video:VIDEO_ID, so the workflow strips the prefix using this expression:
= {{ $json.id.replace("yt:video:", "") }}
That cleaned up ID is what is sent to the YouTube API.
9. Filtering out YouTube Shorts and very short videos
Most YouTube Shorts are under 60 seconds. To avoid getting email alerts for those, the workflow converts the ISO 8601 duration from the API into seconds and applies a simple rule.
The core check (in an If node) looks like this:
=
Duration.fromISO($json.contentDetails.duration).as('seconds') > 61
Videos pass if:
- The duration is missing (common for some live broadcasts), or
- The duration is greater than 61 seconds.
This means regular long-form videos and some live content get through, while typical shorts are filtered out. If you want to be stricter, you can change the logic so that only videos with an existing duration greater than 60 seconds are allowed.
10. Sending an email for each new long-form video
Finally, the Email node builds and sends a nicely formatted HTML email per new video. The email includes:
- The video title as a big heading.
- The highest-resolution thumbnail available.
- A link directly to the YouTube watch page.
The email subject is set to the channel title so you can quickly see which channel the video is from.
To pick the best thumbnail, the template grabs the last entry in the thumbnails object, which usually corresponds to the highest resolution. Here is the example HTML expression used:
=
<h1 style="text-align: center;">{{ $json.snippet.title }}</h1>
<a href="https://www.youtube.com/watch?v={{ $json.id }}"> <img decoding="async" src="{{ $json.snippet.thumbnails[Object.keys($json.snippet.thumbnails)[Object.keys($json.snippet.thumbnails).length - 1]].url }}" alt="Watch on YouTube" style="width:100%; height:auto; max-width:640px; display:block; margin: 10px auto;">
</a>
To make this work, you just need to configure your email credentials in n8n. The example uses SMTP, but you can also plug in other supported email providers if you have them set up.
Configuration tips so everything runs smoothly
Before you hit “activate,” here are a few practical things to double-check.
Set the right schedule frequency
- Shorter interval (like every 15 minutes) gives you near real-time alerts but more API calls.
- Longer interval (like every few hours) keeps things quieter and reduces quota usage.
Adjust this directly in the Schedule Trigger node.
Make sure pagination is handled for subscriptions
The YouTube subscriptions endpoint returns your channels in pages. The template already handles page tokens so that all your subscriptions are retrieved, not just the first 50. You do not have to do anything here, but it is good to know it is built-in.
Set up your credentials in n8n
- YouTube OAuth2 credential – required for accessing your subscriptions and video details via the YouTube Data v3 API.
- SMTP or email provider credential – required by the Email node to send messages.
Make sure both are configured and selected in the relevant nodes before running the workflow.
Exclude channels you do not want alerts from
If some channels are too noisy, you can manually exclude them. To do that:
- Get the channel ID from YouTube (Share → Copy channel ID).
- Add those IDs to the filter array in the channel filter node (the one that uses
notContains).
That way, you stay subscribed on YouTube but do not get email alerts for those particular channels.
Troubleshooting and edge cases
Here are a few things that might come up and how the template handles them.
- Live broadcasts with no duration
Some live videos posted as regular uploads do not have a duration in the API. The workflow treats missing duration as “let it pass” so you do not miss them. If you prefer, you can tighten the filter logic to require a duration. - Hitting YouTube API rate limits
If you run into quota issues, consider:- Increasing the interval on the Schedule Trigger node.
- Relying on RSS as much as possible, which the workflow already does.
- Further narrowing which channels or videos you process.
- Getting duplicate emails
If you see repeat emails for the same video, check that your “keep only videos published since last run” filter is aligned with your schedule interval. The timestamp logic depends on that interval, so mismatches can create overlapping windows.
Ideas for enhancing this workflow
Once you have the basic template running, you can easily extend it in n8n. Some popular tweaks include:
- Daily or weekly digest instead of one-email-per-video
Aggregate all new videos into a single summary email rather than sending separate messages. - Richer email content
Add the video description, publish date, and duration into the email body so you can decide what to watch at a glance. - Send alerts to chat tools
In addition to email, push new video notifications to Slack, Discord, or other chat platforms by adding more nodes. - Track emailed video IDs
Use a small database, a Spreadsheet, or a Set node to remember which video IDs have already been sent. This gives you an extra layer of de-duplication on top of the time-based filter.
How to get started with the template
Ready to turn your inbox into a smart YouTube notification center? Here is the quick setup flow:
- Import the workflow JSON into your n8n instance.
- Connect your YouTube OAuth2 credential.
- Connect your SMTP or other email credential.
- Set your preferred schedule frequency in the Schedule Trigger node.
- Optionally, add any channel IDs you want to exclude.
- Activate the workflow and let it run.
Once it is live, you will start seeing clean, thumbnail-rich emails for new long-form videos from the channels you care about.
If you want, you can:
- Get the exact n8n workflow JSON to import directly.
- Walk through YouTube OAuth2 or SMTP setup step by step.
- Customize the email template or switch to a digest-style summary.
When you are ready, you can jump straight into the template here:
