Template Variables
Template variables let you inject dynamic, runtime data into action parameters. They use double-curly-brace syntax and are resolved at execution time when the rule fires.
Syntax
Variables are written as {{variable.name}} inside any action param string value.
params:
text: "The result is {{condition.result}} as of {{now}}"Available Variables
| Variable | Type | Description | Example Value |
|---|---|---|---|
{{condition.result}} | string or number | The value returned by the condition check | "72", "3", "1024" |
{{condition.pr.title}} | string | Title of the PR that triggered the condition | "feat: add user auth" |
{{condition.pr.number}} | number | PR number that triggered the condition | "42" |
{{condition.pr.url}} | string | Direct link to the PR on GitHub | "https://github.com/org/repo/pull/42" |
{{org.owner.email}} | string | Email address of the organization owner | "admin@acme.com" |
{{rule.name}} | string | The name of the currently executing rule | "cost-alert" |
{{now}} | string (ISO 8601) | Current UTC timestamp at execution time | "2026-04-28T09:00:00Z" |
{{trigger.data}} | string (JSON) | Raw event data from the trigger (webhook only) | {"action":"opened","number":42} |
The {{condition.pr.*}} variables are only available when your condition check is pr.age, pr.age_hours, or pr.lines_changed. They provide metadata about the specific PR that matched the condition.
Variable Details
{{condition.result}}
Contains the value that was evaluated by the condition check. This is the actual data point retrieved from the provider.
- For
pr.agewith operatorgtand value3: if the oldest PR is 5 days old,{{condition.result}}is"5". - For
billing.mtdwith operatorgtand value50: if the spend is $72,{{condition.result}}is"72".
If the rule has no condition block, {{condition.result}} will be empty. Only use this variable in rules that have a condition defined.
{{condition.pr.title}}, {{condition.pr.number}}, {{condition.pr.url}}
When the condition check is a PR-specific check (pr.age, pr.age_hours, or pr.lines_changed), these variables provide metadata about the PR that was evaluated:
{{condition.pr.title}}— The PR title, e.g. “feat: add user authentication”{{condition.pr.number}}— The PR number, e.g. “42”{{condition.pr.url}}— A clickable link to the PR on GitHub
These are especially useful in Slack messages where you want the recipient to quickly identify and navigate to the problematic PR.
{{org.owner.email}}
The email address of the organization owner who set up the TinyOps workspace. Useful for routing notifications to the right person without hardcoding email addresses.
{{rule.name}}
The name field from the rule definition. Useful for identifying which rule generated a notification, especially when multiple rules share the same action channel.
{{now}}
The current UTC timestamp in ISO 8601 format when the action executes. Useful for audit trails and time-stamping notifications.
{{trigger.data}}
The raw event payload that caused the trigger to fire. For webhook triggers, this contains the full incoming event data. For schedule and poll triggers, this may be minimal or empty.
{{trigger.data}} can be large for webhook events. Use it primarily for debugging or when you need to surface specific event details in notifications.
Usage in Action Params
Template variables work in any string value within the params object. They can be combined with static text and used across all action providers.
Slack Message Example
name: stale-pr-alert
trigger:
type: schedule
cron: "0 9 * * 1-5"
condition:
provider: github
check: pr.age
operator: gt
value: 3
repo: acme/webapp
action:
provider: slack
method: send_message
params:
channel: "#engineering"
text: |
*Stale PR Alert*
PR #{{condition.pr.number}} "{{condition.pr.title}}" has been open for {{condition.result}} days.
{{condition.pr.url}}
Rule: {{rule.name}} | {{now}}Email Example
name: weekly-repo-summary
trigger:
type: schedule
cron: "0 9 * * 1"
condition:
provider: github
check: repo.open_prs
operator: gt
value: 0
repo: acme/webapp
action:
provider: email
method: send
params:
to: "{{org.owner.email}}"
subject: "Weekly summary: {{rule.name}}"
body: |
Hello,
Your weekly repository summary is ready.
Open PRs: {{condition.result}}
Generated: {{now}}
- TinyOpsGitHub Comment Example
name: large-pr-warning
trigger:
type: poll
interval: 15m
condition:
provider: github
check: pr.lines_changed
operator: gt
value: 500
repo: acme/webapp
action:
provider: github
method: pr_comment
params:
body: |
## Large PR Detected
This PR has **{{condition.result}}** lines changed (threshold: 500).
Consider splitting into smaller PRs for easier review.
_Automated by {{rule.name}} at {{now}}_Webhook Payload Debugging
name: release-notification
trigger:
type: webhook
event: release
source: generic
action:
provider: slack
method: send_message
params:
channel: "#releases"
text: "Release event received at {{now}}. Payload: {{trigger.data}}"Multiple Variables in One String
You can combine any number of variables in a single param value:
params:
text: "[{{rule.name}}] Alert at {{now}}: value is {{condition.result}}. Contact {{org.owner.email}}."Variables by Provider Context
| Variable | Availability |
|---|---|
{{condition.result}} | Any rule with a condition |
{{condition.pr.title}} | PR checks only (pr.age, pr.age_hours, pr.lines_changed) |
{{condition.pr.number}} | PR checks only |
{{condition.pr.url}} | PR checks only |
{{org.owner.email}} | Always |
{{rule.name}} | Always |
{{now}} | Always |
{{trigger.data}} | Webhook triggers only |
Next Steps
- Actions for all available methods and params
- Conditions to understand what
{{condition.result}}contains - YAML Syntax for complete rule structure