Skip to main content
Cue supports eleven 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:
Payload fields:

time.heartbeat

Fires on a periodic timer. The subscription triggers immediately when the engine starts, then repeats at the configured interval. Required fields: Behavior:
  • Fires immediately on engine start, when Cue is turned on, and when the subscription is first loaded
  • Saving or reloading cue.yaml does not fire a heartbeat whose name and trigger settings (interval_minutes, filter, label) are unchanged: it keeps its schedule, so the next run stays where it was. Editing only its prompt or targets keeps the schedule too, and the next run uses the new prompt. A heartbeat that is new, renamed, turned back on, or has a changed interval, filter or label fires on load. A reload that removes a heartbeat stops it. If a kept heartbeat’s next run fell due while the reload was happening (for example right after the machine wakes), it runs once at load
  • 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:
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: Optional fields: 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:
Example - multiple times daily:
Payload fields:
time.scheduled and time.heartbeat subscriptions are also Scheduled Tasks: they appear in the Cue modal’s Scheduled Tasks tab and can be created, re-timed, paused, and cancelled with maestro-cli cue schedule --daily-at / --every, without hand-editing YAML.

time.once

Fires exactly once at a specific wall-clock moment, then deletes itself from cue.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: Optional fields: Behavior:
  • Poll-based at roughly 30-second granularity
  • Fires once when the wall clock crosses fire_at
  • Self-destructs from cue.yaml after a successful run (status completed)
  • On failed or timeout, also self-destructs unless self_destruct_on_failure: false
  • Supports all standard action values: prompt (default, runs the configured agent with the rendered prompt), notify (surfaces a toast through the owning agent - clicking it jumps there), and command (shell or CLI invocation)
  • The CLI command maestro-cli cue schedule is the supported way to create time.once subs - it handles ISO formatting, timezone offsets, target_node_key generation, and writes directly to the owning agent’s .maestro/cue.yaml. Do not hand-author time.once subscriptions.
Example - notify reminder:
Example - prompt run:
Payload fields: The standard {{CUE_TRIGGER_NAME}}, {{CUE_EVENT_TYPE}}, {{CUE_EVENT_TIMESTAMP}}, and {{CUE_PIPELINE_NAME}} variables are also available. Creating, listing, and cancelling:
The same tasks are listed and editable in the app under Maestro Cue → Scheduled Tasks (maestro-cli open cue --tab scheduled). The tab and the CLI share one module, so neither can drift from the YAML.

file.changed

Fires when files matching a glob pattern are created, modified, or deleted. Required fields: 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
  • If the OS file-watch limit is used up (EMFILE or ENOSPC, common on busy Linux and Docker hosts), the subscription switches to polling every second and logs a warning. To restore native watching, raise fs.inotify.max_user_instances (EMFILE) or fs.inotify.max_user_watches (ENOSPC) on the host
Example:
Payload fields: 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: 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
  • Cue-owned runs provide the source agent’s output via {{CUE_SOURCE_OUTPUT}} (truncated to 5,000 characters). External desktop turns, including dispatch --new-tab, report the process outcome without stdout or Cue subscription provenance.
  • Matches agent IDs or names as shown in the Left Bar. A desktop AI-tab process is matched to its base agent; a single-source event also carries sourceProcessId and sourceTabId for correlation and filters. Legacy desktop processes without an explicit tab do not invent a tab ID.
A source_sub condition requires a completion from that Cue subscription. External Dispatch completions have no triggeredBy, so they do not satisfy source_sub. Cue’s own run-completion path retains the subscription name, output and run lineage. The plugin bus event also named agent.completed is a separate channel. For a single-source subscription, filter: { sourceTabId: '<worker-tab-id>' } limits it to one explicit worker tab. Fan-in tracks one arrival per source agent; two tabs belonging to the same agent do not satisfy two sources. Complete and partial fan-in events retain known desktop identities in perSourceCompletions, keyed by base agent ID, with each entry carrying sourceProcessId and the explicit sourceTabId when available. If another tab of the same agent completes before the join fires, that agent’s latest arrival replaces the earlier one. Desktop fan-in progress is held in memory and is lost on desktop restart. Only the standalone engine persists partial fan-in progress; its existing storage schema has no desktop process/tab fields, so restored sources have no invented desktop identities. This is a technical execution outcome, not acceptance of the worker’s deliverable. Use an acceptance check before releasing dependent work. A Dispatch --notify-on-complete callback is a separate explicit return channel and currently does not survive a desktop restart. Example - single source:
Example - fan-in (multiple sources):
Payload fields: These fields are also available in filters. The status field follows the shared turn-completion contract (completed when an answer was captured despite a non-zero exit code), while exitCode reports the raw process exit code. 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: Optional fields: 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:
Payload fields:

