Skip to main content
Define Automations as YAML files and manage them with the Ona CLI.

Why define Automations as code

  • Version control. Track changes in Git. Review diffs, revert mistakes, use branches.
  • Reproducibility. The YAML file is the source of truth. No UI clicks to reconstruct a lost Automation.
  • Distribution. Commit Automation files to any repository. Team members run ona ai automation create to instantiate them.

Prerequisites

  • Ona CLI installed and authenticated (ona login)

Discover the YAML syntax

Generate a reference file covering the full syntax:

Create an Automation from a file

On success, the CLI prints the new Automation ID:
Stdin is also supported:

Update an existing Automation

Find the Automation ID:
Apply the updated file:
Provided fields replace existing values. Fields not in the YAML remain unchanged. Complex fields like triggers and action are replaced entirely, not merged.

Real-world example

ona-samples/github-security contains two Automation files that pick the highest-severity open security alert, fix it, run tests, and open a PR:

Next steps