fix(tables): run workflow groups from deployments - #7240
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThe PR changes table workflow groups to configure and execute exclusively against active deployments, validating persisted mappings before execution.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| 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
Reviews (9): Last reviewed commit: "Merge remote-tracking branch 'origin/sta..." | Re-trigger Greptile
There was a problem hiding this comment.
3 issues found across 4 files
Confidence score: 2/5
apps/sim/scripts/backfill-table-workflow-deployments.tscan abort the entire backfill when a supported enrichment group has noworkflowId, preventing any workflow deployment; allow an emptyworkflowIdwhenenrichmentIdis present while retaining validation for unsupported cases.apps/sim/background/workflow-column-execution.tsfails every cell execution for a newly created or updated table group becauseloadDeployedWorkflowStaterequires an active deployment; reject the group earlier or handle the missing deployment before execution.apps/sim/background/workflow-column-execution.tsmay derivestartBlockfrom 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
0122e51 to
bd546e2
Compare
There was a problem hiding this comment.
2 issues found across 8 files
Confidence score: 2/5
apps/sim/scripts/backfill-table-workflow-deployments.tsaborts backfill when an enrichment group has the intentional emptyworkflowId, preventing subsequent manual groups from being deployed; allow an empty workflow ID fortype: 'enrichment'.apps/sim/background/workflow-column-execution.tscan 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
bd546e2 to
5f75d0b
Compare
There was a problem hiding this comment.
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 toexecuteWorkflowor 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
d146c31 to
66b5951
Compare
…oy-table-workflow
Summary
Type of Change
Testing
bun run lint; bun run check:audits; bun run apps/sim/scripts/check-block-registry.ts origin/staging; focused Vitest suites
Checklist