{"record":{"id":"48156b7b898547a6","repo":"FlowiseAI/Flowise","slug":"error-chatflowscontroller-deletescheduletriggerlo","errorCode":null,"errorMessage":"Error: chatflowsController.deleteScheduleTriggerLogs - id not provided!","messagePattern":"Error: chatflowsController\\.deleteScheduleTriggerLogs - id not provided!","errorType":"exception","errorClass":"InternalFlowiseError","httpStatus":412,"severity":"error","filePath":"packages/server/src/controllers/chatflows/index.ts","lineNumber":393,"sourceCode":"                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) {\n        next(error)\n    }\n}\n\nconst deleteScheduleTriggerLogs = 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.deleteScheduleTriggerLogs - 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.deleteScheduleTriggerLogs - workspace not found!'\n            )\n        }\n        const logIds: unknown = req.body?.logIds\n        if (!Array.isArray(logIds) || logIds.some((x) => typeof x !== 'string')) {\n            throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, 'logIds must be a string[]')\n        }\n        const result = await scheduleService.deleteTriggerLogs(req.params.id, workspaceId, logIds as string[])\n        return res.json(result)\n    } catch (error) {","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/server/src/controllers/chatflows/index.ts#L375-L411","documentation":"Thrown by deleteScheduleTriggerLogs when req.params?.id is falsy. The endpoint deletes selected trigger-log entries for a chatflow, so the chatflow id is mandatory even though the actual log ids arrive in the body. Returned as PRECONDITION_FAILED (412).","triggerScenarios":"A DELETE request whose path lacks :id, regardless of whether the body carries valid logIds.","commonSituations":"Client focused on the body payload and forgot the path id, route mounted without :id, or a UI delete action fired before a chatflow was bound.","solutions":["Include the chatflow id in the path alongside the logIds body.","Validate both id and logIds client-side before sending.","Confirm the route declares :id."],"exampleFix":"// before\nfetch(`/api/v1/chatflows//schedule/logs`, { method: 'DELETE', body: JSON.stringify({ logIds }) })\n// after\nfetch(`/api/v1/chatflows/${encodeURIComponent(id)}/schedule/logs`, { method: 'DELETE', body: JSON.stringify({ logIds }) })","handlingStrategy":"validation","validationCode":"function deleteTriggerLogs(id: string, logIds: string[]) {\n  if (!id) throw new Error('chatflow id required')\n  if (!Array.isArray(logIds) || logIds.some((x) => typeof x !== 'string')) throw new Error('logIds must be string[]')\n  return fetch(`/api/v1/chatflows/${encodeURIComponent(id)}/schedule/logs`, { method: 'DELETE', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ logIds }) })\n}","typeGuard":"const isStringArray = (v: unknown): v is string[] => Array.isArray(v) && v.every((x) => typeof x === 'string')","tryCatchPattern":"try { await deleteTriggerLogs(id, logIds) } catch (e) { if (e.statusCode === 412) throw new Error('provide a chatflow id') }","preventionTips":["Send both the path id and the body logIds.","Validate id and logIds client-side.","Confirm the route declares :id."],"tags":["flowise","controller","validation","precondition-failed","path-param","scheduling","typescript"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}