Skip to main content

Overview

When using the Celery runtime (runtime: celery), PyWorkflow requires a message broker to transport messages between your application and workers, and optionally a result backend to store task results.
This guide only applies when using the Celery runtime for distributed execution. The local runtime (runtime: local) runs workflows in-process and does not require a broker.
PyWorkflow supports several broker configurations:

Redis

Simple, fast, and recommended for most deployments

Redis Sentinel

High-availability Redis with automatic failover

Redis

Redis is the recommended broker for most PyWorkflow deployments. It’s simple to set up, provides excellent performance, and supports both broker and result backend functionality.

Basic Configuration

URL Format

Examples

TLS/SSL Connection

For encrypted connections, use the rediss:// scheme:
When using rediss://, ensure your Redis server is configured with TLS certificates.

Redis Sentinel

Redis Sentinel provides high availability for Redis through automatic failover. When a master node fails, Sentinel automatically promotes a replica to master, ensuring your workflows continue processing with minimal interruption.

When to Use Sentinel

Use Redis Sentinel when you need:
  • High availability: Automatic failover when master fails
  • Monitoring: Constant health checks on Redis instances
  • Notification: Alerts when Redis instances change state
  • Configuration provider: Clients discover current master automatically

Basic Configuration

URL Format

Configuration Options

Examples

TLS/SSL with Sentinel

For encrypted connections to Sentinel, use the sentinel+ssl:// scheme:

Sentinel Architecture

A typical Sentinel deployment consists of:
Always deploy at least 3 Sentinel instances in production. Sentinel uses quorum-based decision making, and a single Sentinel cannot reliably detect failures.

Configuration Reference

Environment Variables

CLI Options

See the CLI Guide for all available worker options including autoscaling, task limits, and arbitrary Celery argument passthrough.

Config File Options


Choosing a Broker

Most cloud providers offer managed Redis services with built-in high availability. These are often easier to operate than self-managed Sentinel clusters.

Troubleshooting

Connection Refused

Solution: Ensure Redis is running and accessible:

Sentinel Master Not Found

Solutions:
  1. Verify the master name matches your Sentinel configuration
  2. Check that Sentinel instances are running and healthy
  3. Ensure network connectivity between your application and Sentinel

Authentication Failed

Solution: Include password in the URL:

Next Steps

CLI Guide

Learn CLI commands for worker management

Configuration

Complete configuration reference

Fault Tolerance

Learn about automatic recovery

Workflows

Learn workflow concepts