Local Trigger

Local 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.Trigger
      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: log_file
        type: io.kestra.plugin.core.log.Log
        message: "{{ 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/"
Installation

Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:

kestractl plugins get io.kestra.plugin:plugin-fs --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.

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

When recursive is true, the relative path from the from directory is preserved under moveDirectory.

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