{"record":{"id":"03cd12bcfd082baa","repo":"FlowiseAI/Flowise","slug":"error-chatflowscontroller-getsinglepublicchatbotc","errorCode":null,"errorMessage":"Error: chatflowsController.getSinglePublicChatbotConfig - id not provided!","messagePattern":"Error: chatflowsController\\.getSinglePublicChatbotConfig - id not provided!","errorType":"exception","errorClass":"InternalFlowiseError","httpStatus":412,"severity":"error","filePath":"packages/server/src/controllers/chatflows/index.ts","lineNumber":262,"sourceCode":"        const workspaceUserService = new WorkspaceUserService()\n        const workspaceUser = await workspaceUserService.readWorkspaceUserByUserId(req.user.id, queryRunner)\n        if (workspaceUser.length === 0)\n            return res.status(StatusCodes.NOT_FOUND).json({ message: WorkspaceUserErrorMessage.WORKSPACE_USER_NOT_FOUND })\n        const workspaceIds = workspaceUser.map((user) => user.workspaceId)\n        if (!workspaceIds.includes(chatflow.workspaceId))\n            return res.status(StatusCodes.BAD_REQUEST).json({ message: 'You are not in the workspace that owns this chatflow' })\n        return res.status(StatusCodes.OK).json(chatflow)\n    } catch (error) {\n        next(error)\n    } finally {\n        if (queryRunner) await queryRunner.release()\n    }\n}\n\nconst getSinglePublicChatbotConfig = async (req: Request, res: Response, next: NextFunction) => {\n    try {\n        if (typeof req.params === 'undefined' || !req.params.id) {\n            throw new InternalFlowiseError(\n                StatusCodes.PRECONDITION_FAILED,\n                `Error: chatflowsController.getSinglePublicChatbotConfig - id not provided!`\n            )\n        }\n        const apiResponse = await chatflowsService.getSinglePublicChatbotConfig(req.params.id)\n        return res.json(apiResponse)\n    } catch (error) {\n        next(error)\n    }\n}\n\nconst checkIfChatflowHasChanged = async (req: Request, res: Response, next: NextFunction) => {\n    try {\n        if (typeof req.params === 'undefined' || !req.params.id) {\n            throw new InternalFlowiseError(\n                StatusCodes.PRECONDITION_FAILED,\n                `Error: chatflowsController.checkIfChatflowHasChanged - id not provided!`\n            )","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/server/src/controllers/chatflows/index.ts#L244-L280","documentation":"Thrown by getSinglePublicChatbotConfig when req.params.id is missing. PRECONDITION_FAILED (412) — first guard before the service call that returns the public chatbot configuration. This endpoint is typically hit by the embedded chatbot widget to load its config.","triggerScenarios":"Widget/config endpoint called without an id segment; embed script given an empty chatflow id.","commonSituations":"Embed snippet installed with a blank chatflow id field; CMS templating left the id empty; SDK version change to the config path.","solutions":["Ensure the embed URL / API call includes a non-empty chatflow id.","Verify the CMS/template actually injects the id value.","Test the embed snippet with a known-good id."],"exampleFix":"// before\nawait api.get(`/api/v1/public-chatbot-config/`)\n// after\nif (!chatflowId) throw new Error('chatflowId required')\nawait api.get(`/api/v1/public-chatbot-config/${chatflowId}`)","handlingStrategy":"validation","validationCode":"if (!chatflowId || typeof chatflowId !== 'string' || chatflowId.length === 0) {\n  throw new Error('chatflow id required to load chatbot config')\n}","typeGuard":"function isNonEmptyId(v: unknown): v is string {\n  return typeof v === 'string' && v.trim().length > 0\n}","tryCatchPattern":null,"preventionTips":["Ensure the CMS/embed template injects a non-empty chatflow id.","Smoke-test the widget config endpoint after deployment.","Fall back to a safe error state in the widget when id is missing."],"tags":["flowise","express","params-validation","precondition","public-endpoint","widget","controller"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}