Mintplex-Labs/anything-llm · error

Prompt is required

Error message

Prompt is required

What it means

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.

Source

Thrown at server/endpoints/scheduledJobs.js:160

    [validatedRequest, isSingleUserMode],
    async (request, response) => {
      try {
        const { name, prompt, tools, schedule } = reqBody(request);
        let errorMessage = null;

        if (!name?.trim()) {
          errorMessage = "Name is required";
        } else if (!prompt?.trim()) {
          errorMessage = "Prompt is required";
        } else if (!schedule?.trim()) {
          errorMessage = "Schedule is required";
        } else if (!ScheduledJob.isValidCron(schedule)) {
          errorMessage = "Invalid cron expression";
        } else if (tools?.length > 0 && !Array.isArray(tools)) {
          errorMessage = "Tools must be an array";
        }
        if (errorMessage)
          return response.status(400).json({
            job: null,
            error: errorMessage,
          });

        // New jobs default to enabled, so creating one always counts as an
        // activation. Reject if it would push us past the configured cap.
        const activation = await ScheduledJob.canActivate();
        if (!activation.allowed) {
          return response.status(400).json({
            job: null,
            error: `Cannot create: maximum of ${activation.limit} active scheduled jobs reached. Disable another job first.`,
          });
        }

        const { job, error } = await ScheduledJob.create({
          name: name.trim(),
          prompt: prompt.trim(),
          tools: tools || null,

View on GitHub (pinned to 3aec848f28)

Solutions

  1. Provide a prompt for the scheduled job.
  2. Ensure the prompt is a non-empty string.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/endpoints/scheduledJobs.js:160 when the library encounters an invalid state.

Common situations: Creating a scheduled job without a prompt.


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/3a4404eb7c942365. Report an issue: GitHub.