runWorkflow function
Runs the Step as workflow and creates a FlowContextController for it.
onData calls whenever a Response occurs.
Implementation
Future<Response> runWorkflow(
Step step, [
void Function(Response)? onData,
]) async {
final FlowContextController controller = FlowContextController.observed(
onData ?? (_) {},
);
await step.execute(controller);
return await controller.close();
}