
Microsoft 365 Trigger
CertifiedTrigger on OneDrive/SharePoint file changes
Microsoft 365 Trigger
Trigger on OneDrive/SharePoint file changes
Polls Microsoft Graph Delta for a folder path and fires on creates and/or updates using persisted delta links. Default interval is PT1M. Requires Microsoft Graph permissions Files.Read.All and Sites.Read.All.
type: io.kestra.plugin.microsoft365.oneshare.TriggerExamples
Monitor OneDrive folder for new files
id: file_created_trigger
namespace: company.team
tasks:
- id: log_new_file
type: io.kestra.plugin.core.log.Log
message: "New file detected: {{ trigger.files[0].name }}"
triggers:
- id: file_created
type: io.kestra.plugin.microsoft365.oneshare.Trigger
tenantId: "{{ secret('TENANT_ID') }}"
clientId: "{{ secret('CLIENT_ID') }}"
clientSecret: "{{ secret('CLIENT_SECRET') }}"
driveId: "b!abc123def456"
path: "/Documents"
interval: PT1M
Monitor OneDrive folder for file updates
id: file_updated_trigger
namespace: company.team
tasks:
- id: log_updated_file
type: io.kestra.plugin.core.log.Log
message: "File updated: {{ trigger.files[0].name }}"
triggers:
- id: file_updated
type: io.kestra.plugin.microsoft365.oneshare.Trigger
tenantId: "{{ secret('TENANT_ID') }}"
clientId: "{{ secret('CLIENT_ID') }}"
clientSecret: "{{ secret('CLIENT_SECRET') }}"
driveId: "b!abc123def456"
path: "/Documents"
interval: PT1M
on: UPDATE
Monitor OneDrive folder for any file changes
id: file_changes_trigger
namespace: company.team
tasks:
- id: log_file_changes
type: io.kestra.plugin.core.log.Log
message: "File changed: {{ trigger.files[0].name }}"
triggers:
- id: file_changes
type: io.kestra.plugin.microsoft365.oneshare.Trigger
tenantId: "{{ secret('TENANT_ID') }}"
clientId: "{{ secret('CLIENT_ID') }}"
clientSecret: "{{ secret('CLIENT_SECRET') }}"
driveId: "b!abc123def456"
path: "/Documents"
interval: PT1M
on: CREATE_OR_UPDATE
Properties
path *Requiredstring
Folder path to monitor
Absolute path starting with '/' (e.g., /Documents)
allowConcurrent Non-dynamicboolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
clientId string
Client ID
Client ID of the Azure service principal. If you don't have a service principal, refer to create a service principal with Azure CLI.
clientSecret string
Client Secret
Service principal client secret. Use this for Client Secret authentication. Provide clientId, tenantId, and clientSecret. Either clientSecret OR pemCertificate must be provided, not both.
driveId string
Drive ID to monitor
Drive identifier; takes precedence when both driveId and siteId are provided
interval Non-dynamicstring
PT1MdurationPolling interval
ISO-8601 duration between delta checks; default PT1M
on string
CREATECREATEUPDATECREATE_OR_UPDATETrigger event type
When to fire: CREATE (default), UPDATE, or CREATE_OR_UPDATE
pemCertificate string
PEM Certificate
Alternative authentication method using certificate-based authentication.
Use this for Client Certificate authentication. Provide clientId, tenantId, and pemCertificate.
Either clientSecret OR pemCertificate must be provided, not both.
siteId string
Site ID to monitor
SharePoint site identifier used when driveId is not set
stateKey string
State key
Key for persisted trigger state; defaults to <namespace>__<flowId>__<triggerId>
stateTtl string
State TTL
TTL for persisted state entries (e.g., PT24H, P7D); default 7 days
stopAfter Non-dynamicarray
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
tenantId string
Tenant ID
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
count integer
0Number of files that triggered the execution
files array
List of files that triggered the execution