Docs

Task Scheduler

Automate your Agentastic workflows by scheduling launcher prompts to run at specific times. Perfect for recurring tasks, reminders, and automated workflows.

Overview

The Task Scheduler allows you to:

  • Schedule prompts to run once at a specific time
  • Set up recurring tasks with cron expressions
  • Use natural language for time specifications
  • Manage and monitor scheduled tasks
  • Automatically launch Agentastic with your prompts
  • Tasks execute in the background and mark as completed automatically

Getting Started

Prerequisites

Ensure the Agentastic daemon is running:

agentastic service status

# Start if not running
agentastic service start

Creating Your First Scheduled Task

Schedule a task to run in 30 minutes:

agentastic schedule add \
  --prompt "Check my calendar and summarize today's meetings" \
  --title "Daily Calendar Check" \
  --at "in 30 minutes"

Task Types

One-Time Tasks

Schedule tasks to run once at a specific time:

# Tomorrow at 5pm
agentastic schedule add \
  --prompt "Send weekly status report" \
  --title "Weekly Report" \
  --at "5pm tomorrow"

# Specific date and time
agentastic schedule add \
  --prompt "Prepare presentation notes" \
  --title "Presentation Prep" \
  --at "2024-12-15 14:00"

# Natural language
agentastic schedule add \
  --prompt "Review pull requests" \
  --title "PR Review" \
  --at "next Monday at 10am"

Recurring Tasks

Use cron expressions for tasks that repeat:

# Every weekday at 9am
agentastic schedule add \
  --prompt "Check team standup notes" \
  --title "Daily Standup" \
  --cron "0 9 * * MON-FRI"

# Every 30 minutes during work hours
agentastic schedule add \
  --prompt "Check for urgent emails" \
  --title "Email Check" \
  --cron "*/30 9-17 * * MON-FRI"

# Weekly report every Friday at 4pm
agentastic schedule add \
  --prompt "Generate weekly summary" \
  --title "Weekly Summary" \
  --cron "0 16 * * FRI"

Managing Tasks

List All Tasks

View all scheduled tasks with their status:

agentastic schedule list

Output shows:

  • Task ID
  • Title
  • Next execution time
  • Status (active/disabled)
  • Schedule type (once/recurring)

Check Task Status

Get detailed information about a specific task:

agentastic schedule status <task-id>

Shows:

  • Full task details
  • Execution history
  • Last run status
  • Next scheduled time

Enable/Disable Tasks

Temporarily disable a task without removing it:

# Disable task
agentastic schedule disable <task-id>

# Re-enable task
agentastic schedule enable <task-id>

Remove Tasks

Permanently delete a scheduled task:

agentastic schedule remove <task-id>

Run Tasks Immediately (Testing)

Test tasks without waiting for their scheduled time:

# Run an existing scheduled task immediately
agentastic schedule run <task-id>

# Run a one-off task without scheduling
agentastic schedule run --prompt "Test prompt" --title "Quick Test"

# Short form
agentastic schedule run -p "Check emails" -t "Email Check"

This feature is useful for:

  • Testing: Verify prompts work before scheduling them
  • Debugging: Immediately test problematic scheduled tasks
  • Manual Triggers: Run scheduled tasks on-demand
  • Quick Tasks: Execute one-off AI prompts without scheduling

Example workflow:

# 1. Create a scheduled task
agentastic schedule add --prompt "Daily report" --title "Report" --at "tomorrow 5pm"
# Output: Task ID: abc-123...

# 2. Test it immediately before waiting
agentastic schedule run abc-123

# 3. Or test a new prompt without scheduling
agentastic schedule run -p "Test: Current time is $(date)" -t "Time Test"

Natural Language Time Examples

The scheduler understands various time formats:

Relative Times

  • "in 30 minutes"
  • "in 2 hours"
  • "tomorrow"
  • "next week"
  • "next Monday"

Specific Times

  • "5pm"
  • "9:30am"
  • "14:00"
  • "5pm tomorrow"
  • "Monday at 9am"

Dates

  • "December 25"
  • "12/25/2024"
  • "2024-12-25 10:00"
  • "Christmas day at noon"

Cron Expression Reference

Cron format: minute hour day-of-month month day-of-week

Common Patterns

PatternDescription
0 9 * * *Every day at 9:00 AM
0 9 * * MON-FRIWeekdays at 9:00 AM
0 9,17 * * *9 AM and 5 PM daily
*/15 * * * *Every 15 minutes
0 0 * * SUNSunday at midnight
0 8-17 * * MON-FRIEvery hour 8 AM - 5 PM weekdays
0 0 1 * *First day of month at midnight

Special Characters

  • * - Any value
  • , - Value list separator (e.g., 1,3,5)
  • - - Range of values (e.g., 1-5)
  • / - Step values (e.g., */5 = every 5)

Day Names

  • MON, TUE, WED, THU, FRI, SAT, SUN

