Repository navigation
feat(automations): approvals as activities and an approval.waiting notification - #457
Merged
Merged
Conversation
…tification approval.waiting (read by created_at) and approval.decided (by decided_at) are the person's own activities, caused by the automation's run, so the timeline shows them to that person alone and their automations can react. A namespace's notification target can ask for approval.waiting, off by default, with links in what the run read broken up. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VF3LK1DBx3dXX2b8c5T3cQ
This was referenced Oct 16, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Requested by Adeel · project thread
Description
Before: an approval was only a row in the inbox. Nothing on the timeline said one was waiting or how it was decided, an automation couldn't react to one, and a team chat or webhook couldn't be told.
After: workflow studio M8, part 3 of 5. Each approval is now an activity:
approval.waitingwhen it starts to wait, read bycreated_at. Its actor is the automation (or the assistant, for its own approvals).approval.decidedwhen it is approved (done or failed), declined or expires, read bydecided_at. Its actor is the person who decided, or Lens when it expired.Both are the person's own (
lens.audienceowner): the timeline shows them to that person alone, not even to admins, and the person's automations can react ("when an approval has waited a day, remind me"). An automation's approval carries its run aslens.cause, so a follower can't loop for ever. Text the run read from outside Lens is listed inlens.untrusted.A namespace's notification target can now ask for
approval.waiting(off until a target picks it). Web addresses the run read from outside Lens are broken up in its text (hxxps://evil[.]example); the web app's own link stays as it is.How:
app/domain/events_approvals.pyadds theapprovalsandapproval_decisionsevent sources, paging only the viewer's own approvals, with indexes onapproval.created_atanddecided_at.notify.pygains the event and its source.approvals.pysetsdecided_atagain when a decision finishes or a stuck one fails, so the outcome is what the activity shows.Motivation and Context
Adeel's workflow studio, module M8 (approvals inbox), brief in the project's
workflow-studio/briefs/M8.md. Parts 1 and 2 were #447 and #455. Next: agents' approval tools, the/approvalspage.Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md. (n/a: studio modules land under one release note)Done questions (AGENTS.md)
approval.waitingis a notification event in Settings, off by default.DEFINE INDEX IF NOT EXISTS; approvals decided before this have nodecided_atand simply don't show as decided activities.tests/api/test_approvals.py), docs (automations.md,notifications.md), client regenerated withmake openapi.Question,Accept,Reject); no new dependency.🤖 Generated with Claude Code
https://claude.ai/code/session_01VF3LK1DBx3dXX2b8c5T3cQ
Generated by Claude Code