{"record":{"id":"3a4404eb7c942365","repo":"Mintplex-Labs/anything-llm","slug":"prompt-is-required-3a4404","errorCode":null,"errorMessage":"Prompt is required","messagePattern":"Prompt is required","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/endpoints/scheduledJobs.js","lineNumber":160,"sourceCode":"    [validatedRequest, isSingleUserMode],\n    async (request, response) => {\n      try {\n        const { name, prompt, tools, schedule } = reqBody(request);\n        let errorMessage = null;\n\n        if (!name?.trim()) {\n          errorMessage = \"Name is required\";\n        } else if (!prompt?.trim()) {\n          errorMessage = \"Prompt is required\";\n        } else if (!schedule?.trim()) {\n          errorMessage = \"Schedule is required\";\n        } else if (!ScheduledJob.isValidCron(schedule)) {\n          errorMessage = \"Invalid cron expression\";\n        } else if (tools?.length > 0 && !Array.isArray(tools)) {\n          errorMessage = \"Tools must be an array\";\n        }\n        if (errorMessage)\n          return response.status(400).json({\n            job: null,\n            error: errorMessage,\n          });\n\n        // New jobs default to enabled, so creating one always counts as an\n        // activation. Reject if it would push us past the configured cap.\n        const activation = await ScheduledJob.canActivate();\n        if (!activation.allowed) {\n          return response.status(400).json({\n            job: null,\n            error: `Cannot create: maximum of ${activation.limit} active scheduled jobs reached. Disable another job first.`,\n          });\n        }\n\n        const { job, error } = await ScheduledJob.create({\n          name: name.trim(),\n          prompt: prompt.trim(),\n          tools: tools || null,","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/endpoints/scheduledJobs.js#L142-L178","documentation":"Validation branch in the create-scheduled-job endpoint: the prompt field is empty or whitespace-only, so the job would have nothing to execute and the request is rejected with this as the errorMessage.","triggerScenarios":"Thrown at server/endpoints/scheduledJobs.js:160 when the library encounters an invalid state.","commonSituations":"Creating a scheduled job without a prompt.","solutions":["Provide a prompt for the scheduled job.","Ensure the prompt is a non-empty string."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}