when running a flow that itself triggers other flo...
# ask-community
h
when running a flow that itself triggers other flows, is there a way to set it up in such a way that when you look at the visual timeline of the flow execution on the dashboard, you see the sub-flows own tasks displayed as their own 'bubble', rather than having one big bubble for the entire flow? I know i can get the url of the sub flows execution in the logs, but wanted a single way to display each task called within my chain of flows
k
Hey @Harry Baker, at the moment no, but there are plans later in the year that will address this.
h
hmm ok. is there at least a way i can write my logs such that the parent flow displays the logs of the child flows within the same Logs panel?
k
I think no also on that unfortunately, but let me double check.
z
You can use `wait_for_flow_run(stream_logs=True)`to stream logs for child flows into the parent flow
👍 1
h
where would that code go?
k
It is a separate task so there are two tasks with
create_flow_run
and
wait_for_flow_run
.
create_flow_run
returns the UUID, that you can pass into
wait_for_flow_run
as the next task.
h
Copy code
with Flow('reporting_driver') as flow:
    rd_id = create_flow_run(flow_name='refresh_data', project_name="tester")
    rd_wait = wait_for_flow_run(rd_id, stream_logs=True)

    qe_id = create_flow_run(flow_name='query_export', project_name="tester")
    qe_wait = wait_for_flow_run(qe_id, stream_logs=True)

    qe_id.set_upstream(rd_wait)
would this achieve what i'm looking for? I want refresh_data to run, passing its logs to the parent flow, and once its finished then query_export will do likewise
hmmm i'm getting ImportError: cannot import name 'create_flow_run' from 'prefect.tasks.prefect.flow_run'
i'm a little confused about how i'm supposed to import create_flow_run, i've seen different things in different docs. some use client others use flow?
What is the correct way to import create_flow_run? I am seeing multiple different references to create_flow_run in the documentation, and I'm getting an error when trying to import it from prefect.tasks.prefect.flow_run
nvm i think i'm just a moron who didn't update to the latest version of prefect
k
Just saw this, you good now? Yep that came out in 0.15.0 or 0.15.1
y
@Harry Baker that’s a good flag, we should update the documents to avoid further confusion