Skip to content

Commit afc5abd

Browse files
icecrasher321Vikhyath Mondretiwaleedlatif1
committed
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 01eedb3 commit afc5abd

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
@@ -159,15 +159,15 @@ export class WorkflowBlockHandler implements BlockHandler {
159159

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

162-
// Extract the workflow state
162+
// Extract the workflow state (API returns normalized data in state field)
163163
const workflowState = workflowData.state
164164

165165
if (!workflowState || !workflowState.blocks) {
166166
logger.error(`Child workflow ${workflowId} has invalid state`)
167167
return null
168168
}
169169

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

0 commit comments

Comments
 (0)