Skip to content

Commit 6cfcd5e

Browse files
icecrasher321Vikhyath Mondretiwaleedlatif1
authored andcommitted
fix(remove workflow.state usage): no more usage of deprecated state column in any routes (#586)
* fix(remove workflow.state usage): no more usage of deprecated state col in routes * fix lint * fix chat route to only use deployed state * fix lint * better typing * remove useless logs * fix lint * restore workflow handler file * removed all other usages of deprecated 'state' column from workflows table, updated tests --------- Co-authored-by: Vikhyath Mondreti <vikhyathmondreti@Vikhyaths-MacBook-Air.local> Co-authored-by: Waleed Latif <walif6@gmail.com>
1 parent f671b42 commit 6cfcd5e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apps/sim/app/api/workflows/[id]/deploy/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
139139
return createErrorResponse(validation.error.message, validation.error.status)
140140
}
141141

142-
// Get the workflow to find the user
142+
// Get the workflow to find the user (removed deprecated state column)
143143
const workflowData = await db
144144
.select({
145145
userId: workflow.userId,

apps/sim/executor/handlers/workflow/workflow-handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ export class WorkflowBlockHandler implements BlockHandler {
163163

164164
logger.info(`Loaded child workflow: ${workflowData.name} (${workflowId})`)
165165

166-
// Extract the workflow state
166+
// Extract the workflow state (API returns normalized data in state field)
167167
const workflowState = workflowData.state
168168

169169
if (!workflowState || !workflowState.blocks) {
170170
logger.error(`Child workflow ${workflowId} has invalid state`)
171171
return null
172172
}
173173

174-
// Use blocks directly since DB format should match UI format
174+
// Use blocks directly since API returns data from normalized tables
175175
const serializedWorkflow = this.serializer.serializeWorkflow(
176176
workflowState.blocks,
177177
workflowState.edges || [],

0 commit comments

Comments
 (0)