Skip to main content
POST
/
agents
/
{agent_id}
/
schedules
{
  "schedule_id": "<string>",
  "name": "<string>",
  "agent_id": "<string>",
  "state": "ACTIVE",
  "action": {
    "workflow_name": "<string>",
    "workflow_id_prefix": "<string>",
    "task_queue": "<string>",
    "workflow_params": [
      "<unknown>"
    ]
  },
  "spec": {
    "cron_expressions": [
      "<string>"
    ],
    "intervals_seconds": [
      123
    ],
    "start_at": "2023-11-07T05:31:56Z",
    "end_at": "2023-11-07T05:31:56Z"
  },
  "num_actions_taken": 0,
  "num_actions_missed": 0,
  "next_action_times": [
    "2023-11-07T05:31:56Z"
  ],
  "last_action_time": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z"
}

Path Parameters

agent_id
string
required

Body

application/json

Request model for creating a new schedule for an agent

name
string
required

Human-readable name for the schedule (e.g., 'weekly-profiling'). Will be combined with agent_id to form the full schedule_id.

Required string length: 1 - 64
workflow_name
string
required

Name of the Temporal workflow to execute (e.g., 'sae-orchestrator')

task_queue
string
required

Temporal task queue where the agent's worker is listening

workflow_params
Workflow Parameters · object

Parameters to pass to the workflow

cron_expression
string | null

Cron expression for scheduling (e.g., '0 0 * * 0' for weekly on Sunday)

interval_seconds
integer | null

Alternative to cron - run every N seconds

Required range: x >= 1
execution_timeout_seconds
integer | null

Maximum time in seconds for each workflow execution

Required range: x >= 1
start_at
string<date-time> | null

When the schedule should start being active

end_at
string<date-time> | null

When the schedule should stop being active

paused
boolean
default:false

Whether to create the schedule in a paused state

Response

Successful Response

Response model for schedule operations

schedule_id
string
required

Unique identifier for the schedule

name
string
required

Human-readable name for the schedule

agent_id
string
required

ID of the agent this schedule belongs to

state
enum<string>
required

Current state of the schedule

Available options:
ACTIVE,
PAUSED
action
Action · object
required

Information about the scheduled action

spec
Spec · object
required

Schedule specification

num_actions_taken
integer
default:0

Number of times the schedule has executed

num_actions_missed
integer
default:0

Number of scheduled executions that were missed

next_action_times
string<date-time>[]

Upcoming scheduled execution times

last_action_time
string<date-time> | null

When the schedule last executed

created_at
string<date-time> | null

When the schedule was created