orchAsync method

Future orchAsync(
  1. Map<String, dynamic> shared, [
  2. Map<String, dynamic>? params,
  3. int? maxSteps
])

Async orchestration method that executes the flow graph.

This method implements Python's _orch_async pattern:

  1. Clone the start node
  2. Set parameters (merged with flow params)
  3. Execute nodes in sequence, handling both sync and async nodes
  4. Return the last action/result

Matches Python's implementation:

async def _orch_async(self,shared,params=None):
    curr,p,last_action =copy.copy(self.start_node),
                        (params or {**self.params}),None
    while curr:
        curr.set_params(p)
        last_action=await curr._run_async(shared)
                    if isinstance(curr,AsyncNode) else curr._run(shared)
        curr=copy.copy(self.get_next_node(curr,last_action))
    return last_action

Async orchestration method that executes the flow graph.

This method implements Python's _orch_async pattern by delegating to the base Flow.orch method, which already handles async nodes properly.

The base Flow.orch method awaits curr.run(shared) which works for both sync and async nodes, so we don't need special handling here.

Implementation

Future<dynamic> orchAsync(
  Map<String, dynamic> shared, [
  Map<String, dynamic>? params,
  int? maxSteps,
]) async {
  return orch(shared, params, maxSteps);
}