Kubiya LogoKubiya Developer Docs

Execution Modes

How to run tasks immediately, on a schedule, or via webhooks

⚙️ Execution Modes

🚀 Choose How Your Tasks Run

Agent Composer offers three ways to execute tasks: run them instantly, schedule them for later, or trigger them from external systems. Pick the mode that fits your workflow.

🎯 Three Ways to Execute

Immediate

Run tasks right now with live updates

  • ✓ Real-time streaming
  • ✓ Interactive approvals
  • ✓ Perfect for debugging

📅

Scheduled

Set tasks to run automatically later

  • ✓ One-time or recurring
  • ✓ Timezone aware
  • ✓ Great for maintenance

🔗

Webhook

Trigger tasks from external events

  • ✓ Unique webhook URL
  • ✓ Event-driven automation
  • ✓ Perfect for CI/CD

⚡ Immediate Execution

How It Works

When you submit a task without scheduling, it runs immediately. You'll see:

  1. Live Progress - Watch each step execute in real-time
  2. Command Output - See actual results as they happen
  3. Interactive Approvals - Approve critical actions on the fly
  4. Instant Feedback - Know immediately if something goes wrong

When to Use

✅ Perfect For

  • • Interactive deployments
  • • Debugging and testing
  • • One-off operations
  • • Learning what the agent does

⚠️ Consider

  • • Requires you to stay connected
  • • Limited to 30-minute timeout
  • • Can't retry if disconnected
  • • Not suitable for long operations

How to Use

Simply type your task and press Enter. That's it! The task starts immediately.

Pro Tip: Use immediate mode when you need to see what's happening or when the task requires your input along the way.

📅 Scheduled Execution

How It Works

Schedule tasks to run at specific times or on recurring intervals:

Click the Calendar Icon

Find it next to the submit button

Set Date and Time

Choose when the task should run

Select Timezone

Ensure it runs at the right time for your location

Choose Recurrence (Optional)

Make it daily, weekly, or monthly

Schedule Options

⏰ One-Time

Run once at the specified time

📆 Daily

Run every day at the same time

📅 Weekly

Run on the same day each week

🗓️ Monthly

Run on the same date each month

Common Use Cases

  • Nightly Backups - Schedule database backups at 2 AM
  • Weekly Reports - Generate reports every Monday morning
  • Monthly Cleanup - Remove old logs on the 1st of each month
  • Business Hours Tasks - Run tasks only during work hours

Note: Scheduled tasks run in the background. You'll receive notifications when they complete or if they need attention.

🔗 Webhook Execution

How It Works

Create tasks that can be triggered by external systems:

  1. Create Task with Webhook - Click the webhook icon when creating a task
  2. Get Unique URL - Each task gets its own secure webhook URL
  3. Configure Your System - Add the webhook URL to your external tool
  4. Send POST Request - The task runs whenever the webhook is called

Setting Up Webhooks

Enable Webhook Mode

Click the link icon in task creation

Define Your Task

The task description becomes your template

Test the Webhook (Optional)

Send a test payload to verify it works

Copy Webhook URL

Use this URL in your external system

Example Webhook URL

https://compose.kubiya.ai/api/webhooks/tasks/[task-id]/[secret-token]

Common Integrations

🔧 CI/CD Systems

  • • GitHub Actions
  • • GitLab CI
  • • Jenkins
  • • CircleCI

📊 Monitoring Tools

  • • Datadog
  • • PagerDuty
  • • New Relic
  • • Prometheus AlertManager

Webhook Payload

You can pass data to your task through the webhook payload:

{
  "event": {
    "type": "deployment",
    "environment": "staging",
    "version": "v2.1.0"
  }
}

This data becomes available to your task for dynamic execution.

🎯 Choosing the Right Mode

Quick Decision Guide

ScenarioBest ModeWhy
Testing a new task⚡ ImmediateSee results instantly
Daily reports📅 ScheduledRuns automatically
After code push🔗 WebhookTriggered by GitHub
One-time migration⚡ ImmediateMonitor progress
Nightly backups📅 ScheduledNo manual intervention
Alert response🔗 WebhookTriggered by monitoring

Mode Comparison

Feature⚡ Immediate📅 Scheduled🔗 Webhook
Live Updates
Runs Automatically
External Triggers
Recurring
Best ForInteractive tasksRoutine automationEvent-driven tasks

💡 Tips & Best Practices

For Immediate Mode

  • Stay connected while the task runs
  • Use for tasks that need your input
  • Perfect for learning and debugging

For Scheduled Mode

  • Double-check timezone settings
  • Test the task manually first
  • Set up notifications for failures

For Webhook Mode

  • Keep webhook URLs secure
  • Test with sample payloads
  • Monitor webhook call frequency

⚙️ Flexible Execution

Choose the execution mode that fits your workflow. Start with immediate mode to test, then switch to scheduled or webhook mode for automation. You can always change how a task runs!