FlowiseAI/Flowise · error · InternalFlowiseError
Error: assistantsController.updateAssistant - workspace ${wo
Error message
Error: assistantsController.updateAssistant - workspace ${workspaceId} not found! What it means
Thrown by updateAssistant with HTTP 404 after the id and body guards pass, when req.user?.activeWorkspaceId is falsy. The service updateAssistant(id, body, workspaceId) requires a workspace to scope the update.
Source
Thrown at packages/server/src/controllers/assistants/index.ts:123
}
const updateAssistant = async (req: Request, res: Response, next: NextFunction) => {
try {
if (typeof req.params === 'undefined' || !req.params.id) {
throw new InternalFlowiseError(
StatusCodes.PRECONDITION_FAILED,
`Error: assistantsController.updateAssistant - id not provided!`
)
}
if (!req.body) {
throw new InternalFlowiseError(
StatusCodes.PRECONDITION_FAILED,
`Error: assistantsController.updateAssistant - body not provided!`
)
}
const workspaceId = req.user?.activeWorkspaceId
if (!workspaceId) {
throw new InternalFlowiseError(
StatusCodes.NOT_FOUND,
`Error: assistantsController.updateAssistant - workspace ${workspaceId} not found!`
)
}
const apiResponse = await assistantsService.updateAssistant(req.params.id, req.body, workspaceId)
return res.json(apiResponse)
} catch (error) {
next(error)
}
}
const getChatModels = async (req: Request, res: Response, next: NextFunction) => {
try {
const apiResponse = await assistantsService.getChatModels()
return res.json(apiResponse)
} catch (error) {
next(error)
}View on GitHub (pinned to abe4a8601a)
Solutions
- Select/switch into a workspace, then retry the PUT.
- Verify auth middleware populates activeWorkspaceId and workspace membership.
Defensive patterns
Strategy: try-catch
Type guard
const hasActiveWorkspace = (u: unknown): u is { activeWorkspaceId: string } =>
!!u && typeof u === 'object' &&
typeof (u as any).activeWorkspaceId === 'string' &&
(u as any).activeWorkspaceId.length > 0 Try / catch
try {
await updateAssistant(id, payload)
} catch (err) {
if (err?.statusCode === 404 && /workspace .* not found/i.test(err.message)) {
await selectWorkspace()
return updateAssistant(id, payload)
}
throw err
} Prevention
- Ensure a workspace is selected before saving edits.
- Handle workspace 404s with select-then-retry.
- Verify workspace membership for the user.
When it happens
Trigger: Authenticated PUT /api/v1/assistants/<id> with a valid body, from a session with no activeWorkspaceId.
Common situations: Editing an assistant after the session lost its workspace context; user with no workspace membership.
Related errors
- Error: assistantsController.createAssistant - workspace ${wo
- Error: assistantsController.deleteAssistant - workspace ${wo
- Error: assistantsController.getAllAssistants - workspace ${w
- Error: assistantsController.getAssistantById - workspace ${w
- Error: assistantsController.getDocumentStores - workspace ${
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/c5cf31d022991d3a.
Report an issue: GitHub.