
Local RealtimeTrigger
CertifiedTrigger on local filesystem events (realtime)
Local RealtimeTrigger
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.
type: io.kestra.plugin.fs.local.RealtimeTriggerExamples
React immediately when a file is created or updated
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
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
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
from *string
Directory to watch
allowConcurrent boolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
on string
CREATE_OR_UPDATECREATEUPDATECREATE_OR_UPDATEDELETEEvent 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.
recursive booleanstring
falseInclude files in subdirectories
Whether to watch subdirectories. Defaults to false. When enabled, newly created subdirectories are also watched.
regExp string
Regex pattern to match against the full file path
stopAfter array
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
changeType string
CREATEUPDATEDELETEThe type of change that occurred (CREATE, UPDATE, DELETE)
file
The file that triggered the event
io.kestra.plugin.fs.local.models.File
date-timedate-timejava.nio.file.Path
date-timeuri