Telegram notification when a new video is uploaded to a YouTube channel

Hello, I want to create an automation with n8n. I want the automation to notify me on Telegram when the YouTube channels I specify upload new videos. I’m not sure how to do this; can you help me?

Hi @ibere :wave:

You could do something like this:

In order to return results, I picked a date early in October - but in order to do what you’re looking for exactly, you’d need either:

  • Implement a polling logic. In other words, store the Ids of the already processed videos in a database/Google Sheet etc., then run the workflow every 5 minutes fetching all videos and filter out those that have already been processed. If you set this up, it would be unlikely for you to see a duplicate message.
  • A simpler approach would be to simply run your workflow every 5 minutes and then search for videos published after whatever time it was 5 minutes ago. To achieve this you’d need a Schedule Trigger node (to have the workflow run every 5 minutes) and then set the published after value from your screenshot to an expression like {{ new Date(new Date().getTime() - 5 * 60 * 1000) }}. This example expression uses JavaScript’s new Date() to calculate the timestamp from 5 minutes ago.

I’d probably go with option 2, personally! :+1:

2 Likes

can you share me option 2 ? thanks

Hi @ibere :wave:

That would look something like this:

1 Like

Thank you so much, i will try :heart_eyes:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.