YouTube VideoTrigger

YouTube VideoTrigger

Certified

Trigger flow on new channel uploads

Polls a channel's uploads playlist on a fixed interval (default PT1H with a 5m buffer) and starts a Flow when new videos publish. Uses an OAuth2 access token and checks up to maxResults items (default 5, YouTube limit 50). Videos already emitted are remembered in the KV store, so a video fires once even though consecutive polls overlap.

yaml
type: io.kestra.plugin.youtube.VideoTrigger

Monitor channel for new videos

yaml
id: youtube_new_video_monitor
namespace: company.team

tasks:
  - id: notify_slack
    type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
    url: "{{ secret('SLACK_WEBHOOK_URL') }}"
    messageText: "New video: {{ trigger.title }} - {{ trigger.videoUrl }}"

triggers:
  - id: new_video_trigger
    type: io.kestra.plugin.youtube.VideoTrigger
    accessToken: "{{ secret('YOUTUBE_ACCESS_TOKEN') }}"
    channelId: "UC_x5XG1OV2P6uZZ5FSM9Ttw"
    interval: PT1H
    maxResults: 10
Properties

Access token

OAuth2 bearer token used to call the YouTube Data API

Channel ID

YouTube channel ID whose uploads playlist is polled

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

Defaultkestra-yt-plugin

Application name

Application name sent to YouTube API; defaults to kestra-yt-plugin

DefaultPT1H
Formatduration

Polling interval

How often to check for new videos; defaults to PT1H

Default5

Maximum results

How many recent uploads to fetch per poll (1-50, default 5)

DefaultCREATE
Possible Values
CREATEUPDATECREATE_OR_UPDATE

Trigger event type

  • CREATE: fires for videos the trigger has not emitted before.
  • UPDATE: fires when a video it has already seen changes title while still inside the polling window.
  • CREATE_OR_UPDATE: fires on either.

State key

KV key under which emitted videos are stored. Defaults to a key derived from the namespace, flow ID and trigger ID that is unique per trigger.

State TTL

How long an emitted video is remembered, e.g. P30D. Defaults to 7 days. Values shorter than twice the look-back (interval plus 5 minutes) are raised to that minimum, so a video can't fire again while it is still inside the polling window.

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

Defaulttrue

A condition that determines whether the trigger should run.

A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.

All new videos found

Definitions
channelIdstring
channelTitlestring
descriptionstring
publishedAtstring
Formatdate-time
thumbnailUrlstring
titlestring
videoIdstring
videoUrlstring

Channel ID

Channel title

Latest video description

Count of new videos found

Formatdate-time

Published timestamp (UTC)

Latest video thumbnail URL

Latest video title

Latest video ID

Latest video watch URL