Mintplex-Labs/anything-llm · error

Schedule is required

Error message

Schedule is required

What it means

Validation branch in the create-scheduled-job endpoint: the schedule field from the request body is empty or whitespace-only, so the job has no cron schedule to execute and the request is rejected with the validation message.

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 cron schedule for the job.
  2. Use a standard 5-field cron expression.
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 schedule.


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