Skip to main content
Execution resources handle task scheduling, monitoring, and distributed execution across your worker infrastructure. This includes one-time executions, scheduled jobs with cron triggers, and worker management.

Quick Start

# List executions
kubiya execution list --status running
Output:
📊 Executions

ID                                    AGENT           STATUS      STARTED
a1b2c3d4-e5f6-7890-abcd-ef1234567890  DevOps Agent   running     2025-01-15 14:23:45
b2c3d4e5-f6a7-8901-bcde-f12345678901  Platform Agent running     2025-01-15 14:20:12
# View execution logs
kubiya execution logs <execution-id> --follow

# Create scheduled job
kubiya job create --file job.yaml

# List scheduled jobs
kubiya job list
Output:
⏰ Scheduled Jobs (0)

No jobs found. Create your first job with:
  kubiya job create --file job.yaml
# Check worker status (requires queue ID)
kubiya worker status --queue-id <queue-id>
Output:
📊 Worker Status

Queue ID: default-queue
Status: Running
Workers: 2 active
Last Heartbeat: 2025-01-15 14:25:30

Executions

One-time task runs with real-time streaming and logging.

List Executions

# List all executions
kubiya execution list

# Filter by agent
kubiya execution list --agent <agent-id>

# Filter by status
kubiya execution list --status running
kubiya execution list --status completed
kubiya execution list --status failed

Get Execution Details

# View execution details
kubiya execution get <execution-id>

# JSON output
kubiya execution get <execution-id> --output json

View Execution Logs

# View logs
kubiya execution logs <execution-id>

# Follow logs in real-time
kubiya execution logs <execution-id> --follow

Check Execution Status

# Get current status
kubiya execution status <execution-id>

Cancel Execution

# Cancel running execution
kubiya execution cancel <execution-id>

Retry Failed Execution

# Retry with same parameters
kubiya execution retry <execution-id>

Jobs

Scheduled or recurring tasks with cron-based triggers.

List Jobs

# List all jobs
kubiya job list

# JSON output
kubiya job list --output json

Get Job Details

# View job configuration
kubiya job get <job-id>

Create Job

# Create from file
kubiya job create --file job.yaml
# job.yaml
name: daily-backup
description: Run daily database backup
schedule: "0 0 * * *"  # Daily at midnight
agent_id: backup-agent
prompt: "Run full database backup"
enabled: true
Common Cron Expressions:
ScheduleCron ExpressionDescription
Every hour0 * * * *Run at the start of every hour
Daily at 2 AM0 2 * * *Run once per day at 2:00 AM
Weekly on Monday0 0 * * 1Run every Monday at midnight
Monthly on 1st0 0 1 * *Run first day of each month
Every 15 minutes*/15 * * * *Run 4 times per hour
Business hours0 9-17 * * 1-5Every hour during business days

Update Job

# Update job configuration
kubiya job update <job-id> --file job.yaml

Pause Job

# Pause scheduled job
kubiya job pause <job-id>

Resume Job

# Resume paused job
kubiya job resume <job-id>

Trigger Job Manually

# Run job immediately
kubiya job trigger <job-id>

Delete Job

# Delete job
kubiya job delete <job-id>

Workers

Execution engines that process agent tasks. Workers can be persistent (always running) or on-demand (ephemeral).
For detailed worker deployment and configuration, see the Worker Management guide.

Start Worker

# Start worker
kubiya worker start

# Start with specific queue
kubiya worker start --queue <queue-id>

Stop Worker

# Stop running worker
kubiya worker stop

Check Worker Status

# Get worker status (requires queue ID)
kubiya worker status --queue-id <queue-id>

View Worker Logs

# View logs
kubiya worker logs

# Follow logs in real-time
kubiya worker logs --follow

Best Practices

  • Monitor for failed executions and long-running tasks
  • Check execution logs regularly for errors
  • Test jobs manually before enabling schedules
  • Use appropriate cron expressions for schedules
  • Set realistic timeouts for jobs
  • Use on-demand workers for occasional tasks
  • Use persistent workers for high-frequency operations
  • Keep workers updated with latest features
  • Deploy multiple workers for critical workloads

Command Reference

# Executions
kubiya execution list [--status running|completed|failed]
kubiya execution list --agent <id>
kubiya execution get <id>
kubiya execution logs <id> [--follow]
kubiya execution status <id>
kubiya execution cancel <id>
kubiya execution retry <id>

# Jobs
kubiya job list
kubiya job get <id>
kubiya job create --file job.yaml
kubiya job update <id> --file job.yaml
kubiya job delete <id>
kubiya job pause <id>
kubiya job resume <id>
kubiya job trigger <id>

# Workers
kubiya worker start [--queue <id>]
kubiya worker stop
kubiya worker status --queue-id <id>
kubiya worker logs [--follow]

Next Steps