See llms.txt for all machine-readable content.

Back to Templates

Unpublish expired YouTube videos using Google Sheets and Slack

Created by

Created by: Kevin Yu || exekyute
Kevin Yu

Last update

Last update 17 hours ago

Categories

Share


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

  1. Runs every day at 6am on a schedule trigger.
  2. Reads your embargo control spreadsheet from Google Sheets.
  3. 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.
  4. For each due video, fetches the current video snippet and status from YouTube.
  5. 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.
  6. 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.
  7. If no videos are due, posts a “nothing due” notice to the configured Slack channel.

Setup

  1. Add a YouTube (Google) OAuth2 credential with permission to read and update videos, and select it in both YouTube steps.
  2. 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.
  3. 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.
  4. Set the TIMEZONE constant in the code step to your channel’s IANA timezone (for example, America/Halifax or Europe/London).