Mohamed Hatem Diabi
07/15/2022, 12:13 AM@task(log_stdout=True)
def create_subflows(list_of_elements):
list_param= []
for element in list_of_elements:
list_param.append(
{
"pr": element,
}
)
mapped_flows = create_flow_run.map(
flow_name=unmapped("Subflow"),
parameters=list_param,
)
with Flow("Parent Flow") as flow:
list_of_elements = [1,2,3]
create_subflows(list_of_elements)
I am getting this error:
`ValueError: Could not infer an active Flow context while creating edge to <Task: create_flow_run>. This often means you called a task outside a with Flow(...) block. If you're trying to run this task outside of a Flow context, you need to call create_flow_run.run(...)
Anna Geller
@Task
you would need a decorator @task
and for subflows in 1.0, check out those examples: https://discourse.prefect.io/tag/flow-of-flowsMohamed Hatem Diabi
07/15/2022, 3:45 AMAnna Geller