{"record":{"id":"0595ba14b7137460","repo":"FlowiseAI/Flowise","slug":"error-chatflowscontroller-updatechatflow-id-not","errorCode":null,"errorMessage":"Error: chatflowsController.updateChatflow - id not provided!","messagePattern":"Error: chatflowsController\\.updateChatflow - id not provided!","errorType":"exception","errorClass":"InternalFlowiseError","httpStatus":412,"severity":"error","filePath":"packages/server/src/controllers/chatflows/index.ts","lineNumber":193,"sourceCode":"        newChatFlow.workspaceId = workspaceId\n        const apiResponse = await chatflowsService.saveChatflow(\n            newChatFlow,\n            orgId,\n            workspaceId,\n            subscriptionId,\n            getRunningExpressApp().usageCacheManager\n        )\n\n        return res.json(apiResponse)\n    } catch (error) {\n        next(error)\n    }\n}\n\nconst updateChatflow = async (req: Request, res: Response, next: NextFunction) => {\n    try {\n        if (typeof req.params === 'undefined' || !req.params.id) {\n            throw new InternalFlowiseError(StatusCodes.PRECONDITION_FAILED, `Error: chatflowsController.updateChatflow - id not provided!`)\n        }\n        const workspaceId = req.user?.activeWorkspaceId\n        if (!workspaceId) {\n            throw new InternalFlowiseError(\n                StatusCodes.NOT_FOUND,\n                `Error: chatflowsController.saveChatflow - workspace ${workspaceId} not found!`\n            )\n        }\n        const chatflow = await chatflowsService.getChatflowById(req.params.id, workspaceId)\n        if (!chatflow) {\n            return res.status(404).send('Chatflow not found')\n        }\n        const orgId = req.user?.activeOrganizationId\n        if (!orgId) {\n            throw new InternalFlowiseError(\n                StatusCodes.NOT_FOUND,\n                `Error: chatflowsController.saveChatflow - organization ${orgId} not found!`\n            )","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/server/src/controllers/chatflows/index.ts#L175-L211","documentation":"Thrown by updateChatflow when req.params.id is missing. PRECONDITION_FAILED (412) — the first guard before workspace/org/lookup checks. Pure missing-route-param rejection.","triggerScenarios":"PUT/PATCH/POST update endpoint called without an id segment in the URL; client used an undefined id variable.","commonSituations":"Frontend update fired before a chatflow was selected; SDK path change; proxy dropped the segment.","solutions":["Ensure the request URL has a non-empty id.","Guard the client call against undefined id.","Match client path to server route param name."],"exampleFix":"// before\nawait api.put(`/api/v1/chatflows/${row?.id}`, patch)\n// after\nif (!row?.id) throw new Error('select a chatflow to update')\nawait api.put(`/api/v1/chatflows/${row.id}`, patch)","handlingStrategy":"validation","validationCode":"if (!id || typeof id !== 'string' || id.length === 0) {\n  throw new Error('chatflow id required to update')\n}","typeGuard":"function isNonEmptyId(v: unknown): v is string {\n  return typeof v === 'string' && v.trim().length > 0\n}","tryCatchPattern":null,"preventionTips":["Disable update UI until a chatflow is selected.","Guard the client call against undefined id.","Verify route path matches the SDK."],"tags":["flowise","express","params-validation","precondition","controller","update"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}