Batch signature and approval notifications via debounced worker
Replace the immediate per-document approval email and the manual "send signing notifications" action with a single debounced worker that batches pending requests per recipient and organization.
The worker scans every tenant on an interval (default 5m) and sends one consolidated signing email and/or one approval email per recipient/org, listing all documents awaiting their signature or approval. A request is notified once it has been pending past the debounce delay (default 15m), then re-notified on a reminder cadence (default 72h) until actioned. A new last_notified_at column on signatures and approval decisions, stamped via a conditional UPDATE, provides the debounce, reminder schedule and concurrency-safe dedup.
Email copy now lists the documents and mentions the ~3 day reminder cadence. Removed the inline approval-on-publish email, the SendSigningNotifications service method/mutation/MCP tool, its IAM action, and the related console UI and n8n operation.
Summary by cubic
Batches signature and approval notifications into a debounced worker that sends one consolidated email per recipient and org. Replaces per-document emails and the manual action; adds configurable interval/debounce and a 1‑day reminder cadence (1x, 2x, 3x) with a 4‑email cap, plus multi-document emails with deep links. Implements ENG-506.
Coredata +590 -80
- Add last_notified_at and notification_count (migration) to track cadence.
- Add due-group loaders and claim/bump helpers for signatures/approvals with a 4-email cap.
- Add LoadByIDs for versions/quorums; remove LoadAwaitingSigning; add DocumentType.Label.
Service +630 -218
- Add debounced document notification worker that batches per recipient/org with concurrency-safe claims and widening reminders.
- Wire worker in
probodwith defaults and env/config; add document notification config. - Remove immediate approval-on-publish emails, the SendSigningNotifications flow, and the IAM action.
GraphQL API +0 -28
- Remove the sendSigningNotifications mutation and resolver.
MCP +0 -44
- Remove the sendSigningNotifications tool and schema.
App: console +1 -61
- Remove the "Send signing notifications" button, hook, and permission wiring.
Package: emails +45 -29
- Presenter now takes a main URL and a list of document summaries; subjects reference org compliance documents.
- Templates list pending docs with deep links; copy updated for multiple documents.
Package: n8n-node +0 -64
- Remove the "Send Signing Notifications" operation and menu entry.
Tests +10 -0
- Add builder defaults/custom-values tests for document notification config.
Other +5 -0
- Add
.envexamples forDOCUMENT_NOTIFICATION_INTERVAL,DOCUMENT_NOTIFICATION_DEBOUNCE_DELAY, andDOCUMENT_NOTIFICATION_REMINDER_INTERVAL.