SlackIncomingWebhook icon
CommentTrigger icon

YouTube Comment Moderation Queue in Slack

Route new YouTube comments into a Slack review queue with Kestra. A polling trigger surfaces author and text so moderators respond fast.

Categories
Business

Comments are where a channel's community lives, and the ones that need a fast response, questions, complaints, spam, are easy to miss across multiple videos. This blueprint attaches io.kestra.plugin.youtube.CommentTrigger to a list of videos: every 30 minutes it fetches recent comments in time order, and whenever it finds ones it has not seen before, it fires an execution that posts a review message to Slack with the author, the comment text, and the video ID already extracted.

How it works

  1. on_new_comment (io.kestra.plugin.youtube.CommentTrigger) polls the videos in videoIds on a PT30M interval, fetching up to 20 recent comments per video ordered by time. It fires only when unseen comments appear.
  2. The trigger exposes the newest comment as scalars, authorDisplayName, textDisplay, commentId, videoId, and publishedAt, plus newCommentsCount and an allNewComments array with every detected comment.
  3. post_review_message interpolates the scalar outputs into a Slack message for the moderation channel. The allNewComments array stays on the execution's trigger outputs for the full batch.
  4. The errors block posts a distinct Slack alert when the message fails to send.
  5. The trigger ships disabled: true; point videoIds at the videos you moderate and enable it.

What you get

  • A single Slack channel acting as the moderation inbox for any number of videos.
  • Author and comment text in the message itself, so triage happens without opening YouTube.
  • Deduplication handled by the trigger; a comment enters the queue once.
  • A batch count and full comment list per execution, useful when a video suddenly gets busy.

Who it's for

  • Community managers moderating comments across a catalog of videos.
  • Marketing teams watching launch videos for questions and sentiment in the first days.
  • Support teams treating video comments as an inbound channel next to email and chat.

Why orchestrate this with Kestra

Comment moderation tooling usually means a browser tab per video or a custom poller someone has to host and babysit. Kestra's trigger does the polling, remembers what it has already surfaced, keeps a full execution history of every comment that entered the queue, and alerts when the credential or webhook breaks, all from one declarative flow.

Prerequisites

  • A Google Cloud project with the YouTube Data API v3 enabled and an OAuth2 access token with read scope. Pair with the YouTube token refresh blueprint to keep it fresh.
  • The video IDs to moderate.
  • A Slack incoming webhook in the moderation channel.

Secrets

  • YOUTUBE_ACCESS_TOKEN: OAuth2 bearer token for the YouTube Data API.
  • SLACK_WEBHOOK_URL: Slack incoming webhook URL.

Quick start

  1. Add the two secrets to your Kestra namespace.
  2. Replace the sample videoIds with the videos you moderate.
  3. Set disabled: false on the on_new_comment trigger and post a test comment to see it arrive in Slack.

How to extend

  • Switch order to relevance to prioritize comments YouTube ranks as significant instead of newest first.
  • Shorten interval for busier channels, keeping API quota in mind.
  • Route the message to different channels per video by adding a switch on {{ trigger.videoId }}.
  • Chain a sentiment or spam classification step before posting, so the Slack message arrives pre-triaged.

Links

Orchestrate with Kestra
Orchestrate Slack with Kestra
Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.