Hello guys, I'm trying to migrate from prefect 1 t...
# ask-community
d
Hello guys, I'm trying to migrate from prefect 1 to 2, but I can't find how to put dynamic names on tasks, it would be the equivalent of this, in prefect 1 https://docs-v1.prefect.io/core/concepts/templating.html. Can anybody help me ?
1
m
Hey @dados grupoa I believe you should be able to accomplish this by running the task with options something like this
Copy code
from prefect import task, flow

@task
def taska():
    print("do something")


@flow
def flowa():
    taska.with_options(name="Some_custom_name")()

if __name__ == "__main__":
    flowa()
🙌 1