app.startup
Fires exactly once when the Maestro application launches. Ideal for workspace setup, dependency installation, health checks, or any initialization that should happen once per session. Required fields: None beyond the universalname, event, and either prompt or prompt_file.
Behavior:
- Fires once per application launch
- Does NOT re-fire when toggling Cue on/off in Settings
- Does not re-fire on YAML hot-reload (deduplication by subscription name)
- Resets on session removal (so re-adding the session fires again on next app launch)
- Not affected by sleep/wake reconciliation
- Works with
fan_out,filter,output_prompt, andprompt_file
| Field | Type | Description |
|---|---|---|
reason | string | Always "system_startup" |
time.heartbeat
Fires on a periodic timer. The subscription triggers immediately when the engine starts, then repeats at the configured interval. Required fields:| Field | Type | Description |
|---|---|---|
interval_minutes | number | Minutes between triggers (must be > 0) |
- Fires immediately on engine start (or when the subscription is first loaded)
- Reconciles missed intervals after system sleep - if your machine sleeps through one or more intervals, Cue fires a catch-up event on wake
- The interval resets after each trigger, not after each run completes
{{CUE_TRIGGER_NAME}} and {{CUE_EVENT_TIMESTAMP}}.
time.scheduled
Fires at specific times and days of the week - a cron-like trigger for precise scheduling. Required fields:| Field | Type | Description |
|---|---|---|
schedule_times | string[] | Array of times in HH:MM format (24-hour clock) |
| Field | Type | Default | Description |
|---|---|---|---|
schedule_days | string[] | every day | Days of the week to run: mon, tue, wed, thu, fri, sat, sun |
- Checks every 60 seconds if the current time matches any
schedule_timesentry - If
schedule_daysis set, the current day must also match - Does not fire immediately on engine start (unlike
time.heartbeat) - Multiple times per day are supported - add multiple entries to
schedule_times
| Field | Description | Example |
|---|---|---|
matched_time | The scheduled time that matched | 09:00 |
matched_day | The day of the week when it triggered | mon |
time.once
Fires exactly once at a specific wall-clock moment, then deletes itself fromcue.yaml. This is the subsystem to reach for when a user says “in 20 minutes do X”, “tomorrow at 9am email me a summary”, “remind me at 4pm to push the rc branch”, or “schedule a 1h check-in” - anything that maps to a single action tied to a clock.
Required fields:
| Field | Type | Description |
|---|---|---|
fire_at | string (ISO-8601) | The wall-clock moment to fire. Must include a timezone offset (Z, ±HH:MM, or the colon-less ±HHMM). Anything missing the offset is rejected at load time. |
| Field | Type | Default | Description |
|---|---|---|---|
grace_minutes | number | 360 | Missed-fire grace window in minutes. If Maestro is closed when fire_at arrives, the sub fires on next startup as long as the current time is within this window of fire_at. Past the window, the sub is logged as expired and self-destructs without firing. |
self_destruct_on_failure | boolean | true | Whether to remove the sub from cue.yaml on a failed or timeout outcome. Set false to keep the sub in place for post-mortem inspection. |
- Poll-based at roughly 30-second granularity
- Fires once when the wall clock crosses
fire_at - Self-destructs from
cue.yamlafter a successful run (statuscompleted) - On
failedortimeout, also self-destructs unlessself_destruct_on_failure: false - Supports all standard
actionvalues:prompt(default, runs the configured agent with the rendered prompt),notify(surfaces a toast through the owning agent - clicking it jumps there), andcommand(shell or CLI invocation) - The CLI command
maestro-cli cue scheduleis the supported way to createtime.oncesubs - it handles ISO formatting, timezone offsets,target_node_keygeneration, and writes directly to the owning agent’s.maestro/cue.yaml. Do not hand-authortime.oncesubscriptions.
| Variable | Description | Example |
|---|---|---|
{{CUE_FIRE_AT}} | The originally-scheduled fire_at timestamp (ISO-8601) | 2026-05-22T16:00:00-05:00 |
{{CUE_TRIGGER_NAME}}, {{CUE_EVENT_TYPE}}, {{CUE_EVENT_TIMESTAMP}}, and {{CUE_PIPELINE_NAME}} variables are also available.
Creating, listing, and cancelling:
file.changed
Fires when files matching a glob pattern are created, modified, or deleted. Required fields:| Field | Type | Description |
|---|---|---|
watch | string (glob) | Glob pattern for files to monitor |
- Monitors for
add,change, andunlink(delete) events - Debounces by 5 seconds per file - rapid saves to the same file produce a single event
- The glob is evaluated relative to the project root
- Standard glob syntax:
*matches within a directory,**matches across directories
| Variable | Description | Example |
|---|---|---|
{{CUE_FILE_PATH}} | Absolute path to the changed file | /project/src/app.ts |
{{CUE_FILE_NAME}} | Filename only | app.ts |
{{CUE_FILE_DIR}} | Directory containing the file | /project/src |
{{CUE_FILE_EXT}} | File extension (with dot) | .ts |
{{CUE_FILE_CHANGE_TYPE}} | Change type | add, change, unlink |
changeType field is also available in filters.
agent.completed
Fires when another Maestro agent finishes a task. This is the foundation for agent chaining - building multi-step pipelines where one agent’s completion triggers the next. Required fields:| Field | Type | Description |
|---|---|---|
source_session | string or list | Name(s) of the agent(s) to watch for completion |
- Single source (string): Fires immediately when the named agent completes
- Multiple sources (list): Waits for all named agents to complete before firing (fan-in). See Fan-In
- The source agent’s output is captured and available via
{{CUE_SOURCE_OUTPUT}}(truncated to 5,000 characters) - Matches agent names as shown in the Left Bar
| Variable | Description | Example |
|---|---|---|
{{CUE_SOURCE_SESSION}} | Name of the completing agent(s) | builder |
{{CUE_SOURCE_OUTPUT}} | Truncated stdout from the source (max 5K chars) | Build succeeded |
{{CUE_SOURCE_STATUS}} | Run status (completed, failed, timeout) | completed |
{{CUE_SOURCE_EXIT_CODE}} | Process exit code | 0 |
{{CUE_SOURCE_DURATION}} | Run duration in milliseconds | 15000 |
{{CUE_SOURCE_TRIGGERED_BY}} | Name of the subscription that triggered the source run | lint-on-save |
triggeredBy field is particularly useful when a source agent has multiple Cue subscriptions but you only want to chain from a specific one. See Selective Chaining for a complete example.
task.pending
Watches markdown files for unchecked task items (- [ ]) and fires when pending tasks are found.
Required fields:
| Field | Type | Description |
|---|---|---|
watch | string (glob) | Glob pattern for markdown files to scan |
| Field | Type | Default | Description |
|---|---|---|---|
poll_minutes | number | 1 | Minutes between scans (minimum 1) |
- Scans files matching the glob pattern at the configured interval
- Fires when unchecked tasks (
- [ ]) are found - Only fires when the task list changes (new tasks appear or existing ones are modified)
- The full task list is formatted and available via
{{CUE_TASK_LIST}} - File content (truncated to 10K characters) is available via
{{CUE_TASK_CONTENT}}
| Variable | Description | Example |
|---|---|---|
{{CUE_TASK_FILE}} | Path to the file containing tasks | /project/TODO.md |
{{CUE_TASK_FILE_NAME}} | Filename only | TODO.md |
{{CUE_TASK_FILE_DIR}} | Directory containing the file | /project |
{{CUE_TASK_COUNT}} | Number of pending tasks found | 3 |
{{CUE_TASK_LIST}} | Formatted list with line numbers | L5: Write unit tests |
{{CUE_TASK_CONTENT}} | Full file content (truncated to 10K chars) | (file contents) |
github.pull_request
Polls GitHub for new pull requests using the GitHub CLI (gh).
Optional fields:
| Field | Type | Default | Description |
|---|---|---|---|
repo | string | auto | GitHub repo in owner/repo format. Auto-detected from git remote if omitted |
poll_minutes | number | 5 | Minutes between polls (minimum 1) |
- Requires the GitHub CLI (
gh) to be installed and authenticated - On first run, seeds the “seen” list with existing PRs - only new PRs trigger events
- Tracks seen PRs in a local database with 30-day retention
- Auto-detects the repository from the git remote if
repois not specified
| Variable | Description | Example |
|---|---|---|
{{CUE_GH_TYPE}} | Always pull_request | pull_request |
{{CUE_GH_NUMBER}} | PR number | 42 |
{{CUE_GH_TITLE}} | PR title | Add user authentication |
{{CUE_GH_AUTHOR}} | Author’s GitHub login | octocat |
{{CUE_GH_URL}} | HTML URL to the PR | https://github.com/org/repo/pull/42 |
{{CUE_GH_BODY}} | PR description (truncated) | (PR body text) |
{{CUE_GH_LABELS}} | Comma-separated label names | bug, priority-high |
{{CUE_GH_STATE}} | PR state | open |
{{CUE_GH_BRANCH}} | Head (source) branch | feature/auth |
{{CUE_GH_BASE_BRANCH}} | Base (target) branch | main |
{{CUE_GH_REPO}} | Repository in owner/repo format | RunMaestro/Maestro |
github.issue
Polls GitHub for new issues using the GitHub CLI (gh). Behaves identically to github.pull_request but for issues.
Optional fields:
| Field | Type | Default | Description |
|---|---|---|---|
repo | string | auto | GitHub repo in owner/repo format |
poll_minutes | number | 5 | Minutes between polls (minimum 1) |
github.pull_request - requires GitHub CLI, seeds on first run, tracks seen issues.
Example:
github.pull_request, except:
| Variable | Description | Example |
|---|---|---|
{{CUE_GH_TYPE}} | Always issue | issue |
{{CUE_GH_ASSIGNEES}} | Comma-separated assignee logins | alice, bob |
{{CUE_GH_BRANCH}}, {{CUE_GH_BASE_BRANCH}}) are not available for issues.
cli.trigger
Fires only when explicitly triggered from the command line viamaestro-cli cue trigger <name>. Unlike other event types, cli.trigger has no background watcher or poller - it waits for a manual invocation.
No additional fields required - just name, event, prompt, and optionally enabled.
Behavior:
- Does nothing on its own - only fires when you run
maestro-cli cue trigger <subscription-name> - Supports an optional
--promptflag to override or supply the prompt at invocation time - The override text is available in the prompt template as
{{CUE_CLI_PROMPT}} - Ideal for deployment scripts, CI/CD integration, on-demand reviews, or ad-hoc automation
| Variable | Description | Example |
|---|---|---|
{{CUE_CLI_PROMPT}} | Prompt text passed via --prompt flag | Deploy to staging |
{{CUE_TRIGGER_NAME}} | Name of the subscription that was triggered | deploy |
{{CUE_EVENT_TYPE}} | Always cli.trigger | cli.trigger |