https://prefect.io logo
Title
c

Chris Arderne

11/04/2021, 10:07 AM
I have a quick question about naming Flow runs. The docs talk about naming Task runs, and I found some stuff on GitHub about using a
state_handler
to name a flow run based on context, but haven't figured out how to name it based on passed parameters. Eg if I ran a Flow with a
animal=cat
I'd like that Flow run (as viewed in the UI) to be named
run-cat
or something…
a

Anna Geller

11/04/2021, 11:08 AM
So the method Chris mentioned with state handler should work well: https://github.com/PrefectHQ/prefect/discussions/3881#discussioncomment-230352 To access parameter values, you can use
prefect.context.get("parameters")
And you can also use this task : https://docs.prefect.io/api/latest/tasks/prefect.html#renameflowrun
:upvote: 1
👍 1
c

Chris Arderne

11/04/2021, 11:46 AM
Thanks!