FlowiseAI/Flowise · error · InternalFlowiseError

Error: chatflowsController.getChatflowById - id not provided

Error message

Error: chatflowsController.getChatflowById - id not provided!

What it means

Thrown by getChatflowById when req.params.id is missing. First guard in the handler, returns PRECONDITION_FAILED (412). Precedes the workspace check, so reaching it means the id was absent before authorization context was even examined.

Source

Thrown at packages/server/src/controllers/chatflows/index.ts:130

                StatusCodes.PRECONDITION_FAILED,
                `Error: chatflowsController.getChatflowByApiKey - apikey not provided!`
            )
        }
        const apikey = await apiKeyService.getApiKey(req.params.apikey)
        if (!apikey) {
            return res.status(401).send('Unauthorized')
        }
        const apiResponse = await chatflowsService.getChatflowByApiKey(apikey.id, apikey.workspaceId, req.query.keyonly)
        return res.json(apiResponse)
    } catch (error) {
        next(error)
    }
}

const getChatflowById = async (req: Request, res: Response, next: NextFunction) => {
    try {
        if (typeof req.params === 'undefined' || !req.params.id) {
            throw new InternalFlowiseError(StatusCodes.PRECONDITION_FAILED, `Error: chatflowsController.getChatflowById - id not provided!`)
        }
        const workspaceId = req.user?.activeWorkspaceId
        if (!workspaceId) {
            throw new InternalFlowiseError(
                StatusCodes.NOT_FOUND,
                `Error: chatflowsController.getChatflowById - workspace ${workspaceId} not found!`
            )
        }
        const apiResponse = await chatflowsService.getChatflowById(req.params.id, workspaceId)
        return res.json(apiResponse)
    } catch (error) {
        next(error)
    }
}

const saveChatflow = async (req: Request, res: Response, next: NextFunction) => {
    try {
        if (!req.body) {

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Confirm the request URL has a non-empty id.
  2. Guard the client call against undefined id.
  3. Match client path to server route param name.

Example fix

// before
await api.get(`/api/v1/chatflows/${row?.id}`)
// after
if (!row?.id) throw new Error('row id required')
await api.get(`/api/v1/chatflows/${row.id}`)
Defensive patterns

Strategy: validation

Validate before calling

if (!id || typeof id !== 'string' || id.length === 0) {
  throw new Error('chatflow id required')
}

Type guard

function isNonEmptyId(v: unknown): v is string {
  return typeof v === 'string' && v.trim().length > 0
}

Prevention

When it happens

Trigger: GET /api/v1/chatflows/:id called without an id segment; id variable undefined in client; route param name mismatch.

Common situations: Frontend navigates to detail route before an id is selected; SDK path change; proxy strip of the segment.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/6b43d2ea1c8b8db8. Report an issue: GitHub.