Quick Start
Requirements
- Python 3.10 or higher
- OpenAI API key. Generate OpenAI API key here. Use Other models using this guide.
- Basic understanding of Python
How It Works
| Phase | What happens |
|---|---|
| 1. Monitor | The monitor agent reads the current environment state |
| 2. Act | route() dispatches the matching action agent |
| 3. Adapt | Feedback feeds back into the loop via context= |
| 4. Stop | The loop ends when the until condition is met |
Choosing an Autonomy Level
Decide how much the workflow runs without a human in the loop.Understanding Autonomous Workflow
What is Autonomous Workflow?
Autonomous Workflow enables:
- Continuous environment monitoring
- Automated decision-making and action execution
- Real-time feedback processing
- Self-adapting behavior based on outcomes
Features
Environment Monitoring
Continuously monitor and analyze environment state.
Adaptive Actions
Execute context-aware actions based on state analysis.
Feedback Processing
Process and learn from action outcomes.
Self-Optimization
Improve performance through continuous learning.
Configuration Options
Troubleshooting
Monitoring Issues
If monitoring fails:
- Check environment access
- Verify state detection
- Enable verbose mode for debugging
Adaptation Flow
If adaptation is incorrect:
- Review feedback processing
- Check action outcomes
- Verify learning loop
Best Practices
Keep monitor instructions deterministic
Keep monitor instructions deterministic
The monitor agent should return only discrete states (
normal, critical, optimal). Vague prose breaks route() matching and causes wrong action agents to run.Cap repeat iterations
Cap repeat iterations
Always set
max_iterations on repeat() loops. Without a ceiling, a misconfigured until condition can spin indefinitely and burn tokens.Cap the spend on unattended workflows
Cap the spend on unattended workflows
For
run_autonomous flows, set max_budget_usd and max_tokens so an unattended run can’t burn unlimited money or tokens. See Autonomy Budget.Wire feedback into the loop
Wire feedback into the loop
Pass prior task outputs via
context=[...] on the feedback step so the agent learns from outcomes rather than re-analysing from scratch each cycle.Start with verbose logging
Start with verbose logging
Enable verbose output while tuning routes and exit conditions. Once the workflow stabilises, reduce logging for production runs.
Next Steps
AutoAgents
Learn about automatically created and managed AI agents
Mini Agents
Explore lightweight, focused AI agents
For optimal results, ensure your environment monitoring is reliable and your feedback processing logic is properly configured for effective adaptation.
Related
Run agents in iterative self-referential loops with completion signals.
Auto-create and manage agents and tasks from high-level instructions.

