Schedule icon
VideoStats icon
SlackIncomingWebhook icon

Weekly YouTube Video Performance Digest to Slack

Track YouTube video performance with Kestra. Pull views, likes, and comments for a curated video list and post a weekly digest to Slack.

Categories
Business

Stop copying numbers out of YouTube Studio. This blueprint runs io.kestra.plugin.youtube.VideoStats against a curated list of video IDs, pulls view, like, and comment counts for all of them in a single task, and posts an aggregate digest to Slack. With includeSnippet enabled, each video in the output also carries its title, description, and publish date, so the per-video breakdown on the execution's Outputs tab reads like a report, not a list of opaque IDs.

How it works

  1. The video_ids input holds the list of videos to track, editable at execution time without touching the flow.
  2. fetch_stats (io.kestra.plugin.youtube.VideoStats) calls the YouTube Data API with the OAuth2 access token, requesting snippet metadata alongside the statistics. The task outputs aggregate scalars, totalVideos, totalViews, totalLikes, and totalComments, plus a videos array with per-video counts and metadata.
  3. notify interpolates the four aggregate scalars into a Slack message, keeping the payload safe from arrays and nested objects.
  4. The errors block posts a distinct Slack alert when the fetch fails, naming the flow and execution.
  5. A disabled-by-default Schedule trigger sends the digest every Monday at 08:00.

What you get

  • One task call covering the whole video list instead of one API request per video.
  • Aggregate totals as flow outputs, ready for thresholds, downstream tasks, or notifications.
  • Per-video statistics with titles and publish dates on the Outputs tab for drill-down.
  • A failure alert so an expired token or removed video never breaks the digest silently.

Who it's for

  • Content and marketing teams reporting weekly on a fixed set of campaign videos.
  • Developer relations teams tracking tutorial and launch video performance.
  • Anyone replacing a manual YouTube Studio checkin with an automated Slack digest.

Why orchestrate this with Kestra

The YouTube Data API answers the question, but someone still has to ask it every week, aggregate the answers, share them with the team, and notice when the credential expires. Kestra wraps the single VideoStats call with scheduling, execution history, output passing into Slack, and failure alerting, all declared in a few lines of YAML.

Prerequisites

  • A Google Cloud project with the YouTube Data API v3 enabled.
  • An OAuth2 access token with YouTube read scope. Pair this flow with the YouTube token refresh blueprint to keep the token fresh.
  • A Slack incoming webhook for the digest and failure alerts.

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 default video_ids with the videos your team tracks.
  3. Execute the flow and check the Slack digest plus the per-video breakdown on the Outputs tab.
  4. Set disabled: false on the weekly trigger.

How to extend

  • Set includeContentDetails: true to add duration and definition to each video's output.
  • Add an If task comparing totalViews against a target to alert only on notable weeks, as shown in the YouTube milestone watch blueprint.
  • Reshape the videos array into a JSONL file for warehouse loading, as shown in the YouTube stats to warehouse blueprint.
  • Swap Slack for Discord, Teams, or email with the corresponding notification task.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.