ult&quot;);
loggingNode.addSuccessor(notificationNode, &quot;default&quot;);

// Run the updated flow
orderProcessingFlow.runAsync(sharedState).then(() =&gt; {
  console.log(&quot;Order processing with logging and notification completed successfully.&quot;);
}).catch(error =&gt; {
  console.error(&quot;Order processing failed:&quot;, error);
});
</code></pre>
<h3 id="flow-diagram-with-nested-flows">Flow Diagram with Nested Flows</h3>
<pre><code class="language-mermaid">flowchart LR
    subgraph orderProcess