
DBFS Trigger
CertifiedTrigger on new DBFS files (Legacy)
DBFS Trigger
Trigger on new DBFS files (Legacy)
Periodically lists a DBFS path and starts one execution for files detected since the previous poll.
Directories are ignored as trigger events. The trigger persists file state in Kestra's namespace KV store
to avoid duplicate events. The first poll reports existing matching files as CREATE events; the default
on mode is CREATE_OR_UPDATE. Recursive traversal uses explicit visited-directory tracking, while listings
are materialized during each poll; keep recursively watched trees to a few thousand files to avoid excessive memory usage.
Note: Databricks considers DBFS legacy; for new flows, store files in Unity Catalog Volumes instead.
type: io.kestra.plugin.databricks.dbfs.TriggerExamples
Trigger a flow when a new file is added to a DBFS directory.
id: databricks_dbfs_trigger_flow
namespace: company.team
tasks:
- id: each_file
type: io.kestra.plugin.core.flow.ForEach
values: "{{ trigger.files | jq('.[].path') }}"
tasks:
- id: download
type: io.kestra.plugin.databricks.dbfs.Download
host: "{{ secret('DATABRICKS_HOST') }}"
authentication:
token: "{{ secret('DATABRICKS_TOKEN') }}"
from: "{{ taskrun.value }}"
triggers:
- id: watch_dbfs
type: io.kestra.plugin.databricks.dbfs.Trigger
host: "{{ secret('DATABRICKS_HOST') }}"
authentication:
token: "{{ secret('DATABRICKS_TOKEN') }}"
from: /mnt/incoming
interval: PT1M
recursive: true
on: CREATE
Properties
from *string
DBFS path to watch
Absolute DBFS directory path to watch, such as /mnt/incoming.
The rendered value must be an absolute DBFS path.
accountId string
Databricks account identifier
action string
NONEMOVEDELETENONEPost-detection action
NONE leaves detected files in place. MOVE relocates each detected file below moveDirectory,
preserving its relative path under from. DELETE removes detected files after state is persisted.
Failed actions are logged and do not cancel the trigger execution.
allowConcurrent boolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
authentication
Databricks authentication configuration
Configure the Databricks authentication. Any property not explicitly configured can be supplied through the standard Databricks environment variables or configuration file.
io.kestra.plugin.databricks.AbstractTask-AuthenticationConfig
Authentication type
Azure client ID
Azure client secret
Azure tenant ID
Client ID
Client secret
Google credentials JSON
Google service account email
Password
Databricks personal access token
Username
configFile string
Databricks configuration file
host string
Databricks host
interval string
PT1MdurationInterval between checks
maxFiles integerstring
25Maximum files per execution
Maximum number of detected files emitted by a single poll. Must be between 1 and 1000. The default is 25. Remaining files are evaluated on the next poll.
moveDirectory string
Move destination
Target DBFS directory when action is MOVE.
For recursive polling, the relative path below from is preserved under this directory.
The destination must not be inside the watched from path when recursive polling is enabled.
on string
CREATE_OR_UPDATECREATEUPDATECREATE_OR_UPDATETrigger condition
Which file changes fire the trigger. Defaults to CREATE_OR_UPDATE.
recursive booleanstring
falseInclude files in subdirectories
When enabled, files below nested DBFS directories are monitored recursively.
Because the listing is materialized on each poll, keep recursively watched trees to a few thousand files.
When action: MOVE is used with recursive polling, moveDirectory must be outside from.
regExp string
Regex pattern to match DBFS paths
Optional regular expression matched against the complete DBFS path of each file. Invalid expressions fail validation at runtime with an error naming this property.
stateKey string
State key
Key used to persist the trigger state. Defaults to a stable per-trigger key.
stateTtl string
State TTL
How long the persisted trigger state is retained. Unset means no expiry.
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
files array
DBFS files detected since the previous poll, with their change type
io.kestra.plugin.databricks.dbfs.Trigger-TriggeredFile
CREATEUPDATEDetected change type: CREATE for a newly observed file or UPDATE for changed metadata
File size in bytes
Whether the entry is a directory
Last modification time, in epoch milliseconds
DBFS file path
size integer
Number of detected DBFS files