Hi everyone, is there a way how to rename flow run...
# ask-community
j
Hi everyone, is there a way how to rename flow runs before running flow itself? I can rename it with RenameFlowRun task, but this changes the name when the task is running, but we would like to have meaningful flow names before running it. Thank you! cc @Radek Tomsej
c
Hi Jakub! Yes you definitely can; we haven’t exposed the ability to edit the name directly in the UI yet (here’s an issue you can comment on to get this back on our radar: https://github.com/PrefectHQ/ui/issues/250), but in the meantime you can use the GraphQL API / Interactive API for this:
Copy code
mutation{
  set_flow_run_name(input: {flow_run_id: "e475058b-5777-4033-a2b5-36960b6335d4", name: "my-new-name"}) {
    success
  }
}
or use the Python client:
Copy code
from prefect import Client

client = Client()
client.set_flow_run_name(flow_run_id, flow_run_name)
j
Perfect, thanks @Chris White !
👍 1
c
@Marvin archive “How to update a Flow Run name?”
j
Hi @Chris White, one more question. in case you mentioned above I need to somehow access flow_run(s) and get flow_run_ids and update it, is it possible to access it somehow from functional API in Python, something like on line 58 below
a
Yeah i was looking forward this too. All these
oversized-capibara
flow runs just confuse folks :)
But still this just renames only current flow run. How to completely change flow run names? I think an ability for a schedule class to also emit required flow run name would be great: This way we get more fine-grained control on flow run names
Schedule already emits Events which already have assorted metadata attached like labels and parameter defaults. Can I add a templated
flow_run_name
field to it?
j
Same here 🙂