Is there a way to merge two different flow? For ex...
# ask-metaflow
f
Is there a way to merge two different flow? For example: Let’s say, we have two flow: FlowA and FlowB And I want to connect steps of FlowA to the start step of FlowB is it possible?
1
a
@fancy-mouse-14245 is the intention that flow A should be able to trigger flow B from within? If you have the workflows deployed on Argo Workflows or Step Functions - you can simply use the Argo Workflows / Step Functions SDK to trigger the execution of flow B.
Additionally, we are in the works of an integration with Argo Events that will provide a much more native execution mechanism for chaining the flows.
f
cool cool.
c
we have something like this for our internal tooling using an ad-hoc file-based mechanism i call "flow chaining". Flows write into
.flow/<flow_name>/<runid>
in their start-step, which then lets you do something like
Copy code
python flow_a.py run && python flow_b.py run
flow_b.py
will then interrogate
.flow/
to look for the highest
.flow/FlowA<runid>
file and pull the run-id, then construct
Run('FlowA/<runid>')
using the client API and from there all FlowA data is available. We also standardise on a
outputs_dict
artefact on all flows we want to use this pattern with, so which makes figuring out "what outputs are available" a bit easier.
the file based nature means the chaining is isolated to flows launched in the same directory, and is only suitable for flows whose start-step is local and where the same users tends to launch the same flow "chain"