Hi, Im using n8n desktop & would like to be able to send out automated messages to various social media accounts every time I upload a new video to YT or start a live stream.
So far Ive managed to get my published videos using the YouTube node:
Im guessing a solution would be to get all videos and then filter out videos uploaded after the last time the flow as run and then run the rest of the code once for every video that was found (which in my case would be send a few social media messages), but Im not really sure how to do that .
Hey @officernickwilde, welcome to the community!
Two approaches I can think of would be:
- 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. This should be fairly resilient.
- 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 an interval node (to have the workflow run every 5 minutes) and then set the published after value from your screenshot to an expression like
Hope this helps! Give me a shout if you run into trouble with these suggestions