leader-election

Manage leader election among distributed instances with automatic failover.

783|62|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/dadbodgeoff/drift --skill leader-election
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: leader-election
Source: https://github.com/dadbodgeoff/drift/tree/main/drift%20v1%20depreciated/skills/leader-election
Command: npx skills add https://github.com/dadbodgeoff/drift --skill leader-election

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill prevents multiple instances of a service from running critical tasks simultaneously, ensuring only one instance processes jobs or performs actions at any given time, and automatically handles failover if the leader instance becomes unavailable.

Core Features & Use Cases

  • Singleton Execution: Guarantees that only one instance of a service runs scheduled jobs, consumes from a queue, or acts as a coordinator.
  • Automatic Failover: If the current leader instance fails, another instance automatically takes over leadership.
  • Use Case: Running a daily report generation script where only one process should execute at a time to avoid duplicate reports or race conditions.

Quick Start

Use the leader-election skill to start the election process for the 'report-generator' service with the candidate ID 'worker-1'.

Frequently Asked Questions about leader-election

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I ensure singleton execution of cron jobs in a distributed system?

Automatic failover works by monitoring leader heartbeats and allowing follower instances to contend for leadership. If the current leader instance becomes unavailable, another instance automatically takes over to ensure continuous singleton execution of critical processes.

Does leader election work with both Python and TypeScript implementations?

To start leader election, use the Skill to initiate the election process for your service, specifying a unique candidate ID for the worker instance. This coordinates multiple distributed instances to contend for leadership and establish a single process for executing critical jobs.

When do I need leader election for my services?

To start leader election, use the Skill to initiate the election process for your service, specifying a unique candidate ID for the worker instance. This coordinates multiple distributed instances to contend for leadership and establish a single process for executing critical jobs.

How does automatic failover work when the leader instance fails?

Automatic failover works by monitoring leader heartbeats and allowing follower instances to contend for leadership. If the current leader instance becomes unavailable, another instance automatically takes over to ensure continuous singleton execution of critical processes.