
Google Workspace FileCreatedTrigger
CertifiedPoll Drive for newly created files
Google Workspace FileCreatedTrigger
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.
type: io.kestra.plugin.googleworkspace.drive.FileCreatedTriggerExamples
Monitor a folder for any new file
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
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
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
allowConcurrent Non-dynamicboolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
folderId string
Folder ID to monitor
Google Drive folder ID; monitors entire Drive if omitted
includeSubfolders booleanstring
falseInclude subfolders
When true, query is recursive through subfolders; default false
interval Non-dynamicstring
PT1HdurationPolling interval
How often to poll for new files; minimum PT1M, default PT1H
maxFilesPerPoll integerstring
100Files processed per poll
Upper bound on files returned each poll; default 100
mimeTypes array
MIME type filters
Restrict to listed MIME types (e.g., application/pdf). Empty means all types.
ownerEmail string
Owner email filter
Only files owned by this email trigger executions; must be a valid email
scopes array
["https://www.googleapis.com/auth/drive.metadata.readonly"]OAuth scopes
Drive scopes to request; default metadata read-only
serviceAccount string
Service account key
Google service account JSON with Drive scope; if omitted, Application Default Credentials are used
stopAfter Non-dynamicarray
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
when string
trueA 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.
Outputs
files array
New files detected
Files created since the last interval that matched filters
io.kestra.plugin.googleworkspace.drive.FileCreatedTrigger-Output-FileMetadata
date-timeCreated time
Icon link
File ID
Kestra storage URI
Location in internal storage when download succeeded; null if download failed
MIME type
date-timeLast modified time
File name
Owners
Parent folder IDs
File size (bytes)
Thumbnail link
Web link