You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates a schedule that runs the agent on a cron cadence. Only cron is accepted, as a 6-field expression firing at most once per hour: hourly 0 0 * * * *, daily 0 0 9 * * *, or weekly 0 0 9 * * 1.
fromorq_ai_sdkimportOrqimportoswithOrq(
api_key=os.getenv("ORQ_API_KEY", ""),
) asorq:
res=orq.schedules.create(agent_key="<value>", display_name="Hourly ticket summary", expression="0 0 * * * *", payload={
"input": "Summarize new tickets from the last hour",
}, type_="cron")
# Handle responseprint(res)
Example Usage: hourly_interval
fromorq_ai_sdkimportOrqimportoswithOrq(
api_key=os.getenv("ORQ_API_KEY", ""),
) asorq:
res=orq.schedules.create(agent_key="<value>", display_name="Bernie56", expression="@every 1h", payload={
"input": "Summarize new tickets from the last hour",
})
# Handle responseprint(res)
Example Usage: once_future_at
fromorq_ai_sdkimportOrqimportoswithOrq(
api_key=os.getenv("ORQ_API_KEY", ""),
) asorq:
res=orq.schedules.create(agent_key="<value>", display_name="Earlene.Hayes", expression="@at 2026-05-01T09:00:00Z", payload={
"input": "Check in on ticket TICKET-123 and post a status update.",
})
# Handle responseprint(res)
Example Usage: weekly_cron
fromorq_ai_sdkimportOrqimportoswithOrq(
api_key=os.getenv("ORQ_API_KEY", ""),
) asorq:
res=orq.schedules.create(agent_key="<value>", display_name="Weekly ticket status update", expression="0 0 9 * * 1", payload={
"input": "Post the weekly status update for TICKET-123.",
}, type_="cron")
# Handle responseprint(res)
Parameters
Parameter
Type
Required
Description
agent_key
str
✔️
The unique routing key of the agent the schedule belongs to.
display_name
str
✔️
Human-readable name of the schedule.
expression
str
✔️
6-field cron expression (sec min hour dom month dow). Seconds and minutes must be 0, day-of-month and month must be ''. Hour and weekday must each be a single integer or ''; ranges, lists, steps, and named days are rejected. Accepted shapes: hourly '0 0 * * * *', daily '0 0 9 * * *' (hour 0-23), weekly '0 0 9 * * 1' (weekday 0-6). Minimum firing cadence is 1 hour.
Partially updates a schedule. Any omitted field is left unchanged. Changing expression or type (or reactivating from inactive) reschedules the next run and bumps generation; payload-only and agent_tag-only changes leave the firing cadence in place.
Runs the schedule's payload immediately (approximately 10 seconds after the request). The schedule's regular cadence is unaffected. Inactive schedules return 400.