github.pull_request

Polls GitHub for new pull requests using the GitHub CLI (gh). Required fields: Optional fields: 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. A first poll that finds no matching PRs (a new repository, say) still counts, so the first PR opened after it fires
  • Tracks seen PRs in a local database with 30-day retention
  • Needs repo: the repository is not detected from the git remote, so a subscription without it never runs on its own
Example:
Payload fields:

github.issue

Polls GitHub for new issues using the GitHub CLI (gh). Behaves identically to github.pull_request but for issues. Required fields: Optional fields: Behavior: Same as github.pull_request - requires GitHub CLI, seeds on first run, tracks seen issues. Example:
Payload fields: Same as github.pull_request, except: The branch-specific variables ({{CUE_GH_BRANCH}}, {{CUE_GH_BASE_BRANCH}}) are not available for issues.

github.label

Fires the moment a label is added to a pull request or an issue. Applying a label becomes the button that starts the work: label a PR ready-to-merge and the agent picks it up on the next poll. Unlike github.pull_request / github.issue, which poll item lists and fire on discovery, this event reads GitHub’s repo-wide issue-event feed. That feed reports the label add itself, with the label name and who applied it, so a label removed and re-added fires twice, and a label buried in an old issue still fires. Required fields: Optional fields: Behavior:
  • Requires the GitHub CLI (gh), installed and authenticated
  • Seeds on first run: labels already present when the subscription is first saved never fire, only labels added afterwards
  • Fires once per label add, in the order the labels were applied
  • Polls immediately on system wake, so labels applied while the machine slept are picked up within seconds
  • Scans up to 300 repo events per poll. On a very busy repo, lower poll_minutes so a label add cannot be buried between polls (the log warns when it is at risk)
Example:
Payload fields: The GitHub fields of github.pull_request / github.issue are all present, plus: The branch variables ({{CUE_GH_BRANCH}}, {{CUE_GH_BASE_BRANCH}}) are empty for this event: the label feed does not carry branch data. Fetch it in the prompt with gh pr view {{CUE_GH_NUMBER}} when you need it.

GitHub webhooks

github.pull_request, github.issue, and github.label poll by default. Add a webhook block and the same subscription also takes GitHub’s webhook deliveries, so the agent starts within seconds of the change instead of on the next poll. Polling keeps running as a reconcile, every 30 minutes unless poll_minutes says otherwise, and catches anything a delivery missed: Maestro was closed, the tunnel was down, or GitHub gave up retrying. A change seen both ways fires once. Deliveries and polls record what they fired in the same place, so whichever arrives second finds it already handled. webhook sub-fields: A secret is required, as for webhook.received. secret_env is looked up the way every server secret is: $CREDENTIALS_DIRECTORY/<NAME> (a systemd credential), then /run/secrets/<NAME> (a Docker or Compose secret), then the environment variable <NAME>. If none of them has it when the subscription loads, the Cue log says so and the subscription keeps polling. Example:
Setting up the webhook on GitHub:
  1. In the repository, open Settings > Webhooks > Add webhook.
  2. Payload URL: a public URL that forwards to http://127.0.0.1:17997/cue/<path>. GitHub cannot reach the loopback listener directly, so put a tunnel or a reverse proxy in front of it (see the listener notes under webhook.received, and Webhooks behind a proxy for nginx, Caddy and tunnel configurations).
  3. Content type: application/json. Form-encoded deliveries are ignored.
  4. Secret: the value of the secret named in secret_env.
  5. Events: pick individual events, matching the triggers that use this path:
