Skip to main content

Schedules

List Schedules

Lists all schedules attached to the specified agent, most recent first.
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.schedules.list(agent_key="<value>")

    # Handle response
    print(res)

Create a Schedule

Creates a schedule that runs the agent on a recurring or one-off cadence. The minimum firing interval is 1 hour for cron and interval; once schedules are exempt.

Delete a Schedule

Permanently removes a schedule from NATS, Mongo, and the Redis cache.
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    orq.schedules.delete(agent_key="<value>", schedule_id="<id>")

    # Use the SDK ...

Retrieve a Schedule

Retrieves a single schedule by ID.
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.schedules.retrieve(agent_key="<value>", schedule_id="<id>")

    # Handle response
    print(res)

Update a Schedule

Partially updates a schedule. Any omitted field is left unchanged. Changing expression or type (or reactivating from inactive) re-publishes the NATS schedule and bumps generation; payload-only and agent_tag-only changes leave the firing cadence in place.

Trigger a Schedule

Runs the schedule’s payload immediately (≈10 seconds after the request, to stay above the NATS scheduler’s minimum deliver-at margin). The schedule’s regular cadence is unaffected. Inactive schedules return 400.
from orq_ai_sdk import Orq
import os

with Orq(
    api_key=os.getenv("ORQ_API_KEY", ""),
) as orq:

    res = orq.schedules.trigger(agent_key="<value>", schedule_id="<id>")

    # Handle response
    print(res)