Skip to main content

Worker System

Production-ready automated task execution using AI agents.

Overview

The AnyTask Worker System enables automated task execution using AI agents. Workers run continuously, monitoring for tasks that match workflow triggers, then automatically implementing them using Claude Code. Most users should use the built-in workflows - they’re production-ready and cover common development scenarios. For custom automation needs, see the Complete Guide for writing your own workflows.

Key Features

  • Built-in Workflows - Four production-ready workflows included with CLI
  • AI-Powered Execution - Uses Claude Code for intelligent task implementation
  • Event-Driven - Triggers on task events (created, updated, status changed)
  • Zero Configuration - Works out of the box with sensible defaults
  • Error Handling - Graceful failure handling with automatic notifications

Built-in Workflows

The CLI includes four production-ready workflows. Simply start the worker and they’re available immediately - no configuration needed.

1. Dry Run (dry_run)

Purpose: Test workflow execution without making real changes When to use: Testing worker setup, validating workflows, CI/CD validation Triggers:
  • Any task created or updated to todo status
What it does:
  • Simulates task analysis with Claude
  • Simulates implementation (no actual file changes)
  • Simulates linting and testing
  • Simulates git commit
  • Marks task as done
  • Posts detailed simulation logs to task
Timeout: 10 minutes Benefits:
  • Fast execution
  • No API costs (uses dry-run actions)
  • Safe for testing
  • Validates workflow orchestration
# Use dry run for testing
anyt worker start --agent-id agent-xxx --workflow dry_run

2. Local Development (local_dev)

Purpose: Quick implementation on current repository state When to use: Rapid iterations, local testing, simple fixes Triggers:
  • Any task created or updated to todo status
What it does:
  1. Analyzes task with Claude Haiku
  2. Posts analysis to task
  3. Implements changes with Claude Code
  4. Runs linting (make lint)
  5. Runs tests (make test)
  6. Commits all changes
  7. Marks task as done
Timeout: 30 minutes Model: claude-haiku-4-5-20251001 Key Features:
  • No branch switching (works on current state)
  • Fast execution with Haiku model
  • Continues even if lint/test fail
  • Perfect for iterative development
# Best for: Quick iterations on current branch
anyt worker start --agent-id agent-xxx --workflow local_dev

3. Feature Development (feature_dev)

Purpose: Full feature implementation with PR creation When to use: New features that need code review Triggers:
  • Tasks with feature label, status todo
What it does:
  1. Creates feature branch (feature/TASK-123-...)
  2. Analyzes task requirements
  3. Posts implementation plan
  4. Implements feature with Claude Code
  5. Commits changes
  6. Pushes branch to remote
  7. Creates GitHub pull request
  8. Updates task with PR link
  9. Marks task as done
Timeout: 60 minutes Model: claude-haiku-4-5-20251001 Key Features:
  • Automatic branch creation
  • GitHub PR creation with detailed description
  • PR includes task identifier for tracking
  • Dependency caching for faster execution
# Best for: Feature development with PR workflow
anyt worker start --agent-id agent-xxx --workflow feature_dev

# Then create a task with feature label:
anyt task add "Add dark mode toggle" --labels feature --status todo

4. Feature with Quality Control (feature_dev_with_check)

Purpose: Enterprise-grade feature development with quality gates When to use: Production features requiring quality assurance Triggers:
  • Tasks with feature label, status todo
What it does: Pre-flight Checks:
  1. Verifies make check command exists (or lint/typecheck/test)
  2. Creates blocking task if quality commands missing
  3. Checks master branch is clean
  4. Creates cleanup task if uncommitted changes found
  5. Runs quality checks on master
  6. Creates fix task if quality checks fail
Implementation (only if all checks pass):
  1. Creates feature branch
  2. Analyzes task with quality considerations
  3. Implements feature
  4. Runs post-implementation quality checks
  5. Fails if quality checks don’t pass
  6. Commits only if all checks pass
  7. Marks task as done
Timeout: 90 minutes Model: claude-haiku-4-5-20251001 Key Features:
  • Automatic quality gate setup
  • Blocks on quality issues
  • Creates dependency tasks automatically
  • Ensures clean master branch
  • Post-implementation validation
  • Enterprise-ready quality control
# Best for: Production features with quality requirements
anyt worker start --agent-id agent-xxx --workflow feature_dev_with_check

# Requires: make check (or make lint, make typecheck, make test)
Quality Commands Required:
  • make lint - Run linting
  • make typecheck - Run type checking
  • make test - Run tests
  • make check - Run all checks (or individual commands)
If these don’t exist, the workflow automatically creates a setup task and blocks until it’s resolved.

Quick Start

1. Install AnyTask CLI

# Recommended: Install script
curl -fsSL https://anyt.dev/install.sh | sh
For other installation methods, see the Installation Guide.

2. Set Up Authentication

# Set agent API key
export ANYT_API_KEY=anyt_agent_xxxxxxxxxxxxx

# Initialize workspace
anyt init --workspace-id 123 --identifier DEV

