Skip to content

fix(tables): run workflow groups from deployments - #7240

Merged
TheodoreSpeaks merged 15 commits into
stagingfrom
feat/backfill-deploy-table-workflow
Aug 31, 2026
Merged

fix(tables): run workflow groups from deployments#7240
TheodoreSpeaks merged 15 commits into
stagingfrom
feat/backfill-deploy-table-workflow

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Always execute table workflow groups against the latest active deployment and remove the live/deployed sidebar choice
  • Deny table workflow group creation or rebinding when the workflow has no active deployment
  • Add a resumable TypeScript backfill for active workflows referenced by existing table groups while skipping archived or undeployable workflows

Type of Change

  • Bug fix

Testing

bun run lint; bun run check:audits; bun run apps/sim/scripts/check-block-registry.ts origin/staging; focused Vitest suites

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

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 31, 2026 6:10pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR changes table workflow groups to configure and execute exclusively against active deployments, validating persisted mappings before execution.

  • Loads one deployed workflow snapshot for mapping validation and execution.
  • Restricts sidebar and server-side group configuration to deployed workflow state.
  • Adds a resumable backfill for active workflows referenced by table groups.
  • Normalizes deployment-lock error codes and expands focused coverage.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/background/workflow-column-execution.ts Loads and validates the latest active deployment, then passes the same immutable graph and variables into execution.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/workflow-sidebar/workflow-sidebar.tsx Removes the live/deployed selector and configures mappings from deployed workflow state.
apps/sim/lib/table/application/groups.ts Resolves and validates table workflow group mappings against active deployments.
apps/sim/lib/workflows/application/resolve-workflow-outputs.ts Adds deployed-state output resolution with explicit missing-deployment validation.
apps/sim/lib/workflows/executor/execute-workflow.ts Forwards a trusted workflow-state override and its deployed variables into the execution snapshot.
apps/sim/scripts/backfill-table-workflow-deployments.ts Adds bounded, resumable deployment backfill behavior for eligible table-referenced workflows.

Sequence Diagram

sequenceDiagram
  participant U as Table configuration
  participant G as Group service
  participant D as Active deployment
  participant W as Cell worker
  participant E as Workflow executor
  U->>D: Load deployed inputs and outputs
  U->>G: Save validated mappings
  W->>D: Load latest active deployment
  W->>W: Validate saved mappings
  W->>E: Execute with immutable state override
  E-->>W: Return deployed-workflow outputs
Loading

Reviews (9): Last reviewed commit: "Merge remote-tracking branch 'origin/sta..." | Re-trigger Greptile

Comment thread apps/sim/background/workflow-column-execution.ts
Comment thread apps/sim/background/workflow-column-execution.ts

@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.

3 issues found across 4 files

Confidence score: 2/5

  • apps/sim/scripts/backfill-table-workflow-deployments.ts can abort the entire backfill when a supported enrichment group has no workflowId, preventing any workflow deployment; allow an empty workflowId when enrichmentId is present while retaining validation for unsupported cases.
  • apps/sim/background/workflow-column-execution.ts fails every cell execution for a newly created or updated table group because loadDeployedWorkflowState requires an active deployment; reject the group earlier or handle the missing deployment before execution.
  • apps/sim/background/workflow-column-execution.ts may derive startBlock from one deployment version while executing another during cutover, causing inconsistent workflow behavior; retain the loaded deployment version or pass the loaded state through execution.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/scripts/backfill-table-workflow-deployments.ts">

<violation number="1" location="apps/sim/scripts/backfill-table-workflow-deployments.ts:118">
P1: When any table contains a supported enrichment group, this condition aborts the entire backfill before deploying any workflow. Allow an empty `workflowId` when the group has a non-empty `enrichmentId`, while still rejecting empty workflow groups without an enrichment source.</violation>
</file>

<file name="apps/sim/background/workflow-column-execution.ts">

