List All Agent Executor Cron Jobs

List All Agent Executor Cron Jobs

The Agent Orbit SDK provides a way to list all scheduled jobs (cron jobs) associated with agents.

Retrieve All Cron Jobs

pythonCopy codeimport agentorbit

# Set your API key for authentication
agentorbit.api_key = "YOUR_API_KEY"

# Retrieve all cron jobs
cron_jobs = agentorbit.AgentExecutorCronJob.list()

# Iterate through the list and display the details of each cron job
for job in cron_jobs.results:
    print(f"Cron Job ID: {job.id}")
    print(f"Agent ID: {job.agent_id}")
    print(f"Name: {job.name}")
    print(f"Status: {job.status}")
    print(f"Cron Expression: {job.expression}")
    print(f"Execution Stream Address: {job.execution_stream_address}")
    print(f"Created: {job.created}")
    print(f"Modified: {job.modified}")
    print("-" * 40)

Filtering Cron Jobs

You can filter the results by specific attributes, such as agent_id.

Last updated