Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.runtools.ai/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Scheduled runs are part of the current workflow system. Create a workflow, then attach a cron trigger with a cron expression and optional timezone.
Schedules are workflow triggers, not a separate rt.schedules SDK manager.

Create A Workflow

const saved = await rt.workflows.save({
  slug: 'daily-inbox-summary',
  name: 'Daily Inbox Summary',
  graph: {
    nodes: [
      {
        id: 'summarize',
        type: 'agent',
        config: {
          agent: 'email-assistant',
          prompt: 'Summarize important email since yesterday.',
        },
      },
    ],
    edges: [],
  },
});

await rt.workflows.publish('daily-inbox-summary', {
  visibility: 'org',
});

Add A Cron Trigger

const trigger = await rt.workflows.createTrigger('daily-inbox-summary', {
  type: 'cron',
  name: 'Weekday morning',
  cronExpression: '0 9 * * 1-5',
  timezone: 'America/New_York',
  enabled: true,
});

console.log(trigger.trigger.id);
cURL
curl -X POST https://api.runtools.ai/v1/workflows/daily-inbox-summary/triggers \
  -H "X-API-Key: $RUNTOOLS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "cron",
    "name": "Weekday morning",
    "cronExpression": "0 9 * * 1-5",
    "timezone": "America/New_York",
    "enabled": true
  }'

Cron Syntax

RunTools uses standard 5-field cron expressions: minute hour day month weekday.
CronDescription
0 9 * * *Every day at 9:00 AM
0 * * * *Every hour
0 9 * * 1-5Weekdays at 9:00 AM
*/15 * * * *Every 15 minutes

Manage Triggers

const triggers = await rt.workflows.triggers('daily-inbox-summary');

await rt.workflows.updateTrigger(
  'daily-inbox-summary',
  triggers[0].id,
  {
    enabled: false,
  },
);

await rt.workflows.deleteTrigger('daily-inbox-summary', triggers[0].id);

View Runs

const runs = await rt.workflows.runs('daily-inbox-summary', 20);
const events = await rt.workflows.events(runs[0].id);
runtools workflow run daily-inbox-summary "Manual smoke run" --events

CLI

runtools workflow trigger list daily-inbox-summary
runtools workflow trigger create daily-inbox-summary \
  --type cron \
  --cron "0 9 * * 1-5" \
  --timezone America/New_York \
  --name "Weekday morning"