Core Plugins and tasks EventTrigger

Core Plugins and tasks EventTrigger

Certified

Trigger a Flow based on an event occurring on matching assets.

Fires when an asset meet assetId, namespace, assetType and metadataQuery and an event among the events (required) is fired on it.

yaml
type: io.kestra.plugin.ee.assets.EventTrigger

Automatically trigger downstream transformations when staging tables are created or updated.

yaml
id: cascade_pipeline
namespace: company.data

triggers:
 - id: staging_table_event
   type: io.kestra.plugin.ee.assets.EventTrigger
   namespace: company.data
   assetType: io.kestra.plugin.ee.assets.Table
   events:
     - CREATED
     - UPDATED
   metadataQuery:
     - field: model_layer
       type: EQUAL_TO
       value: staging

tasks:
 - id: transform_to_mart
   type: io.kestra.plugin.core.flow.Subflow
   namespace: company.data
   flowId: create_mart_tables
   inputs:
     source_table: "{{ trigger.assets[0].id }}"

Log all asset deletions for compliance and audit trails.

yaml
id: audit_deletions
namespace: company.security

triggers:
 - id: asset_deletion_monitor
   type: io.kestra.plugin.ee.assets.EventTrigger
   events:
     - DELETED

tasks:
 - id: log_deletion
   type: io.kestra.plugin.jdbc.postgresql.Query
   sql: |
     INSERT INTO audit_log (asset_id, asset_type, namespace, deleted_at, deleted_by)
     VALUES (
       '{{ trigger.assets[0].id }}',
       '{{ trigger.assets[0].type }}',
       '{{ trigger.assets[0].namespace }}',
       '{{ trigger.assets[0].eventTime }}',
       '{{ trigger.assets[0].tenantId }}'
     )

Automatically configure monitoring when new VMs are created.

yaml
id: auto_configure_monitoring
namespace: company.infra

triggers:
  - id: new_vm_created
    type: io.kestra.plugin.ee.assets.EventTrigger
    assetType: io.kestra.plugin.ee.assets.VM
    events:
      - CREATED

tasks:
  - id: setup_monitoring
    type: io.kestra.plugin.scripts.shell.Commands
    commands:
      - |
        configure-monitoring \
          --vm-id {{ trigger.assets[0].id }} \
          --region {{ trigger.assets[0].metadata.region }} \
          --provider {{ trigger.assets[0].metadata.provider }}

Notify specific teams when their assets are modified.

yaml
id: team_notifications
 namespace: company.notifications

 triggers:
   - id: data_team_assets
     type: io.kestra.plugin.ee.assets.EventTrigger
     events:
       - UPDATED
     metadataQuery:
       - field: owner
         type: EQUAL_TO
         value: data-team

 tasks:
   - id: notify_slack
     type: io.kestra.plugin.notifications.slack.SlackIncoming
     url: "{{ secret('DATA_TEAM_WEBHOOK') }}"
     payload: |
       {
         "text": "📊 Asset `{{ trigger.assets[0].id }}` was updated"
       }

Monitor production and staging assets for critical priority items, excluding archived assets and those with "test" in the description.

yaml
id: critical_asset_monitor
namespace: company.monitoring

triggers:
  - id: critical_assets
    type: io.kestra.plugin.ee.assets.EventTrigger
    events:
      - CREATED
      - UPDATED
    metadataQuery:
      - field: environment
        type: IS_ONE_OF
        value: [prod, staging]
      - field: priority
        type: EQUAL_TO
        value: critical
      - field: status
        type: NOT_EQUAL_TO
        value: archived
      - field: description
        type: CONTAINS
        value: production

tasks:
  - id: validate_asset
    type: io.kestra.plugin.core.log.Log
    message: "Critical asset {{ trigger.assets[0].id }} in {{ trigger.assets[0].metadata.environment }} requires validation"
Properties
Defaultfalse

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

The assetId to target.

The asset type to target.

SubTypestring
Possible Values
CREATEDUPDATEDDELETEDUSED

The events to listen to.

Pass upstream flow's outputs to inputs of the current flow.

The inputs property passes data objects or a file to the downstream flow as long as those outputs are defined on the flow-level in the upstream flow. ::alert{type="warning"} Make sure that the inputs and task outputs defined in this Flow trigger match the outputs of the upstream flow. Otherwise, the downstream flow execution will not to be created. If that happens, go to the Logs tab on the Flow page to investigate the error. ::

Definitions
fieldstring
typestring
Possible Values
EQUAL_TONOT_EQUAL_TO
valuestring

The namespace to target.

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.

Asset that triggered the execution, along with the event that occurred on it.

Definitions
descriptionstring
displayNamestring
eventstring
Possible Values
CREATEDUPDATEDDELETEDUSED
eventTimestring
Formatdate-time
idstring
Validation RegExp^[a-zA-Z0-9][a-zA-Z0-9._:-]*
Min length1
Max length150
metadataobject
namespacestring
Validation RegExp^[a-z0-9][a-z0-9._-]*
Min length1
Max length150
typestring
Min length1