Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic execution labels from triggers #3876

Open
loicmathieu opened this issue May 30, 2024 · 2 comments
Open

Dynamic execution labels from triggers #3876

loicmathieu opened this issue May 30, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@loicmathieu
Copy link
Member

Feature description

Currently, you can pass execution labels when starting an execution from the UI/API or a Webhook.
But you cannot do that from a Trigger as triggers automatically start executions so the list of labels is static and not dynamic.

But there is interesting use case for that, for example to add some identifier in a label extracted from the trigger message.

What we can do is to allow to define dynamic labels in a trigger that will allow using Pebble expression so the trigger output will be available to create the labels.

For example:

id: trigger
type: io.kestra.plugin.jdbc.postgres.ReatimeTrigger
[...]
labels:
  key1: static value
  key2: "{{json(trigger.data).productId}}"
@loicmathieu loicmathieu added the enhancement New feature or request label May 30, 2024
@anna-geller anna-geller added this to the v0.18.0 milestone Jun 1, 2024
@github-project-automation github-project-automation bot moved this to To triage in Issues Jun 10, 2024
@anna-geller
Copy link
Member

Thinking more, couldn't you do this instead?

id: myflow
namespace: dev
labels:
  key1: static value
  key2: "{{json(trigger.data).productId}}"
tasks:
...
triggers:
...

There is also a Labels task, so it's already possible

@anna-geller anna-geller removed this from the v0.18.0 milestone Jun 17, 2024
@loicmathieu
Copy link
Member Author

@anna-geller we cannot do as you propose as flow labels are static labels not dynamic, we copy flow labels into the execution at run time but flow labels are also used to filter flows for ex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

2 participants