GitHub sends a ping when the webhook is saved, and the Cue log reports it as connected. Several subscriptions can share one path and secret; each one picks out the deliveries that apply to it. Behavior:
  • Deliveries for a repository other than the subscription’s repo are ignored.
  • A subscription that has never polled fires the delivery, then polls straight away so the items that already existed are recorded instead of fired.
  • A comment on a pull request (issue_comment) does not carry the pull request’s branches or draft flag, which a filter may test. Instead of firing from it, Maestro polls right away, and the poll fires the change with the whole pull request.
  • GitHub’s retries and its Redeliver button reuse the delivery id. Maestro remembers delivery ids for 24 hours and answers a repeat with 200 without firing it again. A delivery that never reached Maestro (the tunnel or proxy was down, so GitHub shows it failed) is not a repeat: redelivering it is answered 202, and if a poll has fired the change in the meantime it fires nothing. If a subscription fails on a delivery, the answer is 500 and a retry reaches that subscription only. While Cue is off or stopping the answer is 503.
  • The answer comes after the change has been handed on (or dropped on purpose), and the change is recorded as fired in that same step. If Maestro stops before that, nothing is recorded and the next poll fires the change.
  • When a webhook and a poll both report a label add, it fires once. Each add is matched on its own, so a label removed and re-added still fires twice, even a minute apart.
  • A delivery older than the change already fired (GitHub does not promise order) fires nothing.
  • filter, gh_state, and max_notifications apply to deliveries exactly as they do to polls, and the payload fields are the same.

cli.trigger

Fires only when explicitly triggered from the command line via maestro-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 --prompt flag 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
Example:
Triggering from the command line:
Discovering available subscriptions:
Payload fields:

webhook.received

Fires when an external service POSTs to Maestro’s local webhook listener. This is the generic escape hatch: anything that can send an HTTP request - GitHub, GitLab, Slack, a CI system, a cron box, your own script - can drive a Cue pipeline, and the filter decides which payloads matter. Required fields: webhook sub-fields: A secret is mandatory. A webhook path with no authentication is a remote trigger for an AI agent running with your credentials, so a subscription without secret or secret_env fails config validation rather than quietly starting to listen. The listener:
  • One listener serves every webhook subscription across every agent. It starts when the first one loads and stops when the last one unloads.
  • Binds to 127.0.0.1:17997 by default. Override with MAESTRO_CUE_WEBHOOK_PORT and MAESTRO_CUE_WEBHOOK_HOST.
  • To take deliveries from the public internet, point a tunnel (ngrok, cloudflared) or a reverse proxy at the loopback port (configurations). Binding the listener itself to 0.0.0.0 is possible but puts an agent trigger directly on your network.
  • Only POST is accepted. Bodies over 1 MiB are rejected with 413.
  • Multiple subscriptions may share a path. Each authenticates independently, and every one that passes receives the delivery.
  • A delivery is answered 202 only once Maestro has handled it: its run has started or is queued (the queue survives a restart), or it was dropped on purpose (a filter that does not match, a SusFactor block). The SusFactor check therefore runs before the answer.
  • A delivery whose id (X-GitHub-Delivery, X-Request-Id, or X-Maestro-Delivery) a subscription already handled in the last 24 hours is not fired for it again; when every subscription on the path has it, the answer is 200. Two copies arriving together fire once. If a subscription fails on a delivery, the answer is 500 and a retry reaches only the subscriptions that did not get it. A delivery with no id header is never treated as a repeat.
  • While Cue is off or stopping, a delivery is answered 503 with Retry-After: 30 and is not recorded, so the sender’s retry fires once Cue runs.
Authenticating a delivery: Without signature_header, the sender presents the secret:
Authorization: Bearer <secret> works too. With signature_header, the sender signs the raw body with HMAC-SHA256 and sends the digest in that header. Both bare hex and the sha256=<hex> form GitHub and GitLab use are accepted - so pointing a GitHub webhook at Maestro with signature_header: X-Hub-Signature-256 and the same secret works with no glue code. Example:
Filtering: Filters read the event payload with dot-notation, so one endpoint can fan different payloads to different pipelines:
Payload fields: Template variables: Secrets never reach the payload: the Authorization, Cookie, X-Maestro-Cue-Secret, and configured signature headers are stripped before the event is built, so they cannot leak into a prompt, the activity log, or the Cue database.