{"record":{"id":"8bdef2b910534dda","repo":"FlowiseAI/Flowise","slug":"error-chatflowscontroller-getscheduletriggerlogs","errorCode":null,"errorMessage":"Error: chatflowsController.getScheduleTriggerLogs - id not provided!","messagePattern":"Error: chatflowsController\\.getScheduleTriggerLogs - id not provided!","errorType":"exception","errorClass":"InternalFlowiseError","httpStatus":412,"severity":"error","filePath":"packages/server/src/controllers/chatflows/index.ts","lineNumber":367,"sourceCode":"        if (!workspaceId) {\n            throw new InternalFlowiseError(StatusCodes.NOT_FOUND, 'Error: chatflowsController.getScheduleStatus - workspace not found!')\n        }\n        const status = await scheduleService.getScheduleStatus(req.params.id, workspaceId)\n        return res.json({\n            enabled: status.record?.enabled ?? false,\n            canEnable: status.canEnable,\n            reason: status.reason,\n            record: status.record\n        })\n    } catch (error) {\n        next(error)\n    }\n}\n\nconst getScheduleTriggerLogs = async (req: Request, res: Response, next: NextFunction) => {\n    try {\n        if (!req.params?.id) {\n            throw new InternalFlowiseError(\n                StatusCodes.PRECONDITION_FAILED,\n                'Error: chatflowsController.getScheduleTriggerLogs - id not provided!'\n            )\n        }\n        const workspaceId = req.user?.activeWorkspaceId\n        if (!workspaceId) {\n            throw new InternalFlowiseError(\n                StatusCodes.NOT_FOUND,\n                'Error: chatflowsController.getScheduleTriggerLogs - workspace not found!'\n            )\n        }\n        const page = req.query.page ? parseInt(String(req.query.page), 10) : undefined\n        const limit = req.query.limit ? parseInt(String(req.query.limit), 10) : undefined\n        const statusRaw = req.query.status\n        const status = Array.isArray(statusRaw) ? (statusRaw as any) : statusRaw ? (String(statusRaw) as any) : undefined\n        const result = await scheduleService.getTriggerLogs(req.params.id, workspaceId, { page, limit, status })\n        return res.json(result)\n    } catch (error) {","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/server/src/controllers/chatflows/index.ts#L349-L385","documentation":"Thrown by getScheduleTriggerLogs when req.params?.id is falsy. The endpoint paginates trigger-execution logs for one chatflow, so the chatflow id is required. Returned as PRECONDITION_FAILED (412). Pagination params (page/limit/status) are read from req.query and are optional.","triggerScenarios":"GET to the trigger-logs route with no :id, or an empty id segment. The query params alone do not satisfy the requirement.","commonSituations":"Logs viewer opened with no chatflow context, broken deep link, or a client that builds the URL from an unguarded variable.","solutions":["Include the chatflow id in the path.","Gate the logs request on a selected chatflow on the client.","Confirm the route declares :id before the log-specific query params."],"exampleFix":"// before\nfetch(`/api/v1/chatflows//schedule/logs?page=1`)\n// after\nfetch(`/api/v1/chatflows/${encodeURIComponent(id)}/schedule/logs?page=1`)","handlingStrategy":"validation","validationCode":"function fetchTriggerLogs(id: string, page?: number, limit?: number) {\n  if (!id) throw new Error('chatflow id required to read trigger logs')\n  const qs = new URLSearchParams()\n  if (page) qs.set('page', String(page))\n  if (limit) qs.set('limit', String(limit))\n  return fetch(`/api/v1/chatflows/${encodeURIComponent(id)}/schedule/logs?${qs}`)\n}","typeGuard":"const isNonEmptyString = (v: unknown): v is string => typeof v === 'string' && v.trim().length > 0","tryCatchPattern":"try { await fetchTriggerLogs(id, 1, 50) } catch (e) { if (e.statusCode === 412) throw new Error('provide a chatflow id') }","preventionTips":["Open the logs view only with a selected chatflow.","Validate id presence client-side.","Confirm the route declares :id."],"tags":["flowise","controller","validation","precondition-failed","path-param","scheduling","pagination","typescript"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}