Skip to content

feat(table): add workflow execution column type#4338

Merged
TheodoreSpeaks merged 39 commits intostagingfrom
feat/table-trigger
May 2, 2026
Merged

feat(table): add workflow execution column type#4338
TheodoreSpeaks merged 39 commits intostagingfrom
feat/table-trigger

Conversation

@TheodoreSpeaks
Copy link
Copy Markdown
Collaborator

@TheodoreSpeaks TheodoreSpeaks commented Apr 29, 2026

Summary

Adds sim workflow as a datatype to tables. Now you can auto trigger workflows per row.

  • Workflow is now a column type. You can choose which block outputs display as columns
  • Added ui to trigger per row or per column
  • Added dependency tracking to check for cells being filled before proceeding
  • Added table trigger block
  • Adjusted cells so double click on long content opens a bigger cell window
  • Added mothership types so it can call it too.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • Tested locally

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

image

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 2, 2026 6:58pm

Request Review

@TheodoreSpeaks TheodoreSpeaks changed the title Feat/table trigger feat(table): add workflow execution column type Apr 29, 2026
@TheodoreSpeaks
Copy link
Copy Markdown
Collaborator Author

@BugBot review

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 30, 2026

PR Summary

Medium Risk
Adds new table workflow-group APIs/UI and introduces new realtime table rooms + HTTP bridge events; errors in permission checks, room cleanup, or payload shapes could impact data visibility and live-update behavior.

Overview
Enables tables to treat workflows as a first-class column type by introducing workflow groups that expand into multiple output columns with dependency/run configuration, plus UI to configure outputs, run groups/rows, and improve cell editing (inline editors + expanded popover).

Adds new table API routes to create/update/delete workflow groups, trigger/cancel runs, and rerun a workflow group for a single row (including clearing outputs and setting execution state). Table row queries/responses now include executions, and column normalization/table detail responses surface workflowGroupId/workflowGroups.

Extends Realtime with table:${tableId} Socket.IO rooms (join-table/leave-table with workspace-permission checks) and an internal HTTP bridge to broadcast table-row-updated/table-row-deleted/table-deleted events, including socket ejection on table deletion for both memory and Redis room managers.

Reviewed by Cursor Bugbot for commit c03edf9. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table/table.tsx Outdated
@TheodoreSpeaks TheodoreSpeaks marked this pull request as ready for review May 1, 2026 09:47
@TheodoreSpeaks
Copy link
Copy Markdown
Collaborator Author

@greptile review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 1, 2026

Greptile Summary

This PR introduces a first-class "workflow execution column" type for tables: each row can auto-trigger a configured workflow, with live partial-output streaming, dependency ordering between groups, and cancellation support backed by a SQL guard. The feature spans a new DB column (executions jsonb), trigger.dev cell tasks, socket-based realtime merging, and several new API routes.

  • P1 – silent false-success on cancelled run: POST /api/table/[tableId]/rows/[rowId]/run-workflow-group ignores the nullable updateRow return. When the SQL cancellation guard fires, the route still returns 200 { success: true, executionId } with no run actually enqueued, leaving the client polling indefinitely.
  • P2 – debug logging in production: 8 [STOP-DEBUG]-tagged logger.info calls remain across service.ts, workflow-columns.ts, and hooks/queries/tables.ts; they emit verbose per-row JSON on every write and cancel scan.

Confidence Score: 3/5

The P1 false-success response on a guard-rejected run should be fixed before merging to avoid silent polling loops in the UI.

One P1 (null return not handled in run-workflow-group route) pushes the score below the P1 ceiling of 4; the additional leftover debug logging and unguarded cancel query further lower confidence in production readiness.

apps/sim/app/api/table/[tableId]/rows/[rowId]/run-workflow-group/route.ts (null return), apps/sim/lib/table/service.ts and apps/sim/hooks/queries/tables.ts (debug logging), apps/sim/lib/table/workflow-columns.ts (cancel query scope)

Important Files Changed

Filename Overview
apps/sim/lib/table/service.ts Core table service expanded with workflow group CRUD, execution scheduling, realtime socket notifications, and cancellation guard logic; contains leftover [STOP-DEBUG] log statements and the updateRow null return must be handled by callers
apps/sim/lib/table/workflow-columns.ts New scheduler/trigger/cancel orchestration for workflow-group cell jobs; per-row cancel query is missing a tableId filter and contains a [STOP-DEBUG] log
apps/sim/app/api/table/[tableId]/rows/[rowId]/run-workflow-group/route.ts New route to manually (re-)run a workflow group for a single row; discards the nullable updateRow return, so a cancellation-guard rejection returns a false-success 200 response
apps/sim/background/workflow-column-execution.ts New trigger.dev task that runs a single workflow-group cell, writes partial block outputs live, and handles cancellation guards correctly via writeWorkflowGroupState
apps/sim/lib/table/cell-write.ts New shared primitive for writing group execution state with cancellation-guard awareness; clean implementation
apps/sim/hooks/queries/tables.ts Extended with socket-based realtime row delta merging, polling fallback, and new workflow-group mutation hooks; contains 4 leftover [STOP-DEBUG] log statements
packages/db/schema.ts Adds executions jsonb NOT NULL DEFAULT '{}' column to user_table_rows; migration is present and correctly structured
apps/sim/app/api/table/[tableId]/groups/route.ts New POST/PATCH/DELETE handlers for workflow groups; auth + workspace checks are consistent across all three methods
apps/sim/lib/table/trigger.ts New direct webhook trigger firing for insert/update row events; fire-and-forget pattern with proper error isolation

Reviews (1): Last reviewed commit: "ui improvements" | Re-trigger Greptile

Comment thread apps/sim/lib/table/service.ts Outdated
Comment thread apps/sim/lib/table/workflow-columns.ts
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7cad96e. Configure here.

@TheodoreSpeaks TheodoreSpeaks merged commit 31cfb74 into staging May 2, 2026
14 checks passed
@TheodoreSpeaks TheodoreSpeaks deleted the feat/table-trigger branch May 2, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant