Skip to content

feat(tables): trigger workflows on row deletes - #7161

Open
j15z wants to merge 3 commits into
refactor/consolidate-timezone-mathfrom
feat/table-trigger-row-deletes
Open

feat(tables): trigger workflows on row deletes#7161
j15z wants to merge 3 commits into
refactor/consolidate-timezone-mathfrom
feat/table-trigger-row-deletes

Conversation

@j15z

@j15z j15z commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Table triggers can now start workflows when rows are deleted and receive the 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.

Trigger dispatch remains fire-and-forget, so a workflow failure cannot roll back a committed deletion. Delete payloads expose the final row data as the previous row and report no changed columns.

Type of Change

  • Bug fix
  • 新建 feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • 75 focused tests pass across trigger configuration, delete payloads, single and bulk deletes, background deletes, and Expiration cleanup.
  • bun run lint:check passes with one pre-existing unrelated suppression warning.
  • bun run apps/sim/scripts/check-block-registry.ts origin/staging, bun run check:audits, and bun run type-check pass.
  • Review focus: every dispatch path must use rows returned by the committed delete, never a pre-delete read that could become stale.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

No screenshots captured. Trigger configuration tests cover the new Row Deleted option and its payload contract.

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment 操作 Updated (UTC)
docs Skipped Skipped Aug 28, 2026 10:57pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds post-commit Row Deleted workflow dispatch using snapshots returned by committed deletes.

  • Supports single-row, ID-based, filtered, background, and TTL-cleanup deletion paths.
  • Adds byte-bounded snapshot batching and exposes deleted values through the trigger payload.
  • Adds the Row Deleted trigger option and focused coverage for dispatch and payload behavior.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

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
Loading

Reviews (2): Last reviewed commit: "fix(tables): bound delete trigger snapsh..." | Re-trigger Greptile

Comment thread apps/sim/lib/table/rows/service.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 11 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread apps/sim/lib/table/delete-runner.ts Outdated
Comment thread apps/sim/lib/table/rows/ordering.ts Outdated
Comment thread apps/sim/lib/table/rows/service.ts Outdated
@j15z

j15z commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z
j15z force-pushed the feat/table-trigger-row-deletes branch from eb3e201 to bd53d8e 比较 August 28, 2026 22:20
@j15z
j15z force-pushed the feat/table-trigger-row-deletes branch from bd53d8e to f5df1cb 比较 August 28, 2026 22:57
注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

1 participant