Skip to content

Scheduled Runs

Use scheduled runs to execute saved scripts on a fixed cadence without manual dispatch.

Path: App -> Schedules

Create a schedule

  1. Open /app/schedules.
  2. Choose script and target agent.
  3. Enter a cron expression and timezone.
  4. Set guardrails:
    • max runtime minutes
    • max retries
    • retry delay seconds
    • concurrency limit
    • idempotency window minutes
  5. Save.

Default runtime is 12 hours (720 minutes). Schedules can be configured up to 22 hours (1320 minutes) when a workflow legitimately needs a longer timeout.

Configure variables and vault keys

  • Put non-secret inputs in variables (JSON object).
  • Put secret inputs in vaultKeys so the scheduler injects decrypted values at runtime.
  • Missing vault keys block dispatch for that run.

Trigger behavior

The scheduler evaluates due rows and applies these controls before dispatch:

  • organization billing gate
  • concurrency limit per schedule
  • idempotency window
  • agent readiness (including auto-start when stopped/offline)

If checks pass, Mimic dispatches a job and writes schedule metadata (lastRunAt, lastRunStatus, nextRunAt).

Manual and dry-run execution

Use POST /api/schedules/execute for scoped manual execution.

Example:

{
"dryRun": false,
"force": true,
"scheduleId": "sched_abc123",
"limit": 1
}

Rules:

  • force: true requires scheduleId.
  • dryRun: true reports what would trigger without dispatching jobs.
  • Manual runs now return detailed triggeredSchedules, skipped, and errors data so the UI can show lock contention, agent readiness, or vault problems directly.

Cron worker endpoint

Use GET or POST /api/cron/scheduled-runs with x-cron-key (or bearer token) set to CRON_SECRET.

Recommended:

  • run every minute
  • include dryRun=true in non-production smoke checks
  • alert on repeated executor lock errors

Operating model

  • Keep deterministic selectors and explicit assertions to preserve RPA-first reliability.
  • Use retries for transient portal failures only.
  • Use stale-job watchdog endpoints alongside schedules to keep queues recoverable.