Local RealtimeTrigger

Local RealtimeTrigger

Certified

Trigger on local filesystem events (realtime)

Watches a local directory for filesystem events (create, modify, delete) using Java NIO WatchService. Emits executions when matching filesystem events are reported, without polling.

**Configuration: ** This trigger requires allowed-paths to be configured for io.kestra.plugin.fs.local.RealtimeTrigger under kestra.plugins.configurations.

Example:

kestra: 
  plugins: 
    configurations: 
      - type: io.kestra.plugin.fs.local.RealtimeTrigger
        values: 
          allowed-paths: 
            - /data/incoming

**Event behavior: ** UPDATE events are coalesced per path after a 500 ms quiet period. CREATE events are emitted immediately and can observe a partial file; with CREATE_OR_UPDATE, a newly written file commonly emits CREATE followed by UPDATE.

**Platform note: ** On macOS, WatchService uses a polling-based fallback and may not detect events as quickly as on Linux or Windows.

yaml
type: io.kestra.plugin.fs.local.RealtimeTrigger

React immediately when a file is created or updated

yaml
id: local_realtime_trigger
namespace: company.team

triggers:
  - id: watch
    type: io.kestra.plugin.fs.local.RealtimeTrigger
    from: /data/incoming
    on: CREATE_OR_UPDATE

tasks:
  - id: log_file
    type: io.kestra.plugin.core.log.Log
    message: "New file: {{ trigger.file.localPath }}"

Watch recursively and filter by file extension

yaml
id: local_realtime_recursive
namespace: company.team

triggers:
  - id: watch_csv
    type: io.kestra.plugin.fs.local.RealtimeTrigger
    from: /data/incoming
    recursive: true
    regExp: ".*\\.csv$"

tasks:
  - id: process
    type: io.kestra.plugin.core.log.Log
    message: "CSV ready: {{ trigger.file.localPath }}"

React to file deletions for cleanup tracking

yaml
id: local_realtime_delete
namespace: company.team

triggers:
  - id: watch_deletes
    type: io.kestra.plugin.fs.local.RealtimeTrigger
    from: /data/incoming
    on: DELETE

tasks:
  - id: log_removed
    type: io.kestra.plugin.core.log.Log
    message: "File removed: {{ trigger.file.localPath }}"
Properties

Directory to watch

Defaultfalse

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

DefaultCREATE_OR_UPDATE
Possible Values
CREATEUPDATECREATE_OR_UPDATEDELETE

Event types to trigger on

Event types to trigger on. Defaults to CREATE_OR_UPDATE. CREATE emits for newly created files; UPDATE emits after a 500 ms quiet period following modifications; CREATE_OR_UPDATE enables both; DELETE emits for deleted files.

Defaultfalse

Include files in subdirectories

Whether to watch subdirectories. Defaults to false. When enabled, newly created subdirectories are also watched.

Regex pattern to match against the full file path

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.

Possible Values
CREATEUPDATEDELETE

The type of change that occurred (CREATE, UPDATE, DELETE)

The file that triggered the event

Definitions
accessedDatestring
Formatdate-time
createdDatestring
Formatdate-time
isDirectoryboolean
localPath
modifiedDatestring
Formatdate-time
namestring
parentstring
sizeinteger
uristring
Formaturi