Running into this issue using child flows: `get_ta...
# ask-community
a
Running into this issue using child flows:
get_task_run_result
is giving a
FlowRunView
object as a result instead of the task result that I'm expecting.
k
Hey @Arun Giridharan, could you show us how you called it?
a
with Flow(f"parent-flow", state_handlers=[flow_state_handler], result=LocalResult(location="latest-flow")) as flow:
child_run_id = create_flow_run(flow_name="child-flow", parameters=dict(...))
wait_for_flow_run(child_run_id)
task_result_1 = get_task_run_result(child_run_id, "task_name_1-1")
task_result_2 = get_task_run_result(child_run_id, "task_name_2-1")
@Kevin Kho figured it out, I had the parent and chid flow pointing to the same Result location
k
ohh ok thanks for letting me know!
a
I'm running into this issue now with 1 task returning the result for another task, however
k
with the updated result locations? that sounds like it’s caused by the same result?
a
The result is defined at the child flow level. I have two tasks in the child flow. When I look for the first task result using get_rask_run_result , I get the result for the second task
k
Is that with the
task_result_1
and
task_result_2
above or with different code? Could you show me how those results are defined maybe?
a
that's the parent flow code. This is what the child flow code looks like.
with Flow(
"child-flow",  state_handlers=[flow_state_handler], result=LocalResult(location="child-flow")
) as flow:
k
I think this is saying that you are applying a LocalResult with the file name “child-flow” to all of your tasks. This means that after every task runs, they are overwriting the file. You can try giving the result on the task level with different filenames.