Month Names

  • JAN, FEB, MAR, APR, MAY, JUN
  • JUL, AUG, SEP, OCT, NOV, DEC

Use Cases

Daily Automation

# Morning briefing
agentastic schedule add \
  --prompt "Summarize my calendar, unread emails, and weather" \
  --title "Morning Briefing" \
  --cron "0 8 * * *"

# End-of-day summary
agentastic schedule add \
  --prompt "What did I accomplish today? Create tomorrow's priorities" \
  --title "Daily Review" \
  --cron "0 18 * * MON-FRI"

Project Management

# Sprint planning reminder
agentastic schedule add \
  --prompt "Review sprint backlog and prepare planning notes" \
  --title "Sprint Planning" \
  --cron "0 9 * * MON"

# Weekly status report
agentastic schedule add \
  --prompt "Generate project status report from this week's updates" \
  --title "Status Report" \
  --cron "0 16 * * FRI"

Personal Productivity

# Break reminder
agentastic schedule add \
  --prompt "Time for a 5-minute break. Stretch and hydrate!" \
  --title "Break Reminder" \
  --cron "0 */2 9-17 * * MON-FRI"

# Learning reminder
agentastic schedule add \
  --prompt "Time for daily learning. Pick a topic to study for 30 minutes" \
  --title "Learning Time" \
  --cron "0 15 * * *"

Task Storage

Tasks are stored locally on your system:

macOS:

~/Library/Application Support/agentastic/tasks/
├── <task-id-1>.json
├── <task-id-2>.json
└── history/
    └── <execution-logs>

Windows:

%APPDATA%\agentastic\tasks\

Linux:

~/.config/agentastic/tasks/

Each task file contains:

  • Task configuration
  • Schedule information
  • Execution history
  • Status and metadata

Important Notes

Execution Context

  • Tasks run with the same permissions as the Agentastic daemon
  • The launcher window appears when tasks execute
  • Tasks have a 5-minute timeout by default
  • Failed tasks retry with exponential backoff

Best Practices

  1. Test First: Use agentastic schedule run -p "prompt" to test before scheduling
  2. Clear Titles: Use descriptive titles for easy management
  3. Time Zones: Tasks use system time zone
  4. Monitor Logs: Check agentastic log for execution details
  5. Resource Usage: Avoid scheduling too many concurrent tasks
  6. Immediate Testing: Always test scheduled tasks with schedule run <task-id> after creating them

Troubleshooting

Tasks not executing:

  1. Verify daemon is running: agentastic service status
  2. Check task status: agentastic schedule status <task-id>
  3. Review logs: agentastic log | grep scheduler
  4. Ensure correct time zone settings
  5. Ensure tasks directory exists: ~/Library/Application Support/agentastic/tasks/

Tasks failing:

  1. Test with immediate execution: agentastic schedule run <task-id>
  2. Test prompt manually: agentastic schedule run -p "your prompt"
  3. Check for syntax errors in prompt
  4. Verify API keys and permissions
  5. Review execution timeout settings

Tasks stuck in "Pending" status:

  • This has been fixed - tasks now properly update to "Completed" after launching
  • If you see this on older versions, update to the latest version

Performance issues:

  1. Limit concurrent task execution
  2. Stagger task schedules
  3. Use appropriate retry settings
  4. Monitor system resources

Advanced Configuration

Task Execution Settings

Tasks execute the Agentastic launcher with these defaults:

  • Timeout: 5 minutes
  • Retry count: 3
  • Retry backoff: Exponential
  • Max concurrent: Unlimited

Integration with Other Features

Scheduled tasks work seamlessly with:

  • AI Commands: Schedule any AI command
  • Memory Channels: Tasks can use memory context
  • Agent Mode: Complex multi-step workflows
  • Tool Access: Full tool capabilities available

Content Creation

# Daily blog post ideas
agentastic schedule add \
  --prompt "Generate 3 blog post ideas based on trending topics" \
  --title "Blog Ideas" \
  --cron "0 9 * * *"

Code Reviews

# PR review reminder
agentastic schedule add \
  --prompt "List open pull requests that need my review" \
  --title "PR Review" \
  --cron "0 10,15 * * MON-FRI"

Health & Wellness

# Hydration reminder
agentastic schedule add \
  --prompt "Reminder: Drink water and take a short walk" \
  --title "Health Break" \
  --cron "0 * 9-17 * * *"

Communication

# Team check-in
agentastic schedule add \
  --prompt "Draft team check-in message with today's priorities" \
  --title "Team Update" \
  --cron "0 9 * * MON-FRI"

Security Considerations

  • Tasks are stored locally with user-only permissions
  • No tasks are shared or synced to cloud
  • Sensitive prompts should use memory channels
  • API keys are never stored in task files
  • Tasks run with your user permissions only

What's Next?

Explore related features:

Ready to automate? Start with a simple daily task and build from there!