Hi. When using the new tasks `create_flow_run` and...
# ask-community
p
Hi. When using the new tasks
create_flow_run
 and
get_task_run_result
, how can I assign a different name to different instances so that I can see which task instance is running in the UI without having to look at the logs?
k
When you mean instances, do you mean you want the Flow runs to have different names?
client.create_flow_run()
takes in a run name that you can use to give the Flow run a name.
z
Hey @Pedro Machado -- I think you're looking for something like this
Copy code
In [1]: from prefect.tasks.prefect import create_flow_run

In [2]: create_flow_run.name
Out[2]: 'create_flow_run'

In [4]: my_task = create_flow_run.copy(name="foo")

In [5]: my_task.name
Out[5]: 'foo'
I could also extend the built-in task to dynamically set the task name to the child flow run name, which could make a lot of sense I think?
p
Hi Michael. This is helpful. I think it would be nice to set a more descriptive default name based on the child flow name. Maybe child flow name + flow run name? I'd want to preserve the ability to set a custom name even if I have to use the
copy
approach you suggested.