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

Add support for AND operator with automation values #16660

Open
masonmenges opened this issue Jan 9, 2025 · 1 comment
Open

Add support for AND operator with automation values #16660

masonmenges opened this issue Jan 9, 2025 · 1 comment
Labels
enhancement An improvement of an existing feature

Comments

@masonmenges
Copy link
Contributor

masonmenges commented Jan 9, 2025

Describe the current behavior

Passing Multiple values to a label in an automation by default utilizes an OR operator meaning each value is evaluated independently and if any value in the list is found the automation would trigger.

For Example:

Lets say an automation exists with the following Trigger that sends a notification when the automation fires

{
  "type": "event",
  "match": {
    "prefect.resource.id": "prefect.flow-run.*"
  },
  "match_related": {
    "prefect.resource.id": ["prefect.tag.TagA", "prefect.tag.TagB"],
    "prefect.resource.role": "tag"
  },
  "after": [],
  "expect": [
    "prefect.flow-run.Completed"
  ],
  "for_each": [
    "prefect.resource.id"
  ],
  "posture": "Reactive",
  "threshold": 1,
  "within": 60
}

If a flow run is triggered from a deployment with both TagA and TagB while another flow run is triggered from a different deployment with only TagB The automation will fire twice once for each flow run though in this scenario we may only want the automation to fire if Both TagA AND TagB are present

Describe the proposed behavior

Ideally From the above example users would be able to specify an AND operator when matching on related fields for an Automation allowing more granular controls over what an automation triggers on.

Example Use

No response

Additional context

No response

@masonmenges masonmenges added the enhancement An improvement of an existing feature label Jan 9, 2025
@tsafacjo
Copy link

tsafacjo commented Feb 1, 2025

can I take it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants