Skip to main content

Scheduled Jobs

Any workflow can be scheduled to run automatically using a cron expression. DAEMI manages the crontab entry for you — you define the schedule in the Console or API, DAEMI handles the rest.


How It Works

When you save a scheduled job in DAEMI:

  1. DAEMI writes a crontab entry on the server
  2. At trigger time, cron calls POST /api/jobs/{job_id}/run on the DAEMI server
  3. DAEMI runs the associated workflow with the stored inputs
  4. Results are streamed (to SSE, and optionally to a notification target)

You never touch crontab directly. DAEMI owns it.


Creating a Scheduled Job

Via the Console

  1. Open the workflow you want to schedule
  2. Click Schedule in the workflow header
  3. Choose a schedule type:
    • Preset — hourly, daily, weekly, monthly
    • Custom cron — enter a cron expression
  4. Set default inputs for the workflow run
  5. (Optional) Configure a notification — email or Console alert on completion
  6. Click Save Schedule

Via API

POST /api/jobs
Content-Type: application/json

{
"workflow_id": "weekly_research",
"name": "Weekly AI Digest",
"schedule": "0 8 * * 1",
"inputs": {
"topic": "artificial intelligence",
"email": "kevin@example.com"
},
"notify": {
"on_complete": true,
"on_failure": true,
"channel": "email",
"target": "kevin@example.com"
}
}

Cron Expression Reference

DAEMI uses standard 5-field cron syntax:

┌───────────── minute (0–59)
│ ┌─────────── hour (0–23)
│ │ ┌───────── day of month (1–31)
│ │ │ ┌─────── month (1–12)
│ │ │ │ ┌───── day of week (0–6, Sunday=0)
│ │ │ │ │
* * * * *

Common Schedules

ScheduleCron Expression
Every day at 8am0 8 * * *
Every Monday at 9am0 9 * * 1
Every hour0 * * * *
Every 15 minutes*/15 * * * *
Every weekday at 7am0 7 * * 1-5
First day of month at midnight0 0 1 * *

Managing Scheduled Jobs

List all jobs

GET /api/jobs

Get a specific job

GET /api/jobs/{job_id}

Update a schedule

PATCH /api/jobs/{job_id}
{
"schedule": "0 9 * * 1-5",
"inputs": { "topic": "ML news" }
}

Disable a job (without deleting)

PATCH /api/jobs/{job_id}
{ "enabled": false }

Delete a job

DELETE /api/jobs/{job_id}

DAEMI removes the crontab entry immediately on delete or disable.


Viewing Job Run History

GET /api/jobs/{job_id}/runs?limit=20

The Console shows job run history in Workflows → Scheduled with:

  • Last run time and status
  • Run duration
  • Any error details
  • Link to the full run log

Manual Trigger

Run a scheduled job immediately (same as cron would):

POST /api/jobs/{job_id}/run

This is also what the crontab entry calls — so manual and scheduled triggers are identical.


Timezone Handling

Cron runs in the server's local timezone. Timezone can be configured in the Console under Settings → System.


Go Deeper