Microsoft 365 Trigger

Microsoft 365 Trigger

Certified

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.

yaml
type: io.kestra.plugin.microsoft365.oneshare.Trigger

Monitor OneDrive folder for new files

yaml
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

yaml
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

yaml
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

Folder path to monitor

Absolute path starting with '/' (e.g., /Documents)

Defaultfalse

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

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.

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.

Drive ID to monitor

Drive identifier; takes precedence when both driveId and siteId are provided

DefaultPT1M
Formatduration

Polling interval

ISO-8601 duration between delta checks; default PT1M

DefaultCREATE
Possible Values
CREATEUPDATECREATE_OR_UPDATE

Trigger event type

When to fire: CREATE (default), UPDATE, or CREATE_OR_UPDATE

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.

Site ID to monitor

SharePoint site identifier used when driveId is not set

State key

Key for persisted trigger state; defaults to <namespace>__<flowId>__<triggerId>

State TTL

TTL for persisted state entries (e.g., PT24H, P7D); default 7 days

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

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

Tenant ID

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.

Default0

Number of files that triggered the execution

List of files that triggered the execution

Definitions
createdDateTimestring
Formatdate-time
idstring
isFolderboolean
lastModifiedDateTimestring
Formatdate-time
mimeTypestring
namestring
sizeinteger
webUrlstring