How to retry all failed jobs from Redis queue in Laravel Horizon

Stefan Bogdanescu

Founder & Senior Architect · 2026-06-29

Laravel Company

How to Retry All Failed Jobs from Redis Queue in Laravel Horizon

As a senior developer working with high-throughput applications, we often encounter scenarios where batch operations, especially error recovery, become critical. When using Laravel Horizon with Redis queues, developers frequently ask: "How do I retry all the jobs that have failed? There's no obvious 'Retry All' button in the UI, and standard artisan commands seem insufficient because the failed jobs aren't neatly stored in a database table."

This post dives deep into the mechanics of Laravel Horizon and Redis to provide a definitive, developer-centric solution for bulk job recovery.

Understanding the Horizon Limitation

The reason you don't find a simple "Retry All" button is rooted in how queue management systems are typically architected. Laravel Horizon provides an excellent visual interface for monitoring queues and managing individual jobs or small batches of failed jobs. However, when dealing with massive scale or specific failure states in Redis, the mechanism relies on direct interaction with the underlying queue structure rather than a simple CRUD operation within the main application database.

Failed jobs are typically stored as metadata or moved to dedicated "failed" lists within Redis. To retry them wholesale, we need to bypass the standard UI and interact directly with the Redis instance that Horizon is monitoring.

Method 1: The Advanced Approach – Direct Redis Interaction

Since Laravel Horizon leverages Redis for its queuing mechanism, the most robust way to handle a bulk retry is by leveraging the underlying Redis connection, often accessed via the Illuminate\Support\Facades\Redis facade or by interacting with the queue driver directly.

While direct manipulation of Redis keys can be complex and risky if not handled carefully, we can focus on using Horizon's internal structure to trigger a mass retry mechanism if one exists, or manually re-queueing based on failure status.

A safer, more idiomatic approach within the Laravel ecosystem is to use the queue system itself to force a reprocessing of failed items, often by manipulating the state stored in Redis. For true bulk operations, you must understand the specific keys Horizon uses for tracking failures.

Here is a conceptual example focusing on how you might identify and re-queue jobs if you were implementing custom retry logic outside of the standard Horizon interface:

use Illuminate\Support\Facades\Redis;
use App\Jobs\MyFailingJob;

class RetryBulkJob
{
    public function handle()
    {
        // In a real scenario, you would query Redis keys associated with failed jobs.
        // Since Horizon abstracts this heavily, the most practical approach is often 
        // to re-queue based on a known set of IDs or by using specific queue commands.

        $failedJobIds = $this->getFailedJobKeysFromRedis(); // Hypothetical function to retrieve keys

        foreach ($failedJobIds as $jobId) {
            // Use the Redis command to move the job back to the primary queue 
            // (assuming 'failed' jobs are stored in a specific list or hash).
            Redis::lpush('redis_queue_name', $jobId); // Example: Move job back to processing queue
        }

        // Note: Actual implementation requires deep knowledge of how Horizon structures failure data.
    }
}

Best Practice Tip: Instead of attempting raw Redis manipulation, always look for official Laravel queue commands or features first. For general queue management advice, understanding the principles behind robust data handling is key, much like with Eloquent relationships discussed on laravelcompany.com.

Method 2: Leveraging Horizon and Configuration (The Practical Route)

If direct Redis manipulation feels too invasive, focus on configuration and external orchestration. If you are using a custom queue setup or specific driver configurations within your Laravel application, ensure that your failure handling logic resides within the job itself.

For mass retries, consider setting up a scheduled Artisan command that iterates over potential failed job identifiers (if they are logged somewhere accessible) and uses the built-in dispatch() method to re-queue them. This shifts the burden from trying to force Horizon into an unexpected bulk operation to using standard Laravel tools for orchestration.

Conclusion

Retrying all failed jobs in Laravel Horizon is less about finding a single "Retry All" button and more about understanding the underlying system architecture of Redis queuing. While direct manipulation is possible, it requires deep knowledge of how Horizon maps job failures to Redis keys. For most production environments, the recommended strategy involves:

  1. Monitoring: Rely on Horizon's excellent dashboard for immediate, targeted error investigation.
  2. Orchestration: Implement scheduled Artisan commands that query your application's failure log (if you maintain one) and use dispatch() to re-queue jobs programmatically.

By combining the power of Laravel’s queue facade with solid Redis knowledge, you gain full control over your job recovery process, ensuring resilience in your high-volume applications.