A();
const nodeB = new NodeB();
nodeA.addSuccessor(nodeB);

// Create sub-flow
const subFlow = new Flow(nodeA);

// Connect sub-flow to another node
const nodeC = new NodeC();
subFlow.addSuccessor(nodeC);

// Create parent flow
const parentFlow = new Flow(subFlow);
</code></pre>
<p>When <code>parentFlow.run(sharedState)</code> executes:
1. It starts the <code>subFlow</code>
2. <code>subFlow</code> runs through its nodes (<code>NodeA</code> then <code>NodeB</code>)
3. After <code>subFlow</code> completes, ex