https://prefect.io logo
#prefect-community
Title
# prefect-community
h

Heather DeHaven

08/12/2022, 4:42 PM
Hi, I'm quite new to Prefect, very much still learning. I'm using Prefect 1.0. I have a flow that launches another flow using create_flow_run. I'd like to be able to access a Parameter's value and use it to set the run_name of the subsequent flow. I read this doc and saw the use case of using the state_handler to rename the current flow. Is there a way to get the Parameter value in the flow and use it in my create_flow_run for run_name? Can state_handler be used for that? Here's an example of what I'm trying to achieve:
Copy code
with Flow(name="my_parent_flow") as flow:
    name = Parameter('name')
    ...
    create_flow_run.map(
        flow_name=unmapped('child_flow')
        ...
        run_name=unmapped(f'<use Parameter 'name''s value> child run')
    )
1
b

Bianca Hoch

08/12/2022, 5:29 PM
Hi Heather, to my understanding, it isn't possible to pass a parameter to to the
run_name
yet. Here is a a discourse article that shows a workaround solution that may help: https://discourse.prefect.io/t/how-to-dynamically-change-the-run-name-in-the-create-flow-run-task/97
h

Heather DeHaven

08/12/2022, 5:30 PM
thanks! i'll review it
4 Views