{"record":{"id":"dcc18304d11b6f76","repo":"FlowiseAI/Flowise","slug":"error-chatflowscontroller-checkifchatflowisvalidf","errorCode":null,"errorMessage":"Error: chatflowsController.checkIfChatflowIsValidForStreaming - id not provided!","messagePattern":"Error: chatflowsController\\.checkIfChatflowIsValidForStreaming - id not provided!","errorType":"exception","errorClass":"InternalFlowiseError","httpStatus":412,"severity":"error","filePath":"packages/server/src/controllers/chatflows/index.ts","lineNumber":23,"sourceCode":"import { WorkspaceUserErrorMessage, WorkspaceUserService } from '../../enterprise/services/workspace-user.service'\nimport { InternalFlowiseError } from '../../errors/internalFlowiseError'\nimport { ChatflowType } from '../../Interface'\nimport { ScheduleBeat } from '../../schedule/ScheduleBeat'\nimport apiKeyService from '../../services/apikey'\nimport chatflowsService from '../../services/chatflows'\nimport scheduleService from '../../services/schedule'\nimport { GeneralErrorMessage } from '../../utils/constants'\nimport { getRunningExpressApp } from '../../utils/getRunningExpressApp'\nimport { getPageAndLimitParams } from '../../utils/pagination'\nimport { checkUsageLimit } from '../../utils/quotaUsage'\nimport { RateLimiterManager } from '../../utils/rateLimit'\nimport { sanitizeFlowDataForPublicEndpoint } from '../../utils/sanitizeFlowData'\nimport { stripProtectedFields } from '../../utils/stripProtectedFields'\n\nconst checkIfChatflowIsValidForStreaming = 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.checkIfChatflowIsValidForStreaming - id not provided!`\n            )\n        }\n        const apiResponse = await chatflowsService.checkIfChatflowIsValidForStreaming(req.params.id)\n        return res.json(apiResponse)\n    } catch (error) {\n        next(error)\n    }\n}\n\nconst 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            )","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/server/src/controllers/chatflows/index.ts#L5-L41","documentation":"Thrown by checkIfChatflowIsValidForStreaming when req.params.id is undefined or empty. It is a guard at the top of the handler returning PRECONDITION_FAILED (412). No auth/workspace context is required for this check — only the route parameter.","triggerScenarios":"GET /api/v1/chatflows/:id/valid-for-streaming called without a real id segment, or with the id path param named differently (e.g. :chatflowId) than the controller reads.","commonSituations":"Client builds the URL with an undefined chatflowId variable; route renamed in a server version but client SDK not updated; copy-paste from a different endpoint that uses a different param name.","solutions":["Verify the request URL has a non-empty id segment.","Confirm client variable feeding the URL is defined before the call.","Check the route registration file uses param name `id` matching the controller."],"exampleFix":"// before\nawait api.get(`/api/v1/chatflows/${undefined}/valid-for-streaming`)\n// after\nif (!chatflowId) throw new Error('chatflowId required')\nawait api.get(`/api/v1/chatflows/${chatflowId}/valid-for-streaming`)","handlingStrategy":"validation","validationCode":"if (!id || typeof id !== 'string' || id.length === 0) {\n  throw new Error('chatflow id required before checking streaming validity')\n}","typeGuard":"function isNonEmptyId(v: unknown): v is string {\n  return typeof v === 'string' && v.trim().length > 0\n}","tryCatchPattern":null,"preventionTips":["Gate every endpoint call behind a non-empty id check.","Keep a typed wrapper for each chatflow endpoint that asserts the id first.","Confirm route param names match the controller when upgrading Flowise."],"tags":["flowise","express","params-validation","precondition","controller"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}