
Core Plugins and tasks EventTrigger
CertifiedTrigger a Flow based on an event occurring on matching assets.
Core Plugins and tasks EventTrigger
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.
type: io.kestra.plugin.ee.assets.EventTriggerExamples
Automatically trigger downstream transformations when staging tables are created or updated.
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.
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.
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.
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.
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
allowConcurrent Non-dynamicboolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
assetId string
The assetId to target.
assetType string
The asset type to target.
events array
CREATEDUPDATEDDELETEDUSEDThe events to listen to.
metadataQuery array
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. ::
io.kestra.plugin.ee.assets.EventTrigger-FieldQuery
EQUAL_TONOT_EQUAL_TOnamespace string
The namespace to target.
stopAfter Non-dynamicarray
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
asset *Required
Asset that triggered the execution, along with the event that occurred on it.
io.kestra.ee.assets.AssetWithEvent
CREATEDUPDATEDDELETEDUSEDdate-time^[a-zA-Z0-9][a-zA-Z0-9._:-]*1150^[a-z0-9][a-z0-9._-]*11501