fix(tables): run workflow groups from deployments - #7240
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR moves table workflow groups from editable draft state to the latest active deployment and validates 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 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
Reviews (8): Last reviewed commit: "fix(tables): resolve canonical workflow ..." | 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
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 (14 tests)
Checklist