https://prefect.io logo
e

Evan Curtin

07/26/2023, 1:09 PM
Sorry if this hasn’t been asked - is there a “view my runs” where I can just view all flow runs that i triggered?
1
n

Nate

07/26/2023, 2:31 PM
hi @Evan Curtin - do you mean flow runs that your user in particular kicked off? i dont think so, you could add a tag to your deployments and then later filter by that tag on the flow runs page
e

Evan Curtin

07/26/2023, 2:32 PM
yeah that is what I mean. Tagging could work but it feels weird that this isn’t supported by default
like a filter on the flow runs page
n

Nate

07/26/2023, 2:37 PM
tags are meant for stuff like this, since there's lots of ways folks end up wanting to filter things, plus often in prod most deployment flow runs are carried out by a service acct not associated with a human user you could open a feature request though if you'd like to see an explicit filter on actor
e

Evan Curtin

07/26/2023, 2:42 PM
is there a workaround to just get the whole history as a csv or something
n

Nate

07/26/2023, 3:00 PM
yeah you can use the client
Copy code
In [12]: from prefect import get_client

In [13]: async with get_client() as client:
    ...:     user_flow_runs = [r for r in await client.read_flow_runs() if r.created_by.type == "USER"]
    ...:

In [14]: len(user_flow_runs)
Out[14]: 86

In [15]: user_flow_runs[0].json()
Out[15]: '{stringified JSON you can write to disk / whatever}'
here its just checking that a
USER
created the flow run, not a
DEPLOYMENT
, but you could further filter on the actual user that created it
🙌 1