close method
Closes the workflow and it's FlowContextController.
The FlowContextController shouldn't be used after this function were called.
Implementation
Future<Response> close() async {
await responses.close();
depth = 0;
return responses.stream.lastWhere(
(_) => true,
orElse: () => const Response(),
);
}