Launch Rail Logo
Launch Rail
Documentation

Distributed Scheduler Service

A reliable, high-throughput task orchestration engine. Built for distributed cron jobs, delayed executions, and resilient work-flow scheduling at scale.

System Overview

The Scheduler service is the pulse of your application. It manages thousands of concurrent tasks, ensuring that whether a job is delayed by 5 seconds or 5 months, it executes precisely when it should, with guaranteed at-least-once delivery.

Distributed Cron

Standard cron expression support with high-availability coordination.

Delayed Tasks

Schedule work for a specific UTC timestamp or relative delay.

Resilient Retries

Configurable exponential backoff and dead-letter queues.

Worker Architecture

The service uses a leader-election model for the scheduler loop and a pull-based worker model for task execution, ensuring that no job is lost even if individual workers crash.

Entry Points
gRPC
MCP Agent
Service Logic
Domain Engine
Persistence
PostgreSQL
NATS Bus

Scheduling Jobs

Interact with the scheduler via ConnectRPC. Jobs are identified by a unique key to prevent accidental duplicate scheduling.

const response = await schedulerClient.createJob({
  job: {
    key: "onboarding.reminder:user-123",
    type: "HTTP_CALLBACK",
    schedule: {
      oneOff: {
        executeAt: { seconds: Date.now() / 1000 + 3600 } // 1 hour from now
      }
    },
    callbackConfig: {
      url: "https://api.myapp.com/webhooks/onboarding",
      method: "POST"
    },
    payload: {
      userId: "user-123",
      template: "welcome_reminder"
    }
  }
});

CLI Operations

Use the lr-ctl tool to inspect and trigger jobs manually during development.

launchrail-ctl — zsh
$
CLI SimulationActive

Observability & Monitoring

The Scheduler service emits real-time metrics for job performance, allowing you to track execution patterns and latency.

Execution Drift

Track the delta between the scheduled time and the actual start time to detect worker saturation.

Error Rates

Automated alerting on elevated task failure rates or exhausted retry attempts.

Enterprise Grade Distributed Cron

Managing cron at scale is notoriously difficult due to "double-execution" or "missed-window" bugs. The Launch Rail Scheduler service uses distributed locking and transactional guarantees to ensure your business-critical tasks never fail silently.

View Scheduler API Reference