Unpublish expired YouTube videos using Google Sheets and Slack
Quick Overview This workflow runs daily and checks a Google Sheets embargo schedule for YouTube videos whose unpublish date has passed, then updates their privacy status on YouTube and logs the result back to the sheet while sending a recap (or “nothing due”) message to Slack.
How it works Runs every day at 6am on a schedule trigger. Reads your embargo control spreadsheet from Google Sheets. Selects videos whose “Unpublish Date” is today or earlier (using a configured timezone), skips rows already marked Expired, and defaults the target privacy status to private when missing. For each due video, fetches the current video snippet and status from YouTube. If the video is not already at the target privacy status, updates the video on YouTube to private or unlisted while preserving its existing title and category. Updates the matching row in Google Sheets to Status = Expired and writes an “Unpublished At” timestamp, then posts a Slack recap of the processed videos. If no videos are due, posts a “nothing due” notice to the configured Slack channel.
Setup Add a YouTube (Google) OAuth2 credential with permission to read and update videos, and select it in both YouTube steps. Add a Google Sheets credential and replace YOUR_GOOGLE_SHEET_ID with your spreadsheet, then ensure the sheet includes columns like videoId, Unpublish Date, Target Status, Status, Title, and Unpublished At. Add a Slack credential, set YOUR_SLACK_CHANNEL_ID to the channel you want notifications sent to, and ensure the bot/user can post there. Set the TIMEZONE constant in the code step to your channel’s IANA timezone (for example, America/Halifax or Europe/London).
Related Templates
Send structured logs to BetterStack from any workflow using HTTP Request
Send structured logs to BetterStack from any workflow using HTTP Request Who is this for? This workflow is perfect for...
Google Sheets UI for n8n Workflow
Google Sheets UI for Workflow Control This n8n template provides a practical and efficient way to manage your n8n workf...
Restore your workflows from GitHub
This workflow restores all n8n instance workflows from GitHub backups using the n8n API node. It complements the Backup ...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments