Skip to content

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

Open
TheodoreSpeaks wants to merge 13 commits into
stagingfrom
feat/backfill-deploy-table-workflow
Open

fix(tables): run workflow groups from deployments#7240
TheodoreSpeaks wants to merge 13 commits into
stagingfrom
feat/backfill-deploy-table-workflow

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • Always execute table workflow groups against the latest active deployment and remove the live/deployed sidebar choice
  • Add a resumable TypeScript backfill for active workflows referenced by table groups while skipping archived 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 (14 tests)

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)

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 29, 2026 9:17pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR moves table workflow groups from editable draft state to the latest active deployment and validates persisted mappings before execution.

  • Removes the live/deployed workflow choice and configures groups from deployed workflow state.
  • Resolves table execution through the canonical manual-start trigger logic, including supported split and legacy start forms.
  • Adds a resumable backfill for referenced active workflows and focused deployment-mapping 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 active deployment state, validates mappings, and consistently resolves and executes the canonical manual start candidate.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/workflow-sidebar/workflow-sidebar.tsx Removes draft/deployed selection and derives workflow configuration from active deployment state.
apps/sim/lib/table/workflow-groups/service.ts Adds server-side deployment consistency checks around workflow-group mutations.
apps/sim/lib/workflows/application/resolve-workflow-outputs.ts Resolves table workflow outputs against deployed workflow state.
apps/sim/lib/workflows/executor/execute-workflow.ts Supports an explicit deployed workflow-state override through the shared execution path.
apps/sim/scripts/backfill-table-workflow-deployments.ts Adds bounded, resumable processing for active workflows referenced by table groups while excluding archived workflows.

Sequence Diagram

sequenceDiagram
  participant Table as Table group
  participant Worker as Table worker
  participant Deploy as Active deployment
  participant Resolver as Trigger resolver
  participant Executor as Workflow executor
  Table->>Worker: Run workflow-backed cell
  Worker->>Deploy: Load latest active state
  Deploy-->>Worker: Graph and variables
  Worker->>Resolver: Resolve canonical manual start
  Resolver-->>Worker: Start candidate
  Worker->>Worker: Validate saved input/output mappings
  Worker->>Executor: Execute deployed graph from candidate
  Executor-->>Table: Persist progress and outputs
Loading

Reviews (8): Last reviewed commit: "fix(tables): resolve canonical workflow ..." | 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

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