Getting Started
Tasker is a Rails engine that provides workflow orchestration through atomic, retryable steps. This guide introduces the core framework concepts and installation methods.
Core Framework Concepts
Tasks and Steps
Tasks represent complete workflows (e.g., "process_order", "sync_data")
Steps are atomic units of work within a task (e.g., "validate_cart", "charge_payment")
Step Dependencies define execution order through
depends_on_steprelationships
YAML Configuration
Tasks are defined declaratively in YAML files:
# config/tasker/tasks/ecommerce/order_processing.yaml
name: process_order
namespace_name: ecommerce
version: 1.0.0
step_templates:
- name: validate_cart
handler_class: Ecommerce::ValidateCartHandler
- name: process_payment
depends_on_step: validate_cart
handler_class: Ecommerce::ProcessPaymentHandler
default_retryable: true
- name: send_confirmation
depends_on_step: process_payment
handler_class: Ecommerce::SendConfirmationHandlerStep Handlers
Ruby classes that implement the business logic for each step:
State Management
Task States:
pending,processing,completed,failedStep States:
pending,processing,completed,failed,cancelledRetryable vs Permanent Failures: Different error types trigger different retry behaviors
Event System
Tasker publishes 56 built-in events for observability:
Installation Methods
Quick Demo Installation
For trying Tasker with complete demo workflows:
Existing Rails Application
To add Tasker to your existing Rails app:
1. Add to Gemfile
2. Install and Setup
3. Mount the Engine
4. Configure (Optional)
Framework Architecture
Rails Engine Structure
Mounts at
/taskerin your applicationDatabase tables for tasks, steps, and execution tracking
SQL functions for high-performance workflow analysis
Background jobs for async step execution
Core Components
Task Handler
Manages overall workflow execution:
Step Execution
Steps run through the orchestration engine:
Dependency Resolution: Determines which steps can run
Parallel Execution: Independent steps run concurrently
Error Handling: Retryable vs permanent failure logic
State Persistence: Progress saved between executions
SQL Functions
High-performance PostgreSQL functions for:
Dependency Analysis: Finding ready-to-run steps
State Transitions: Atomic state updates
Performance Metrics: Analytics and monitoring
Creating Your First Workflow
1. Generate Task Structure
This creates:
Handler class:
app/tasks/welcome_user/welcome_user_handler.rbYAML config:
config/tasker/tasks/welcome_user/welcome_user.yamlTest file:
spec/tasks/welcome_user/welcome_user_handler_spec.rb
2. Define Step Templates
3. Implement Step Handlers
4. Execute the Workflow
Next Steps
Framework Exploration
Core Concepts - Deeper dive into framework architecture
Step Handler Best Practices - Patterns for reliable step handlers
Event System - Complete event reference and custom subscribers
Real-World Examples
E-commerce Workflows - Order processing, inventory, payments
Data Pipeline Workflows - ETL, data validation, report generation
Microservices Coordination - API orchestration, circuit breakers
Production Setup
Authentication & Authorization - Securing workflow access
Health Monitoring - Kubernetes-ready health checks
Metrics & Observability - Prometheus, OpenTelemetry, custom metrics
Ready to build reliable workflows? Start with the 5-minute quickstart to see complete examples in action.
Last updated