Skip to main content
Tasks and Services automate the repetitive work of setting up and operating development environments. Seed databases, start servers, run tests, authenticate with cloud providers - define it once and it runs automatically or on-demand.

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 run npm test or docker compose up reliably, it can iterate autonomously - try something, verify it works, and continue without human intervention.
Environment details panel showing Tasks and Services section with status indicators

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)
Tasks are one-off actions that run and complete:
  • Installing dependencies
  • Running tests
  • Seeding databases
  • Authenticating with cloud providers

Quick example

# .ona/automations.yaml
services:
  database:
    name: PostgreSQL
    commands:
      start: docker compose up -d postgres
      ready: pg_isready -h localhost
    triggeredBy:
      - postDevcontainerStart

tasks:
  seed:
    name: Seed database
    command: npm run db:seed
    dependsOn:
      - database
    triggeredBy:
      - postDevcontainerStart

  test:
    name: Run tests
    command: npm test
    triggeredBy:
      - manual
This configuration:
  1. Starts PostgreSQL when the environment starts
  2. Waits until the database is ready
  3. Seeds the database with test data
  4. Makes “Run tests” available as a manual action

Triggers

Control when tasks and services run:
TriggerWhen it runs
postDevcontainerStartAfter container starts (first start or rebuild)
postEnvironmentStartEvery time the environment starts or resumes
manualOn-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