diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx index bc76f0429b..107c30ae28 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx @@ -1837,7 +1837,7 @@ const WorkflowContent = React.memo(() => { }, [collaborativeSetSubblockValue]) // Show skeleton UI while loading until the workflow store is hydrated - const showSkeletonUI = !isWorkflowReady || typeof lastSaved !== 'number' + const showSkeletonUI = !isWorkflowReady if (showSkeletonUI) { return ( @@ -1942,10 +1942,9 @@ const WorkflowContent = React.memo(() => { /> {/* Trigger list for empty workflows - only show after workflow has loaded and hydrated */} - {isWorkflowReady && - typeof lastSaved === 'number' && - isWorkflowEmpty && - effectivePermissions.canEdit && } + {isWorkflowReady && isWorkflowEmpty && effectivePermissions.canEdit && ( + + )} ) diff --git a/apps/sim/lib/copilot/tools/server/workflow/build-workflow.ts b/apps/sim/lib/copilot/tools/server/workflow/build-workflow.ts index 6842226bf4..3124ea63c9 100644 --- a/apps/sim/lib/copilot/tools/server/workflow/build-workflow.ts +++ b/apps/sim/lib/copilot/tools/server/workflow/build-workflow.ts @@ -96,44 +96,6 @@ export const buildWorkflowServerTool: BaseServerTool< // Use sanitized state if available const finalWorkflowState = validation.sanitizedState || workflowState - // Apply positions using smart layout - const positionResponse = await fetch(`${SIM_AGENT_API_URL}/api/yaml/apply-layout`, { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ - workflowState: finalWorkflowState, - options: { - strategy: 'smart', - direction: 'auto', - spacing: { - horizontal: 500, - vertical: 400, - layer: 700, - }, - alignment: 'center', - padding: { - x: 250, - y: 250, - }, - }, - }), - }) - - if (!positionResponse.ok) { - const errorText = await positionResponse.text().catch(() => '') - logger.warn('Failed to apply layout to workflow', { - status: positionResponse.status, - error: errorText, - }) - // Non-critical error - continue with unpositioned workflow - } else { - const layoutResult = await positionResponse.json() - if (layoutResult.success && layoutResult.workflowState) { - // Update the workflow state with positioned blocks - Object.assign(finalWorkflowState, layoutResult.workflowState) - } - } - return { success: true, workflowState: finalWorkflowState,