File system Trigger

File system Trigger

Certified

Trigger on new local files

Polls a directory under configured allowed-paths (default every 60s) and fires when files are created or updated. Limits to maxFiles (default 25) and can MOVE or DELETE matched files; moveDirectory is required when MOVE is chosen.

Example (Kestra config):

plugins: 
  configurations: 
    - type: io.kestra.plugin.fs.local
      values: 
        allowed-paths: 
          - /data/files
yaml
type: io.kestra.plugin.fs.local.Trigger

Wait for one or more files in a given local file system's directory and process each of these files sequentially.

yaml
id: local_trigger_flow
namespace: company.team

tasks:
  - id: for_each_file
    type: io.kestra.plugin.core.flow.ForEach
    values: "{{ trigger.files }}"
    tasks:
      - id: return
        type: io.kestra.plugin.core.debug.Return
        format: "{{ taskrun.value | jq('.path') }}"

triggers:
  - id: watch
    type: io.kestra.plugin.fs.local.Trigger
    from: "/home/dev/kestra"
    interval: PT10S
    action: MOVE
    recursive: true
    moveDirectory: "/home/dev/archive/"
Properties

Directory to watch

DefaultNONE
Possible Values
MOVEDELETENONE

Action to take on matched files

Defaultfalse

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

DefaultPT1M
Formatduration

Interval between checks

Default25

Maximum files to process per poll

Destination directory when action is MOVE

DefaultCREATE_OR_UPDATE
Possible Values
CREATEUPDATECREATE_OR_UPDATE

Trigger event type

Defines when the trigger fires.

  • CREATE: only for newly discovered entities.
  • UPDATE: only when an already-seen entity changes.
  • CREATE_OR_UPDATE: fires on either event.
Defaultfalse

Include files in subdirectories

Regex pattern to match file names

State key

JSON-type KV key for persisted state. Default: <namespace>__<flowId>__<triggerId>

State TTL

TTL for persisted state entries (e.g., PT24H, P7D).

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.

Number of files that triggered the flow

List of files that triggered the flow, each with its change type

Definitions
changeTypestring
Possible Values
CREATEUPDATE
accessedDatestring
Formatdate-time
createdDatestring
Formatdate-time
isDirectoryboolean
localPath
modifiedDatestring
Formatdate-time
namestring
parentstring
sizeinteger
uristring
Formaturi