-
Notifications
You must be signed in to change notification settings - Fork 21
feat(notifications): user-defined domain notifications (type: notification) #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
PolyphonyRequiem
wants to merge
1
commit into
microsoft:main
Choose a base branch
from
PolyphonyRequiem:feat/notifications
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| # Notifications Example | ||
| # | ||
| # Demonstrates user-defined domain notifications: fire-and-forget messages | ||
| # the workflow publishes to the outside world for external tooling to hook | ||
| # off. Notifications are a VISIBILITY primitive — they do not block, do | ||
| # not wait for an ack, and do not gate control flow. If you need a | ||
| # decision to flow back into the workflow, use a human_gate instead. | ||
| # | ||
| # Each emission is written to a dedicated notifications.jsonl file | ||
| # alongside the standard event log. The file path is printed at the end | ||
| # of the run. | ||
| # | ||
| # Usage: | ||
| # conductor run examples/notifications.yaml \ | ||
| # --input pr_id=42 \ | ||
| # --input apex_id=apex-2026-05-18 | ||
|
|
||
| workflow: | ||
| name: notifications-demo | ||
| description: Demonstrates user-defined fire-and-forget notifications | ||
| version: "1.0.0" | ||
| entry_point: open_pr | ||
|
|
||
| runtime: | ||
| provider: copilot | ||
|
|
||
| limits: | ||
| max_iterations: 10 | ||
|
|
||
| input: | ||
| pr_id: | ||
| type: number | ||
| description: ADO pull-request id | ||
| apex_id: | ||
| type: string | ||
| description: Apex run id (correlation key) | ||
| ado_org: | ||
| type: string | ||
| default: contoso | ||
| ado_project: | ||
| type: string | ||
| default: feature-pr | ||
|
|
||
| # Workflow-level notification configuration. | ||
| notifications: | ||
| # Optional. Defaults to the slugified workflow name. | ||
| namespace: polyphony.feature_pr | ||
|
|
||
| # Workflow input keys auto-surfaced on every notification. Inherited | ||
| # by sub-workflows (parent wins on key collision). | ||
| correlation: | ||
| - apex_id | ||
|
|
||
| # Type registry. Each entry declares a fixed payload schema and a | ||
| # version. Consumers MUST pin on schema_id (<namespace>.<type>@<version>), | ||
| # not on type name alone. | ||
| types: | ||
| pr_ready: | ||
| version: 1 | ||
| description: A pull request has reached ready-for-review state. | ||
| payload: | ||
| pr_url: { type: string } | ||
| pr_id: { type: number } | ||
| ado_org: { type: string } | ||
| ado_project: { type: string } | ||
|
|
||
| pr_needs_input: | ||
| version: 1 | ||
| description: A PR has changed and requires reviewer input. | ||
| payload: | ||
| pr_url: { type: string } | ||
| change_summary: { type: string } | ||
|
|
||
| agents: | ||
| - name: open_pr | ||
| description: Stand-in for whatever opens / discovers the PR. | ||
| model: claude-haiku-4.5 | ||
| prompt: | | ||
| Pretend you are creating pull request {{ workflow.input.pr_id }} in | ||
| {{ workflow.input.ado_org }}/{{ workflow.input.ado_project }}. | ||
| Reply with a one-sentence summary of what was done. | ||
| output: | ||
| summary: | ||
| type: string | ||
| routes: | ||
| - to: announce_ready | ||
|
|
||
| # Notifications fire mid-flow. Note we route to the next step, NOT to | ||
| # $end — emission is independent of routing. | ||
| - name: announce_ready | ||
| type: notification | ||
| notification: pr_ready | ||
| payload: | ||
| pr_url: "https://dev.azure.com/{{ workflow.input.ado_org }}/{{ workflow.input.ado_project }}/_git/repo/pullrequest/{{ workflow.input.pr_id }}" | ||
| pr_id: "{{ workflow.input.pr_id }}" | ||
| ado_org: "{{ workflow.input.ado_org }}" | ||
| ado_project: "{{ workflow.input.ado_project }}" | ||
| routes: | ||
| - to: detect_change | ||
|
|
||
| - name: detect_change | ||
| description: Stand-in for whatever notices the PR changed. | ||
| model: claude-haiku-4.5 | ||
| prompt: | | ||
| Pretend a reviewer pushed a small change to PR | ||
| {{ workflow.input.pr_id }}. Reply with a one-line description of | ||
| the change. | ||
| output: | ||
| change: | ||
| type: string | ||
| routes: | ||
| - to: announce_needs_input | ||
|
|
||
| - name: announce_needs_input | ||
| type: notification | ||
| notification: pr_needs_input | ||
| payload: | ||
| pr_url: "https://dev.azure.com/{{ workflow.input.ado_org }}/{{ workflow.input.ado_project }}/_git/repo/pullrequest/{{ workflow.input.pr_id }}" | ||
| change_summary: "{{ detect_change.output.change }}" | ||
| routes: | ||
| - to: $end | ||
|
|
||
| output: | ||
| pr_summary: "{{ open_pr.output.summary }}" | ||
| change: "{{ detect_change.output.change }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick confirmation: on resume the dashboard already replays the main event log (
dashboard.replay_events_from_jsonlat line 1823), andnotificationevents flow through the same emitter — so old emissions will render in the dashboard on resume. The separate.notifications.jsonlis fresh per resume, which is fine for external tailers given the stableemission_iddedup. No action needed; flagging only to confirm the behavior is intentional.