FlowiseAI/Flowise · error · InternalFlowiseError

Error: chatflowsController.deleteChatflow - id not provided!

Error message

Error: chatflowsController.deleteChatflow - id not provided!

What it means

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.

Source

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

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

const deleteChatflow = async (req: Request, res: Response, next: NextFunction) => {
    try {
        if (typeof req.params === 'undefined' || !req.params.id) {
            throw new InternalFlowiseError(StatusCodes.PRECONDITION_FAILED, `Error: chatflowsController.deleteChatflow - id not provided!`)
        }
        const orgId = req.user?.activeOrganizationId
        if (!orgId) {
            throw new InternalFlowiseError(
                StatusCodes.NOT_FOUND,
                `Error: chatflowsController.deleteChatflow - organization ${orgId} not found!`
            )
        }
        const workspaceId = req.user?.activeWorkspaceId
        if (!workspaceId) {
            throw new InternalFlowiseError(
                StatusCodes.NOT_FOUND,
                `Error: chatflowsController.deleteChatflow - workspace ${workspaceId} not found!`
            )
        }
        const userPermittedTypes: EnumChatflowType[] = []
        const permissions = req.user!.permissions
        if (req.user?.isOrganizationAdmin) {

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Confirm the DELETE target URL has a non-empty id.
  2. Guard the client-side call: only invoke when an id is selected.
  3. Verify route definition and client path agree on param naming.

Example fix

// before
await api.delete(`/api/v1/chatflows/${selected?.id}`)
// after
if (!selected?.id) throw new Error('select a chatflow to delete')
await api.delete(`/api/v1/chatflows/${selected.id}`)
Defensive patterns

Strategy: validation

Validate before calling

if (!selected?.id) {
  throw new Error('select a chatflow before attempting delete')
}

Type guard

function hasSelectedChatflow(s: unknown): s is { id: string } {
  return typeof s === 'object' && s !== null && typeof (s as any).id === 'string' && (s as any).id.length > 0
}

Prevention

When it happens

Trigger: DELETE /api/v1/chatflows/:id issued without an id segment; client sent DELETE to the collection root; id variable undefined in the calling code.

Common situations: UI delete button clicked before a row was selected; client built URL from a null field; SDK version mismatch on the delete endpoint path.

Related errors


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