FlowiseAI/Flowise · error · InternalFlowiseError
Error: chatflowsController.getScheduleStatus - workspace not
Error message
Error: chatflowsController.getScheduleStatus - workspace not found!
What it means
Thrown by getScheduleStatus when req.user?.activeWorkspaceId is falsy. Schedule records are workspace-scoped, so the lookup needs the caller's workspace. Returned as NOT_FOUND (404), consistent with most other workspace guards in this file (contrast with the webhook ones that use 401).
Source
Thrown at packages/server/src/controllers/chatflows/index.ts:350
}
await chatflowsService.clearWebhookSecret(req.params.id, workspaceId)
return res.sendStatus(StatusCodes.NO_CONTENT)
} catch (error) {
next(error)
}
}
const getScheduleStatus = async (req: Request, res: Response, next: NextFunction) => {
try {
if (!req.params?.id) {
throw new InternalFlowiseError(
StatusCodes.PRECONDITION_FAILED,
'Error: chatflowsController.getScheduleStatus - id not provided!'
)
}
const workspaceId = req.user?.activeWorkspaceId
if (!workspaceId) {
throw new InternalFlowiseError(StatusCodes.NOT_FOUND, 'Error: chatflowsController.getScheduleStatus - workspace not found!')
}
const status = await scheduleService.getScheduleStatus(req.params.id, workspaceId)
return res.json({
enabled: status.record?.enabled ?? false,
canEnable: status.canEnable,
reason: status.reason,
record: status.record
})
} catch (error) {
next(error)
}
}
const getScheduleTriggerLogs = async (req: Request, res: Response, next: NextFunction) => {
try {
if (!req.params?.id) {
throw new InternalFlowiseError(
StatusCodes.PRECONDITION_FAILED,View on GitHub (pinned to abe4a8601a)
Solutions
- Authenticate the request so req.user.activeWorkspaceId is set.
- Confirm the user has an active workspace; create/assign one if missing.
- Ensure the auth/workspace middleware runs before this handler.
Example fix
// before
const res = await fetch(`/api/v1/chatflows/${id}/schedule/status`)
// after
const res = await fetch(`/api/v1/chatflows/${id}/schedule/status`, {
headers: { Authorization: `Bearer ${token}` }
}) Defensive patterns
Strategy: validation
Validate before calling
async function authedFetch(url: string) {
if (!token) throw new Error('no auth token - cannot resolve active workspace')
return fetch(url, { headers: { Authorization: `Bearer ${token}` } })
} Type guard
const hasActiveWorkspace = (u: unknown): u is { activeWorkspaceId: string } =>
!!u && typeof (u as any).activeWorkspaceId === 'string' Try / catch
try { await api.getScheduleStatus(id) } catch (e) { if (e.statusCode === 404 && /workspace/i.test(e.message)) { await reAuth(); await api.getScheduleStatus(id) } else throw e } Prevention
- Authenticate schedule-status requests.
- Ensure an active workspace is selected.
- Verify auth middleware ordering.
When it happens
Trigger: Request arrives without req.user or with a user lacking activeWorkspaceId — unauthenticated call, expired session, or a user not yet assigned to a workspace.
Common situations: Session expired while the schedule UI was open, API key without workspace binding, or middleware ordering that bypasses auth for this route.
Related errors
- Error: chatflowsController.getScheduleTriggerLogs - workspac
- Error: chatflowsController.deleteScheduleTriggerLogs - works
- Error: chatflowsController.toggleScheduleEnabled - workspace
- Error: chatflowsController.checkIfChatflowHasChanged - activ
- Error: chatflowsController.setWebhookSecret - workspace not
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/cd4931ab8c2a24be.
Report an issue: GitHub.