- Validate input before processing
- Depending on the input, spawn agents and run them in parallel
- Cache results as needed
- Correct any intermediate errors
- Stream the output
- Return a single or multiple outputs
Streaming
It is important to understand that when you build a workflow, you are writing a python function, meaning you decide if the function streams the output or not. To stream the output, yield anIterator[RunResponse] from the run() method of your workflow.
news_report_generator.py
Batch
Simply return aRunResponse object from the run() method of your workflow to return a single output.
news_report_generator.py