{"record":{"id":"a76307b61fc96b16","repo":"FlowiseAI/Flowise","slug":"error-chatflowscontroller-deletechatflow-id-not","errorCode":null,"errorMessage":"Error: chatflowsController.deleteChatflow - id not provided!","messagePattern":"Error: chatflowsController\\.deleteChatflow - id not provided!","errorType":"exception","errorClass":"InternalFlowiseError","httpStatus":412,"severity":"error","filePath":"packages/server/src/controllers/chatflows/index.ts","lineNumber":53,"sourceCode":"const checkIfChatflowIsValidForUploads = 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.checkIfChatflowIsValidForUploads - id not provided!`\n            )\n        }\n        const apiResponse = await chatflowsService.checkIfChatflowIsValidForUploads(req.params.id)\n        return res.json(apiResponse)\n    } catch (error) {\n        next(error)\n    }\n}\n\nconst deleteChatflow = 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.deleteChatflow - id not provided!`)\n        }\n        const orgId = req.user?.activeOrganizationId\n        if (!orgId) {\n            throw new InternalFlowiseError(\n                StatusCodes.NOT_FOUND,\n                `Error: chatflowsController.deleteChatflow - organization ${orgId} not found!`\n            )\n        }\n        const workspaceId = req.user?.activeWorkspaceId\n        if (!workspaceId) {\n            throw new InternalFlowiseError(\n                StatusCodes.NOT_FOUND,\n                `Error: chatflowsController.deleteChatflow - workspace ${workspaceId} not found!`\n            )\n        }\n        const userPermittedTypes: EnumChatflowType[] = []\n        const permissions = req.user!.permissions\n        if (req.user?.isOrganizationAdmin) {","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/server/src/controllers/chatflows/index.ts#L35-L71","documentation":"Thrown by deleteChatflow when req.params.id is undefined or empty. First guard in the handler, returns PRECONDITION_FAILED (412). It precedes the org/workspace/permission checks, so hitting it means the request never even reached authorization logic.","triggerScenarios":"DELETE /api/v1/chatflows/:id issued without an id segment; client sent DELETE to the collection root; id variable undefined in the calling code.","commonSituations":"UI delete button clicked before a row was selected; client built URL from a null field; SDK version mismatch on the delete endpoint path.","solutions":["Confirm the DELETE target URL has a non-empty id.","Guard the client-side call: only invoke when an id is selected.","Verify route definition and client path agree on param naming."],"exampleFix":"// before\nawait api.delete(`/api/v1/chatflows/${selected?.id}`)\n// after\nif (!selected?.id) throw new Error('select a chatflow to delete')\nawait api.delete(`/api/v1/chatflows/${selected.id}`)","handlingStrategy":"validation","validationCode":"if (!selected?.id) {\n  throw new Error('select a chatflow before attempting delete')\n}","typeGuard":"function hasSelectedChatflow(s: unknown): s is { id: string } {\n  return typeof s === 'object' && s !== null && typeof (s as any).id === 'string' && (s as any).id.length > 0\n}","tryCatchPattern":null,"preventionTips":["Disable the delete button until a row is selected.","Run a client guard on the selected id before issuing DELETE.","Confirm route path matches the SDK in use."],"tags":["flowise","express","params-validation","precondition","controller","delete"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}