Skip to content

Scheduled Jobs

Jobs let agents run tasks on a schedule — prompts, tool calls, JavaScript functions, or multi-step pipelines. Jobs are policy-gated, audited, and can be created by the agent itself.

Moneypenny exposes job management through MCP, so you can create and manage jobs with natural language in any MCP-compatible client (Claude Desktop, Cursor, etc.) or through the CLI.

Creating a Job

Terminal window
mp job create \
--name "daily-metrics" \
--schedule "0 9 * * *" \
--job-type prompt \
--payload '{"prompt":"Check performance metrics and flag regressions."}'

Job Types

TypePayloadExecution
prompt{"prompt":"..."}Sent to the LLM as a user message
tool{"tool":"...","args":{}}Calls a specific tool directly
js{"source":"function run() {...}"}Executes JavaScript in QuickJS
pipeline{"steps":[...]}Runs a sequence of steps

Schedules

Schedules use cron syntax:

PatternMeaning
0 9 * * *Every day at 9:00 AM
*/30 * * * *Every 30 minutes
0 9 * * 1-5Weekdays at 9:00 AM
0 0 1 * *First of every month

Managing Jobs

Terminal window
mp job list # list all jobs
mp job run <job-id> # trigger immediately
mp job pause <job-id> # pause scheduling
mp job history # view all run history
mp job history <job-id> # history for one job

Overlap Policies

When a job fires while its previous run is still active:

PolicyBehavior
skipSkip the new run
queueQueue it for later
allowRun both concurrently

Agent-Created Jobs

Agents can create jobs during conversation through a structured flow:

  1. Plan — agent proposes a job specification
  2. Confirm — user reviews and approves
  3. Apply — job is created through the canonical operation pipeline

This ensures agent-created jobs go through the same policy checks, hooks, and audit as operator-created jobs.

Terminal window
# Plan phase
echo '{"op":"job.spec.plan","args":{"description":"Check metrics daily"}}' | mp sidecar
# After review
echo '{"op":"job.spec.confirm","args":{"spec_id":"..."}}' | mp sidecar
# Apply
echo '{"op":"job.spec.apply","args":{"spec_id":"..."}}' | mp sidecar

Scheduler

When mp start runs the gateway, a scheduler loop polls for due jobs and dispatches them. Each job run is recorded with status, output, duration, and any errors. Failed jobs are retried according to their retry configuration.