FileCreatedTrigger
Poll Drive for newly created files
FileCreatedTrigger
Poll Drive for newly created files
yaml
type: "io.kestra.plugin.googleworkspace.drive.FileCreatedTrigger"Examples
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
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
yaml
id: google_drive_owner_trigger
namespace: company.team
tasks:
- id: notify
type: io.kestra.plugin.notifications.slack.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
Default
falseconditions Non-dynamic
Definitions
Condition to allow events between two specific datetime values.
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.DateTimeBetweenio.kestra.core.models.conditions.types.DateTimeBetweenConditionio.kestra.plugin.core.condition.DateTimeBetweenConditionafterstring
beforestring
datestring
Default
{{ trigger.date }}Condition to allow events on a particular day of the week.
dayOfWeek*Requiredstring
Possible Values
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAYtype*Requiredobject
Possible Values
io.kestra.plugin.core.condition.DayWeekio.kestra.core.models.conditions.types.DayWeekConditionio.kestra.plugin.core.condition.DayWeekConditiondatestring
Default
{{ trigger.date }}Condition to execute tasks on a specific day of the week relative to the current month (first, last, ...)
dayInMonth*Requiredstring
Possible Values
FIRSTLASTSECONDTHIRDFOURTHdayOfWeek*Requiredstring
Possible Values
MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAYtype*Requiredobject
Possible Values
io.kestra.plugin.core.condition.DayWeekInMonthio.kestra.plugin.core.condition.DayWeekInMonthConditionio.kestra.core.models.conditions.types.DayWeekInMonthConditiondatestring
Default
{{ trigger.date }}Condition for a specific flow of an execution.
flowId*Requiredstring
namespace*Requiredstring
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.ExecutionFlowio.kestra.plugin.core.condition.ExecutionFlowConditionio.kestra.core.models.conditions.types.ExecutionFlowConditionCondition that checks labels of an execution.
labels*Requiredarrayobject
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.ExecutionLabelsio.kestra.core.models.conditions.types.ExecutionLabelsConditionio.kestra.plugin.core.condition.ExecutionLabelsConditionCondition for an execution namespace.
namespace*Requiredstring
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.ExecutionNamespaceio.kestra.core.models.conditions.types.ExecutionNamespaceConditionio.kestra.plugin.core.condition.ExecutionNamespaceConditioncomparisonstring
Possible Values
EQUALSPREFIXSUFFIXprefixbooleanstring
Default
falseCondition based on the outputs of an upstream execution.
expression*Requiredbooleanstring
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.ExecutionOutputsio.kestra.core.models.conditions.types.ExecutionOutputsConditionio.kestra.plugin.core.condition.ExecutionOutputsConditionCondition based on execution status.
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.ExecutionStatusio.kestra.core.models.conditions.types.ExecutionStatusConditionio.kestra.plugin.core.condition.ExecutionStatusConditioninarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDnotInarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDCondition based on variable expression.
expression*Requiredstring
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.Expressionio.kestra.plugin.core.condition.ExpressionConditionio.kestra.core.models.conditions.types.VariableConditionCondition for a specific flow. Note that this condition is deprecated, use `io.kestra.plugin.core.condition.ExecutionFlow` instead.
flowId*Requiredstring
namespace*Requiredstring
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.FlowConditionio.kestra.core.models.conditions.types.FlowConditionCondition for a flow namespace.
namespace*Requiredstring
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.FlowNamespaceConditionio.kestra.core.models.conditions.types.FlowNamespaceConditionprefixboolean
Default
falseCondition that matches if any taskRun has retry attempts.
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.HasRetryAttemptio.kestra.plugin.core.condition.HasRetryAttemptConditionio.kestra.core.models.conditions.types.HasRetryAttemptConditioninarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDnotInarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDRun a flow if the list of preconditions is met in a time window.
conditions*Requiredobject
id*Requiredstring
Validation RegExp
^[a-zA-Z0-9][a-zA-Z0-9_-]*Min length
1type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.MultipleConditionio.kestra.core.models.conditions.types.MultipleConditionresetOnSuccessboolean
Default
truetimeWindow
Default
{
"type": "DURATION_WINDOW"
}io.kestra.core.models.triggers.TimeWindow
deadlinestring
Format
partial-timeendTimestring
Format
partial-timestartTimestring
Format
partial-timetypestring
Default
DURATION_WINDOWPossible Values
DAILY_TIME_DEADLINEDAILY_TIME_WINDOWDURATION_WINDOWSLIDING_WINDOWwindowstring
Format
durationwindowAdvancestring
Format
durationwindowDeprecatedstring
Format
durationwindowAdvanceDeprecatedstring
Format
durationCondition to exclude other conditions.
conditions*Required
Min items
1type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.Notio.kestra.core.models.conditions.types.NotConditionio.kestra.plugin.core.condition.NotConditionCondition to have at least one condition validated.
conditions*Required
Min items
1type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.Orio.kestra.core.models.conditions.types.OrConditionio.kestra.plugin.core.condition.OrConditionCondition to allow events on public holidays.
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.PublicHolidayio.kestra.plugin.core.condition.PublicHolidayConditionio.kestra.core.models.conditions.types.PublicHolidayConditioncountrystring
datestring
Default
{{ trigger.date}}subDivisionstring
Condition to allow events between two specific times.
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.TimeBetweenio.kestra.plugin.core.condition.TimeBetweenConditionio.kestra.core.models.conditions.types.TimeBetweenConditionafterstring
beforestring
datestring
Default
{{ trigger.date }}Condition to allow events on weekend.
type*Requiredobject
Possible Values
io.kestra.plugin.core.condition.Weekendio.kestra.plugin.core.condition.WeekendConditionio.kestra.core.models.conditions.types.WeekendConditiondatestring
Default
{{ trigger.date }}folderId string
includeSubfolders booleanstring
Default
falseinterval Non-dynamicstring
Default
PT1HFormat
durationmaxFilesPerPoll integerstring
Default
100mimeTypes array
SubTypestring
ownerEmail string
scopes array
SubTypestring
Default
["https://www.googleapis.com/auth/drive.metadata.readonly"]serviceAccount string
stopAfter Non-dynamicarray
SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDOutputs
files array
Definitions
io.kestra.plugin.googleworkspace.drive.FileCreatedTrigger-Output-FileMetadata
createdTimestring
Format
date-timeiconLinkstring
idstring
kestraFileUristring
mimeTypestring
modifiedTimestring
Format
date-timenamestring
ownersarray
SubTypeobject
parentsarray
SubTypestring
sizeinteger
thumbnailLinkstring
webViewLinkstring