FlowiseAI/Flowise · error · InternalFlowiseError
Error: chatflowsController.getScheduleTriggerLogs - workspac
Error message
Error: chatflowsController.getScheduleTriggerLogs - workspace not found!
What it means
Thrown by getScheduleTriggerLogs when req.user?.activeWorkspaceId is falsy. Logs are scoped to a workspace for tenant isolation. Returned as NOT_FOUND (404). Same root-cause family as the other workspace guards.
Source
Thrown at packages/server/src/controllers/chatflows/index.ts:374
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,
'Error: chatflowsController.getScheduleTriggerLogs - id not provided!'
)
}
const workspaceId = req.user?.activeWorkspaceId
if (!workspaceId) {
throw new InternalFlowiseError(
StatusCodes.NOT_FOUND,
'Error: chatflowsController.getScheduleTriggerLogs - workspace not found!'
)
}
const page = req.query.page ? parseInt(String(req.query.page), 10) : undefined
const limit = req.query.limit ? parseInt(String(req.query.limit), 10) : undefined
const statusRaw = req.query.status
const status = Array.isArray(statusRaw) ? (statusRaw as any) : statusRaw ? (String(statusRaw) as any) : undefined
const result = await scheduleService.getTriggerLogs(req.params.id, workspaceId, { page, limit, status })
return res.json(result)
} catch (error) {
next(error)
}
}
const deleteScheduleTriggerLogs = async (req: Request, res: Response, next: NextFunction) => {
try {
if (!req.params?.id) {View on GitHub (pinned to abe4a8601a)
Solutions
- Send a valid authenticated request.
- Ensure the user has an active workspace.
- Re-auth on 401/404 workspace errors before retrying.
Example fix
// before
fetch(`/api/v1/chatflows/${id}/schedule/logs`)
// after
fetch(`/api/v1/chatflows/${id}/schedule/logs`, { 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.getTriggerLogs(id) } catch (e) { if (e.statusCode === 404 && /workspace/i.test(e.message)) { await reAuth(); await api.getTriggerLogs(id) } else throw e } Prevention
- Authenticate log-viewing requests.
- Re-auth on session expiry.
- Verify auth middleware on the route.
When it happens
Trigger: Unauthenticated request, expired token, or authenticated user with no activeWorkspaceId reaching the logs endpoint.
Common situations: Long-opened admin page whose session expired before the user clicked 'View logs', API key misconfiguration, or test harness without req.user.
Related errors
- Error: chatflowsController.getScheduleStatus - workspace not
- 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/f37be49fb9b68541.
Report an issue: GitHub.