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

Selecting "Automate" from a flow-run.<state change> event in the UI creates a misleading automation trigger form #17308

Open
taylor-curran opened this issue Feb 27, 2025 · 3 comments
Labels
bug Something isn't working ui Related to the Prefect web interface

Comments

@taylor-curran
Copy link
Contributor

taylor-curran commented Feb 27, 2025

Bug summary

Select a flow-run.Completed event from the events feed -> click the three dots -> Automate

Image

This produces an automation form with the "Flow run state" trigger type, visually implying the created automation will trigger whenever the flow that produced the completed event enters the Completed state. However, the actual JSON looks like this, indicating a filter on a particular flow run:

{
  "type": "event",
  "match": {
    "prefect.resource.id": "prefect.flow-run.515ea7fa-b6b2-4501-ac85-3bbddbcda043"
  },
  "match_related": {
    "prefect.resource.role": "flow",
    "prefect.resource.id": "prefect.flow.be9d20b8-9db5-4239-a687-906d630ea0fb"
  },
  "after": [],
  "expect": [
    "prefect.flow-run.Completed"
  ],
  "for_each": [
    "prefect.resource.id"
  ],
  "posture": "Reactive",
  "threshold": 1,
  "within": 0
}

Consequently, this automation would only fire if the same flow run emitted another completed event.

Version info

this is in the cloud ui

Additional context

The ability to grab the JSON from the UI is commonly used to help users build their first deployment trigger. The fact that this is wrong affects many beginners.

@taylor-curran taylor-curran added the bug Something isn't working label Feb 27, 2025
@cicdw cicdw added the ui Related to the Prefect web interface label Feb 27, 2025
@cicdw
Copy link
Member

cicdw commented Feb 27, 2025

@taylor-curran this looks correct to me because you specified that the trigger applies specifically to the flow "a-subflow"; if you remove that I think the match_related field will be empty.

@kevingrismore kevingrismore changed the title JSON Trigger doesn't correctly represent the event in automations UI Selecting "Automate" from a flow-run.<state change> event in the UI creates a misleading automation trigger form Mar 3, 2025
@kevingrismore
Copy link
Contributor

@cicdw I've updated the issue title and description to reflect what I believe was the intent of the issue

@cicdw
Copy link
Member

cicdw commented Mar 3, 2025

Ooooo gotcha gotcha, yea it's over-specified I see - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ui Related to the Prefect web interface
Projects
None yet
Development

No branches or pull requests

3 participants