Skip to main content
Cue supports eight event types. Each type watches for a different kind of activity and produces a payload that can be injected into prompts via template variables.

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 universal name, 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, and prompt_file
Example:
subscriptions:
  - name: init-workspace
    event: app.startup
    prompt: |
      Set up the development environment:
      1. Run `npm install` if node_modules is missing
      2. Check that required env vars are set
      3. Report any issues found
Payload fields:
FieldTypeDescription
reasonstringAlways "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:
FieldTypeDescription
interval_minutesnumberMinutes between triggers (must be > 0)
Behavior:
  • 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
Example:
subscriptions:
  - name: hourly-summary
    event: time.heartbeat
    interval_minutes: 60
    prompt: |
      Generate a summary of git activity in the last hour.
      Run `git log --oneline --since="1 hour ago"` and organize by author.
Payload fields: None specific to this event type. Use common variables like {{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:
FieldTypeDescription
schedule_timesstring[]Array of times in HH:MM format (24-hour clock)
Optional fields:
FieldTypeDefaultDescription
schedule_daysstring[]every dayDays of the week to run: mon, tue, wed, thu, fri, sat, sun
Behavior:
  • Checks every 60 seconds if the current time matches any schedule_times entry
  • If schedule_days is 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
Example — weekday standup:
subscriptions:
  - name: morning-standup
    event: time.scheduled
    schedule_times:
      - '09:00'
    schedule_days:
      - mon
      - tue
      - wed
      - thu
      - fri
    prompt: |
      Generate a standup report:
      1. Run `git log --oneline --since="yesterday"` to find recent changes
      2. Check for any failing tests
      3. Summarize what was accomplished and what's next
Example — multiple times daily:
subscriptions:
  - name: status-check
    event: time.scheduled
    schedule_times:
      - '09:00'
      - '13:00'
      - '17:00'
    prompt: |
      Run a quick health check on all services.
Payload fields:
FieldDescriptionExample
matched_timeThe scheduled time that matched09:00
matched_dayThe day of the week when it triggeredmon

file.changed

Fires when files matching a glob pattern are created, modified, or deleted. Required fields:
FieldTypeDescription
watchstring (glob)Glob pattern for files to monitor
Behavior:
  • Monitors for add, change, and unlink (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
Example:
subscriptions:
  - name: test-on-change
    event: file.changed
    watch: 'src/**/*.{ts,tsx}'
    filter:
      changeType: '!unlink' # Don't trigger on file deletions
    prompt: |
      The file {{CUE_FILE_PATH}} was {{CUE_EVENT_TYPE}}.
      Run the tests related to this file and report results.
Payload fields:
VariableDescriptionExample
{{CUE_FILE_PATH}}Absolute path to the changed file/project/src/app.ts
{{CUE_FILE_NAME}}Filename onlyapp.ts
{{CUE_FILE_DIR}}Directory containing the file/project/src
{{CUE_FILE_EXT}}File extension (with dot).ts
{{CUE_FILE_CHANGE_TYPE}}Change typeadd, change, unlink
The 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:
FieldTypeDescription
source_sessionstring or listName(s) of the agent(s) to watch for completion
Behavior:
  • 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
Example — single source:
subscriptions:
  - name: deploy-after-build
    event: agent.completed
    source_session: 'builder'
    filter:
      exitCode: 0 # Only deploy if build succeeded
    prompt: |
      The build agent completed successfully.
      Output: {{CUE_SOURCE_OUTPUT}}

      Deploy to staging with `npm run deploy:staging`.
Example — fan-in (multiple sources):
subscriptions:
  - name: integration-tests
    event: agent.completed
    source_session:
      - 'backend-build'
      - 'frontend-build'
    prompt: |
      Both builds completed. Run the full integration test suite.
Payload fields:
VariableDescriptionExample
{{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 code0
{{CUE_SOURCE_DURATION}}Run duration in milliseconds15000
{{CUE_SOURCE_TRIGGERED_BY}}Name of the subscription that triggered the source runlint-on-save
These fields are also available in filters. The 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:
FieldTypeDescription
watchstring (glob)Glob pattern for markdown files to scan
Optional fields:
FieldTypeDefaultDescription
poll_minutesnumber1Minutes between scans (minimum 1)
Behavior:
  • 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}}
Example:
subscriptions:
  - name: todo-worker
    event: task.pending
    watch: '**/*.md'
    poll_minutes: 5
    prompt: |
      Found {{CUE_TASK_COUNT}} pending tasks in {{CUE_TASK_FILE}}:

      {{CUE_TASK_LIST}}

      Pick the most important task and complete it.
      When finished, mark it as done by changing `- [ ]` to `- [x]`.
Payload fields:
VariableDescriptionExample
{{CUE_TASK_FILE}}Path to the file containing tasks/project/TODO.md
{{CUE_TASK_FILE_NAME}}Filename onlyTODO.md
{{CUE_TASK_FILE_DIR}}Directory containing the file/project
{{CUE_TASK_COUNT}}Number of pending tasks found3
{{CUE_TASK_LIST}}Formatted list with line numbersL5: 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:
FieldTypeDefaultDescription
repostringautoGitHub repo in owner/repo format. Auto-detected from git remote if omitted
poll_minutesnumber5Minutes between polls (minimum 1)
Behavior:
  • 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 repo is not specified
Example:
subscriptions:
  - name: pr-reviewer
    event: github.pull_request
    poll_minutes: 3
    filter:
      draft: false # Skip draft PRs
      base_branch: main # Only PRs targeting main
    prompt: |
      New PR: {{CUE_GH_TITLE}} (#{{CUE_GH_NUMBER}})
      Author: {{CUE_GH_AUTHOR}}
      Branch: {{CUE_GH_BRANCH}} -> {{CUE_GH_BASE_BRANCH}}
      Labels: {{CUE_GH_LABELS}}
      URL: {{CUE_GH_URL}}

      {{CUE_GH_BODY}}

      Review this PR for:
      1. Code quality and style consistency
      2. Potential bugs or edge cases
      3. Test coverage
Payload fields:
VariableDescriptionExample
{{CUE_GH_TYPE}}Always pull_requestpull_request
{{CUE_GH_NUMBER}}PR number42
{{CUE_GH_TITLE}}PR titleAdd user authentication
{{CUE_GH_AUTHOR}}Author’s GitHub loginoctocat
{{CUE_GH_URL}}HTML URL to the PRhttps://github.com/org/repo/pull/42
{{CUE_GH_BODY}}PR description (truncated)(PR body text)
{{CUE_GH_LABELS}}Comma-separated label namesbug, priority-high
{{CUE_GH_STATE}}PR stateopen
{{CUE_GH_BRANCH}}Head (source) branchfeature/auth
{{CUE_GH_BASE_BRANCH}}Base (target) branchmain
{{CUE_GH_REPO}}Repository in owner/repo formatRunMaestro/Maestro

github.issue

Polls GitHub for new issues using the GitHub CLI (gh). Behaves identically to github.pull_request but for issues. Optional fields:
FieldTypeDefaultDescription
repostringautoGitHub repo in owner/repo format
poll_minutesnumber5Minutes between polls (minimum 1)
Behavior: Same as github.pull_request — requires GitHub CLI, seeds on first run, tracks seen issues. Example:
subscriptions:
  - name: issue-triage
    event: github.issue
    poll_minutes: 5
    filter:
      labels: '!wontfix' # Skip issues labeled wontfix
    prompt: |
      New issue: {{CUE_GH_TITLE}} (#{{CUE_GH_NUMBER}})
      Author: {{CUE_GH_AUTHOR}}
      Assignees: {{CUE_GH_ASSIGNEES}}
      Labels: {{CUE_GH_LABELS}}

      {{CUE_GH_BODY}}

      Triage this issue:
      1. Identify the area of the codebase affected
      2. Estimate complexity (small/medium/large)
      3. Suggest which team member should handle it
Payload fields: Same as github.pull_request, except:
VariableDescriptionExample
{{CUE_GH_TYPE}}Always issueissue
{{CUE_GH_ASSIGNEES}}Comma-separated assignee loginsalice, bob
The branch-specific variables ({{CUE_GH_BRANCH}}, {{CUE_GH_BASE_BRANCH}}) are not available for issues.