YAML Syntax
Every TinyOps rule is defined as a single YAML file. This page covers the complete schema, required and optional fields, naming conventions, and a fully annotated example.
Rule Structure
A rule file has four top-level sections:
name: rule-name
trigger: { ... }
condition: { ... } # optional
action: { ... }| Field | Required | Description |
|---|---|---|
name | Yes | Unique identifier for the rule. Lowercase, hyphenated. |
trigger | Yes | The event that starts execution. See Triggers. |
condition | No | A check that must pass before the action runs. See Conditions. |
action | Yes | The operation to perform. See Actions. |
Conditions are optional. If you omit the condition block, the action fires every time the trigger activates.
Naming Conventions
- Rule names must be lowercase with hyphens separating words (e.g.,
stale-pr-alert,deploy-rollback). - Names should be descriptive and indicate what the rule does.
- Names must be unique within an organization.
Field Reference
trigger
Defines when the rule executes. Exactly one trigger type must be specified.
trigger:
type: schedule | webhook | poll
# Additional fields depend on the typeSee Triggers for full details on each type.
condition
Defines a check against a provider’s data. The action only runs if the condition passes.
condition:
provider: github | vercel | supabase
check: string # provider-specific check name
operator: string # comparison operator
value: string | number | boolean # optional comparison value
repo: string # optional, for GitHub providerSee Conditions for all operators and provider checks.
action
Defines what happens when the rule fires.
action:
provider: github | vercel | slack | email
method: string # provider-specific method name
params: # method-specific parameters (object)
key: valueAction params support template variables for dynamic values.
Complete Annotated Example
# Rule name: unique identifier, lowercase with hyphens
name: stale-pr-alert
# Trigger: runs weekdays at 9:00 AM UTC
trigger:
type: schedule
cron: "0 9 * * 1-5"
# Condition: check if any PR is older than 3 days
condition:
provider: github
check: pr.age
operator: gt
value: 3
repo: acme/webapp
# Action: send a Slack notification
action:
provider: slack
method: send_message
params:
channel: "#engineering"
text: "There are stale PRs older than 3 days in acme/webapp. Current age: {{condition.result}} days."Minimal Example (No Condition)
When you want an action to fire on every trigger without any check:
name: release-notification
trigger:
type: webhook
event: release
source: generic
action:
provider: slack
method: send_message
params:
channel: "#releases"
text: "New release published at {{now}}. Payload: {{trigger.data}}"Value Types
| Type | Examples | Used in |
|---|---|---|
string | "0 9 * * 1-5", "github.pull_request.opened" | trigger fields, condition value, action params |
number | 3, 50, 500 | condition value |
boolean | true, false | condition value |
object | { channel: "#eng", text: "..." } | action params |
Cron expressions and strings containing special characters should always be wrapped in quotes to avoid YAML parsing issues.
Next Steps
- Triggers for schedule, webhook, and poll configuration
- Conditions for operators and provider checks
- Actions for available methods per provider
- Template Variables for dynamic values in action params