<violation number="1" location="apps/sim/background/workflow-column-execution.ts:692">
P1: Reject or deploy workflows when a table group is created or updated before this worker runs. `loadDeployedWorkflowState` throws for workflows without an active deployment, so every cell execution for the new group fails.</violation>

<violation number="2" location="apps/sim/background/workflow-column-execution.ts:995">
P2: During a deployment cutover, this preflight can select `startBlock` from one version while `executeWorkflow` executes another version. Retain the loaded deployment version or pass the loaded state through execution so trigger selection and execution use the same snapshot.</violation>
</file>

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

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/scripts/backfill-table-workflow-deployments.ts Outdated
Comment thread apps/sim/background/workflow-column-execution.ts
Comment thread apps/sim/background/workflow-column-execution.ts
@TheodoreSpeaks
TheodoreSpeaks force-pushed the feat/backfill-deploy-table-workflow branch from 0122e51 to bd546e2 Compare August 28, 2026 23:53
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@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.

2 issues found across 8 files

Confidence score: 2/5

  • apps/sim/scripts/backfill-table-workflow-deployments.ts aborts backfill when an enrichment group has the intentional empty workflowId, preventing subsequent manual groups from being deployed; allow an empty workflow ID for type: 'enrichment'.
  • apps/sim/background/workflow-column-execution.ts can execute a deployed graph with the current workflow row’s variables instead of the deployment’s frozen variables, causing runs to use inconsistent configuration; pass variables from the same active deployment.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/background/workflow-column-execution.ts">

<violation number="1" location="apps/sim/background/workflow-column-execution.ts:995">
P1: When deployed variables differ from the current workflow row, this setting runs the deployed graph with `workflowRecord.variables` instead of the active deployment’s frozen variables. Pass the variables from the same deployed snapshot to the executor, preserving graph and variable consistency.</violation>
</file>

<file name="apps/sim/scripts/backfill-table-workflow-deployments.ts">

<violation number="1" location="apps/sim/scripts/backfill-table-workflow-deployments.ts:118">
P1: When any table contains an enrichment group, this backfill aborts before deploying manual groups because enrichment groups intentionally store `workflowId: ''`. Allow an empty workflow ID for `type: 'enrichment'` while continuing to reject it for manual groups.</violation>
</file>

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

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/background/workflow-column-execution.ts
Comment thread apps/sim/scripts/backfill-table-workflow-deployments.ts Outdated
@TheodoreSpeaks
TheodoreSpeaks force-pushed the feat/backfill-deploy-table-workflow branch from bd546e2 to 5f75d0b Compare August 28, 2026 23:59
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@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.

1 issue found across 10 files

Confidence score: 3/5

  • In apps/sim/background/workflow-column-execution.ts, changed workflow variables can cause table cells to execute the deployed graph with draft values, producing incorrect execution results; pass the deployed variables to executeWorkflow or extend the trusted override to keep graph and variables consistent.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/background/workflow-column-execution.ts">

<violation number="1" location="apps/sim/background/workflow-column-execution.ts:996">
P2: When workflow variables change after deployment, table cells run the deployed graph with draft variable values. Pass the deployed variables into the `executeWorkflow` workflow argument, or extend the trusted override path to carry them, so the entire table execution uses one deployment snapshot.</violation>
</file>

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

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/background/workflow-column-execution.ts
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

Comment thread apps/sim/background/workflow-column-execution.ts
@TheodoreSpeaks
TheodoreSpeaks force-pushed the feat/backfill-deploy-table-workflow branch from d146c31 to 66b5951 Compare August 29, 2026 00:21
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

Comment thread apps/sim/background/workflow-column-execution.ts Outdated
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@github-actions github-actions Bot added requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep and removed requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep labels Aug 31, 2026
@TheodoreSpeaks
TheodoreSpeaks merged commit eefbb20 into staging Aug 31, 2026
28 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/backfill-deploy-table-workflow branch September 1, 2026 00:36
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