Google Workspace FileCreatedTrigger

Google Workspace FileCreatedTrigger

Certified

Poll Drive for newly created files

Polls a folder (or entire Drive) for files created since the prior interval and triggers an execution with the new files. Uses service-account access; interval default PT1H, min PT1M. Max files per poll defaults to 100. Files are stored to internal storage when download succeeds; failures are logged and skipped.

yaml
type: io.kestra.plugin.googleworkspace.drive.FileCreatedTrigger

Monitor a folder for any new file

yaml
id: google_drive_file_trigger
namespace: company.team

tasks:
  - id: process_file
    type: io.kestra.plugin.core.log.Log
    message: "New file created: {{ trigger.files[0].name }}"

triggers:
  - id: watch_folder
    type: io.kestra.plugin.googleworkspace.drive.FileCreatedTrigger
    serviceAccount: "{{ secret('GCP_SERVICE_ACCOUNT') }}"
    folderId: "1a2b3c4d5e6f7g8h9i0j"
    interval: PT5M

Monitor for specific MIME types with filters

yaml
id: google_drive_pdf_trigger
namespace: company.team

tasks:
  - id: download_pdf
    type: io.kestra.plugin.googleworkspace.drive.Download
    serviceAccount: "{{ secret('GCP_SERVICE_ACCOUNT') }}"
    fileId: "{{ trigger.files[0].id }}"

triggers:
  - id: watch_pdfs
    type: io.kestra.plugin.googleworkspace.drive.FileCreatedTrigger
    serviceAccount: "{{ secret('GCP_SERVICE_ACCOUNT') }}"
    folderId: "1a2b3c4d5e6f7g8h9i0j"
    mimeTypes:
      - application/pdf
      - application/vnd.google-apps.document
    interval: PT10M

Monitor entire Drive with owner filter

yaml
id: google_drive_owner_trigger
namespace: company.team

tasks:
  - id: notify
    type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
    url: "{{ secret('SLACK_WEBHOOK') }}"
    payload: |
      {
        "text": "New file by {{ trigger.files[0].owners[0].displayName }}: {{ trigger.files[0].name }}"
      }

triggers:
  - id: watch_my_files
    type: io.kestra.plugin.googleworkspace.drive.FileCreatedTrigger
    serviceAccount: "{{ secret('GCP_SERVICE_ACCOUNT') }}"
    ownerEmail: "user@company.com"
    interval: PT15M
Properties
Defaultfalse

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

Folder ID to monitor

Google Drive folder ID; monitors entire Drive if omitted

Defaultfalse

Include subfolders

When true, query is recursive through subfolders; default false

DefaultPT1H
Formatduration

Polling interval

How often to poll for new files; minimum PT1M, default PT1H

Default100

Files processed per poll

Upper bound on files returned each poll; default 100

SubTypestring

MIME type filters

Restrict to listed MIME types (e.g., application/pdf). Empty means all types.

Owner email filter

Only files owned by this email trigger executions; must be a valid email

SubTypestring
Default["https://www.googleapis.com/auth/drive.metadata.readonly"]

OAuth scopes

Drive scopes to request; default metadata read-only

Service account key

Google service account JSON with Drive scope; if omitted, Application Default Credentials are used

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.

New files detected

Files created since the last interval that matched filters

Definitions
createdTimestring
Formatdate-time

Created time

iconLinkstring

Icon link

idstring

File ID

kestraFileUristring

Kestra storage URI

Location in internal storage when download succeeded; null if download failed

mimeTypestring

MIME type

modifiedTimestring
Formatdate-time

Last modified time

namestring

File name

ownersarray
SubTypeobject

Owners

parentsarray
SubTypestring

Parent folder IDs

sizeinteger

File size (bytes)

thumbnailLinkstring

Thumbnail link

webViewLinkstring

Web link