FlowiseAI/Flowise · error · InternalFlowiseError
Error: assistantsController.getAllAssistants - workspace ${w
Error message
Error: assistantsController.getAllAssistants - workspace ${workspaceId} not found! What it means
Thrown by getAllAssistants with HTTP 404 when req.user?.activeWorkspaceId is falsy. Mounted at GET /api/v1/assistants (routes/assistants/index.ts:11). Because assistants are workspace-scoped, listing requires an active workspace; note this handler reads req.query.type before the workspace check, but that read is side-effect-free and does not change the outcome.
Source
Thrown at packages/server/src/controllers/assistants/index.ts:73
if (!workspaceId) {
throw new InternalFlowiseError(
StatusCodes.NOT_FOUND,
`Error: assistantsController.deleteAssistant - workspace ${workspaceId} not found!`
)
}
const apiResponse = await assistantsService.deleteAssistant(req.params.id, req.query.isDeleteBoth, workspaceId)
return res.json(apiResponse)
} catch (error) {
next(error)
}
}
const getAllAssistants = async (req: Request, res: Response, next: NextFunction) => {
try {
const type = req.query.type as AssistantType
const workspaceId = req.user?.activeWorkspaceId
if (!workspaceId) {
throw new InternalFlowiseError(
StatusCodes.NOT_FOUND,
`Error: assistantsController.getAllAssistants - workspace ${workspaceId} not found!`
)
}
const apiResponse = await assistantsService.getAllAssistants(workspaceId, type)
return res.json(apiResponse)
} catch (error) {
next(error)
}
}
const getAssistantById = async (req: Request, res: Response, next: NextFunction) => {
try {
if (typeof req.params === 'undefined' || !req.params.id) {
throw new InternalFlowiseError(
StatusCodes.PRECONDITION_FAILED,
`Error: assistantsController.getAssistantById - id not provided!`
)View on GitHub (pinned to abe4a8601a)
Solutions
- Ensure a workspace is selected (activeWorkspaceId in session) before fetching the list.
- Verify auth middleware 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 {
return await getAllAssistants()
} catch (err) {
if (err?.statusCode === 404 && /workspace .* not found/i.test(err.message)) {
await selectWorkspace()
return getAllAssistants()
}
throw err
} Prevention
- Block listing assistants until a workspace is selected post-login.
- Treat a workspace 404 on list calls as a session-state issue, not a missing-resource issue.
- Centralize the select-workspace-then-retry pattern.
When it happens
Trigger: GET /api/v1/assistants (optionally ?type=...) from a session with no activeWorkspaceId.
Common situations: Loading the assistants list right after login before workspace selection completes; session lost mid-session; user with no workspace membership.
Related errors
- Error: assistantsController.createAssistant - workspace ${wo
- Error: assistantsController.deleteAssistant - workspace ${wo
- Error: assistantsController.getAssistantById - workspace ${w
- Error: assistantsController.updateAssistant - workspace ${wo
- Error: assistantsController.getDocumentStores - workspace ${
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/8de749dd287be074.
Report an issue: GitHub.