3. Get Your Agent ID

  1. Visit https://anyt.dev/home/agents
  2. Create a new agent if needed
  3. Copy your agent identifier (e.g., agent-xxx)

4. Start Worker

# Start with ALL built-in workflows (recommended)
anyt worker start --agent-id agent-xxx

# Or start with specific workflow only
anyt worker start --agent-id agent-xxx --workflow local_dev

5. Create a Task

# For local_dev or dry_run (any todo task)
anyt task add "Fix typo in README" --status todo

# For feature_dev workflows (requires 'feature' label)
anyt task add "Add dark mode support" --labels feature --status todo
The worker will automatically detect the task, match it to a workflow, and execute it!

Choosing the Right Workflow

WorkflowUse CaseQuality GatesPR CreationBranch Management
dry_runTesting/validationNoNoNo
local_devQuick iterationsOptional (continues on fail)NoNo
feature_devStandard featuresNoYesAutomatic
feature_dev_with_checkProduction featuresYes (blocks on failure)NoAutomatic
Recommendations:
  • Testing setup? Use dry_run
  • Quick fix on current branch? Use local_dev
  • New feature needing PR? Use feature_dev
  • Production feature with quality requirements? Use feature_dev_with_check

Worker Output Example

[2025-11-15 10:00:00] Worker started
[2025-11-15 10:00:00] Agent ID: agent-xxx
[2025-11-15 10:00:00] Polling interval: 5s
[2025-11-15 10:00:00] Loaded workflows: dry_run, local_dev, feature_dev, feature_dev_with_check

[2025-11-15 10:00:01] Checking for available tasks...
[2025-11-15 10:00:02] Found task: DEV-42 (Add dark mode toggle)
[2025-11-15 10:00:02] Matched workflow: feature_dev
[2025-11-15 10:00:02] Starting attempt...

[2025-11-15 10:00:03] ✓ Started attempt #123
[2025-11-15 10:00:03] Executing workflow: Feature Development

[2025-11-15 10:00:04] Step 1/9: Create feature branch
[2025-11-15 10:00:05] ✓ Created branch: feature/DEV-42-add-dark-mode-toggle

[2025-11-15 10:00:06] Step 2/9: Analyze task requirements
[2025-11-15 10:00:15] ✓ Analysis complete

... (implementation steps) ...

[2025-11-15 10:25:30] Step 9/9: Mark task complete
[2025-11-15 10:25:31] ✓ Task marked as done

[2025-11-15 10:25:32] ✓ Workflow completed successfully
[2025-11-15 10:25:32] ✓ Finished attempt #123

[2025-11-15 10:25:33] Checking for available tasks...

Monitoring and Debugging

View Workflow Attempts

# List all attempts for a task
anyt attempt list DEV-42

# View detailed attempt information
anyt attempt show 123

# Download artifacts (like analysis, implementation summaries)
anyt artifact list 123
anyt artifact download 456 --output result.json

View Task Timeline

# See all events and updates for a task
anyt timeline DEV-42

# Filter recent events
anyt timeline DEV-42 --last 24h

Worker Logs

The worker outputs real-time logs to stdout. For production, redirect to a file or use systemd:
# Log to file
anyt worker start --agent-id agent-xxx > worker.log 2>&1

# Or use systemd (see Production Deployment below)
journalctl -u anyt-worker -f

Production Deployment

For production use, run workers as system services:
# Create systemd service file
sudo nano /etc/systemd/system/anyt-worker.service
[Unit]
Description=AnyTask Worker
After=network.target

[Service]
Type=simple
User=youruser
WorkingDirectory=/path/to/project
Environment="ANYT_API_KEY=anyt_agent_xxx"
ExecStart=/usr/local/bin/anyt worker start --agent-id agent-xxx
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
# Enable and start service
sudo systemctl enable anyt-worker
sudo systemctl start anyt-worker

# Check status
sudo systemctl status anyt-worker

# View logs
journalctl -u anyt-worker -f

Common Issues

”No workflows loaded”

Cause: Worker can’t find workflow files Solution: Built-in workflows are automatically loaded. If using custom workflows, check the path:
# List available workflows
anyt worker list-workflows

# Specify custom workflows directory
anyt worker start --agent-id agent-xxx --workflows-dir /path/to/workflows

“No tasks available”

Cause: No tasks match workflow triggers Solution: Check task status and labels:
# For local_dev or dry_run: needs status=todo
anyt task add "Test task" --status todo

# For feature workflows: needs status=todo AND feature label
anyt task add "Test feature" --status todo --labels feature

“Quality check failed” (feature_dev_with_check only)

Cause: Quality commands don’t exist or are failing Solution: The workflow automatically creates setup/fix tasks. Complete those first:
# Check what tasks were created
anyt task list --status blocked

# The workflow will have created dependency tasks - complete them first

Advanced Usage

For advanced scenarios including:
  • Writing custom workflows
  • Custom actions and steps
  • Complex trigger conditions
  • Multi-job workflows
  • Error handling strategies
  • Secrets management
See the Complete Worker Guide.

Next Steps

Support