feat(tables): trigger workflows on row deletes - #7161
Open
j15z wants to merge 3 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThis PR adds post-commit Row Deleted workflow dispatch using snapshots returned by committed deletes.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/table/rows/ordering.ts | Returns committed deletion snapshots in bounded batches and invokes post-commit handlers. |
| apps/sim/lib/table/rows/service.ts | Dispatches deletion triggers for explicit single-row, ID-based, and filtered delete operations. |
| apps/sim/lib/table/delete-runner.ts | Connects committed background-delete batches to trigger dispatch using the revalidated table definition. |
| apps/sim/background/cleanup-table-row-ttl.ts | Returns TTL-deleted row snapshots and dispatches them after each locked transaction commits. |
| apps/sim/lib/table/trigger.ts | Adds delete-event payload handling with the deleted snapshot exposed as the previous row. |
| apps/sim/triggers/table/poller.ts | Exposes Row Deleted as a configurable table-trigger event. |
Sequence Diagram
sequenceDiagram
participant Caller
participant Delete as Delete transaction
participant Trigger as Table trigger dispatcher
participant Workflow
Caller->>Delete: Delete matching rows
Delete-->>Caller: Commit and return row snapshots
Caller->>Trigger: Dispatch Row Deleted snapshots
Trigger-->>Workflow: Queue matching workflow runs
Reviews (2): Last reviewed commit: "fix(tables): bound delete trigger snapsh..." | Re-trigger Greptile
There was a problem hiding this comment.
All reported issues were addressed across 11 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
j15z
force-pushed
the
feat/table-trigger-row-deletes
branch
from
August 27, 2026 21:23
44f5e12 to
38027ad
Compare
j15z
force-pushed
the
feat/table-trigger-row-deletes
branch
from
August 27, 2026 21:55
38027ad to
7e85085
Compare
j15z
force-pushed
the
feat/table-trigger-row-deletes
branch
from
August 27, 2026 21:57
7e85085 to
de702cd
Compare
j15z
force-pushed
the
feat/table-trigger-row-deletes
branch
from
August 28, 2026 02:05
de702cd to
cf3b70a
Compare
This was referenced Aug 28, 2026
j15z
force-pushed
the
feat/table-trigger-row-deletes
branch
from
August 28, 2026 02:23
cf3b70a to
e152759
Compare
j15z
force-pushed
the
feat/table-trigger-row-deletes
branch
from
August 28, 2026 02:35
e152759 to
c82a72d
Compare
Collaborator
Author
j15z
force-pushed
the
feat/table-trigger-row-deletes
branch
from
August 28, 2026 22:20
eb3e201 to
bd53d8e
Compare
j15z
force-pushed
the
feat/table-trigger-row-deletes
branch
from
August 28, 2026 22:57
bd53d8e to
f5df1cb
Compare
j15z
force-pushed
the
feat/table-trigger-row-deletes
branch
from
August 29, 2026 21:21
f5df1cb to
36ee470
Compare
j15z
force-pushed
the
feat/table-trigger-row-deletes
branch
from
August 29, 2026 21:30
36ee470 to
203811b
Compare
j15z
force-pushed
the
feat/table-trigger-row-deletes
branch
from
August 29, 2026 21:38
203811b to
f3bbe0b
Compare
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.
Summary
Table triggers can now start workflows when rows are deleted and receive each deleted row's final values. Delete events are dispatched only after committed single-row, ID-based, filtered, background, and Expiration-cleanup deletions.
This is PR 4 of 4 in the row-expiration stack. It builds on PR #7072 and completes the integration by making automatic Expiration deletions observable through the same Table trigger as manual deletions.
PostgreSQL returns each deleted
{ id, data }snapshot as part of theDELETE, avoiding a racy pre-delete read. Large deletes dispatch byte-bounded snapshot batches after each transaction commits, and trigger matching requires the table's canonical workspace. Dispatch remains best-effort, so a workflow failure cannot roll back a committed deletion. Payloads expose final values throughrow,rawRow, andpreviousRow, with no changed columns.Type of Change
Testing
bun run type-check,bun run lint:check,bun run check:api-validation, andbun run check:migrations origin/stagingpass.Checklist
Screenshots/Videos
No screenshots captured. Trigger configuration tests cover the new Row Deleted option and its payload contract.
Post-Deploy Monitoring & Validation
TableTriggerlogger forFiringdelete events andError in fireTableTrigger.