Why this matters
For humans, tasks and services eliminate “works on my machine” problems. Everyone gets the same setup, every time. For agents, tasks and services are essential to the run loop. When Ona Agent can runnpm test or docker compose up reliably, it can iterate autonomously - try something, verify it works, and continue without human intervention.

Tasks and Services in environment details
Tasks vs Services
Services are long-running processes that stay active throughout your session:- Databases (PostgreSQL, MySQL)
- Backend and frontend servers
- Caching systems (Redis)
- Installing dependencies
- Running tests
- Seeding databases
- Authenticating with cloud providers
Quick example
- Starts PostgreSQL when the environment starts
- Waits until the database is ready
- Seeds the database with test data
- Makes “Run tests” available as a manual action
Triggers
Control when tasks and services run:| Trigger | When it runs |
|---|---|
postDevcontainerStart | After container starts (first start or rebuild) |
postEnvironmentStart | Every time the environment starts or resumes |
manual | On-demand via the UI |
Related: Automations
Tasks and Services run within individual environments. For cross-repository automation at scale (migrations, security scanning, bulk updates), see Automations.Next steps
- Basic configuration - file locations and YAML structure
- Examples - common patterns for databases, servers, and CI
- Generating tasks - create tasks programmatically