Skip to content

List Run Schedules

agents.schedules.list(stragent_id, ScheduleListParams**kwargs) -> ScheduleListResponse
GET/agents/{agent_id}/schedules

List run schedules for an agent.

ParametersExpand Collapse
agent_id: str
include_live: Optional[bool]

Include live Temporal state and upcoming action times.

limit: Optional[int]
ReturnsExpand Collapse
class ScheduleListResponse: …

Response model for listing run schedules.

run_schedules: List[RunSchedule]

The list of run schedules.

id: str

The unique identifier of the run schedule.

agent_id: str

The agent this schedule belongs to.

initial_input: RunScheduleInitialInput

The initial input.

content: str

The initial prompt delivered to the task.

author: Optional[MessageAuthor]

The author attributed to the initial input.

One of the following:
"user"
"agent"
type: Optional[Literal["text"]]

Input content type.

initial_input_method: str

Delivery method, inferred from the agent’s ACP type.

name: str

Human-readable schedule name.

created_at: Optional[datetime]

When the schedule was created.

formatdate-time
creator_principal: Optional[RunScheduleCreatorPrincipal]

Credential-free creator identity stored with the schedule.

Never carries cookies, JWTs, API keys, OAuth tokens, or request headers — it is creator context used only for AuthZ and ownership at fire time.

account_id: Optional[str]

Account/workspace id of the creator.

principal_type: Optional[str]

e.g. ‘user’ or ‘service_account’.

service_account_id: Optional[str]

Creator service-account id, if a service principal.

user_id: Optional[str]

Creator user id, if a user principal.

cron_expression: Optional[str]

Cron cadence, if cron-based.

description: Optional[str]

Optional description.

end_at: Optional[datetime]

Schedule deactivation time.

formatdate-time
interval_seconds: Optional[int]

Interval cadence in seconds, if interval-based.

last_action_time: Optional[datetime]

When the schedule last fired.

formatdate-time
live_data_available: Optional[bool]

Whether requested live Temporal fields were retrieved successfully. Null when live enrichment was not requested.

next_action_times: Optional[List[datetime]]

Upcoming scheduled fire times.

num_actions_taken: Optional[int]

Number of times the schedule has fired.

paused: Optional[bool]

Whether the schedule is paused.

skipped_action_times: Optional[List[datetime]]

Skipped one-off scheduled fire times.

start_at: Optional[datetime]

Schedule activation time.

formatdate-time
state: Optional[Literal["ACTIVE", "PAUSED"]]

Live schedule state from Temporal.

One of the following:
"ACTIVE"
"PAUSED"
task_metadata: Optional[Dict[str, object]]

Task metadata at fire time.

task_params: Optional[Dict[str, object]]

Task params at fire time.

timezone: Optional[str]

Timezone the cron expression is evaluated in.

updated_at: Optional[datetime]

When the schedule was updated.

formatdate-time
total: int

The number of run schedules returned.

List Run Schedules

import os
from agentex import Agentex

client = Agentex(
    api_key=os.environ.get("AGENTEX_SDK_API_KEY"),  # This is the default and can be omitted
)
schedules = client.agents.schedules.list(
    agent_id="agent_id",
)
print(schedules.run_schedules)
{
  "run_schedules": [
    {
      "id": "id",
      "agent_id": "agent_id",
      "initial_input": {
        "content": "content",
        "author": "user",
        "type": "text"
      },
      "initial_input_method": "initial_input_method",
      "name": "name",
      "created_at": "2019-12-27T18:11:19.117Z",
      "creator_principal": {
        "account_id": "account_id",
        "principal_type": "principal_type",
        "service_account_id": "service_account_id",
        "user_id": "user_id"
      },
      "cron_expression": "cron_expression",
      "description": "description",
      "end_at": "2019-12-27T18:11:19.117Z",
      "interval_seconds": 0,
      "last_action_time": "2019-12-27T18:11:19.117Z",
      "live_data_available": true,
      "next_action_times": [
        "2019-12-27T18:11:19.117Z"
      ],
      "num_actions_taken": 0,
      "paused": true,
      "skipped_action_times": [
        "2019-12-27T18:11:19.117Z"
      ],
      "start_at": "2019-12-27T18:11:19.117Z",
      "state": "ACTIVE",
      "task_metadata": {
        "foo": "bar"
      },
      "task_params": {
        "foo": "bar"
      },
      "timezone": "timezone",
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "total": 0
}
Returns Examples
{
  "run_schedules": [
    {
      "id": "id",
      "agent_id": "agent_id",
      "initial_input": {
        "content": "content",
        "author": "user",
        "type": "text"
      },
      "initial_input_method": "initial_input_method",
      "name": "name",
      "created_at": "2019-12-27T18:11:19.117Z",
      "creator_principal": {
        "account_id": "account_id",
        "principal_type": "principal_type",
        "service_account_id": "service_account_id",
        "user_id": "user_id"
      },
      "cron_expression": "cron_expression",
      "description": "description",
      "end_at": "2019-12-27T18:11:19.117Z",
      "interval_seconds": 0,
      "last_action_time": "2019-12-27T18:11:19.117Z",
      "live_data_available": true,
      "next_action_times": [
        "2019-12-27T18:11:19.117Z"
      ],
      "num_actions_taken": 0,
      "paused": true,
      "skipped_action_times": [
        "2019-12-27T18:11:19.117Z"
      ],
      "start_at": "2019-12-27T18:11:19.117Z",
      "state": "ACTIVE",
      "task_metadata": {
        "foo": "bar"
      },
      "task_params": {
        "foo": "bar"
      },
      "timezone": "timezone",
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "total": 0
}