FlowiseAI/Flowise · error · InternalFlowiseError

Error: chatflowsController.updateChatflow - id not provided!

Error message

Error: chatflowsController.updateChatflow - id not provided!

What it means

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.

Source

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

        newChatFlow.workspaceId = workspaceId
        const apiResponse = await chatflowsService.saveChatflow(
            newChatFlow,
            orgId,
            workspaceId,
            subscriptionId,
            getRunningExpressApp().usageCacheManager
        )

        return res.json(apiResponse)
    } catch (error) {
        next(error)
    }
}

const updateChatflow = async (req: Request, res: Response, next: NextFunction) => {
    try {
        if (typeof req.params === 'undefined' || !req.params.id) {
            throw new InternalFlowiseError(StatusCodes.PRECONDITION_FAILED, `Error: chatflowsController.updateChatflow - id not provided!`)
        }
        const workspaceId = req.user?.activeWorkspaceId
        if (!workspaceId) {
            throw new InternalFlowiseError(
                StatusCodes.NOT_FOUND,
                `Error: chatflowsController.saveChatflow - workspace ${workspaceId} not found!`
            )
        }
        const chatflow = await chatflowsService.getChatflowById(req.params.id, workspaceId)
        if (!chatflow) {
            return res.status(404).send('Chatflow not found')
        }
        const orgId = req.user?.activeOrganizationId
        if (!orgId) {
            throw new InternalFlowiseError(
                StatusCodes.NOT_FOUND,
                `Error: chatflowsController.saveChatflow - organization ${orgId} not found!`
            )

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Ensure 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.put(`/api/v1/chatflows/${row?.id}`, patch)
// after
if (!row?.id) throw new Error('select a chatflow to update')
await api.put(`/api/v1/chatflows/${row.id}`, patch)
Defensive patterns

Strategy: validation

Validate before calling

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

Type guard

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

Prevention

When it happens

Trigger: PUT/PATCH/POST update endpoint called without an id segment in the URL; client used an undefined id variable.

Common situations: Frontend update fired before a chatflow was selected; SDK path change; proxy dropped the segment.

Related errors


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