Relay offers self-hosted event-driven runtime for functions and services
GitHub user sergiors released Relay, an open-source runtime that manages serverless functions, cron schedules, and persistent services on infrastructure you control.
Cet article n’est disponible qu’en anglais.
On October 7, 2026, GitHub user sergiors introduced Relay, a new open-source project designed to run event-driven applications on self-managed infrastructure. This runtime allows developers to deploy serverless-style functions, scheduled tasks, and long-running services within a single declarative model, removing the need for proprietary cloud platforms.
What happened
Relay acts as a unified execution environment that handles three distinct types of workloads: ephemeral functions triggered by external events, functions triggered by time-based schedules, and persistent services that run continuously. The system is built around the concept of an "app," which serves as the single unit for source code, configuration, and deployment. Within this app, developers can mix short-lived functions with long-running processes like APIs or workers, all sharing the same networking, secrets, and resource controls.
The runtime relies heavily on Redis Streams to manage message passing and state. When an external event occurs, it enters a Redis Stream where Relay classifies it against declarative patterns to find the appropriate handler. Scheduled tasks follow a similar path but bypass pattern matching, resolving directly to their configured handlers. Both types of function executions benefit from shared infrastructure for retries, dead-letter queues, and invocation state tracking. Persistent services, however, operate outside this event pipeline, running as continuously reconciled containers that share the app’s configuration but maintain their own lifecycle.
Key details
- Unified deployment model: Functions, schedules, and persistent services are declared together in one app configuration, simplifying management and ensuring consistent access to secrets and environment variables.
- Redis Stream backbone: External events and schedule occurrences are published to Redis Streams, enabling at-least-once delivery, durable outboxes for retries, and cluster-wide deduplication for scheduled tasks.
- Managed runtimes: The platform supports Python 3.14 and Node 24 (including TypeScript), utilizing warm containers to reduce cold start times while enforcing bounded concurrency limits.
- Precise scheduling: Cron jobs support minute-precision timing with IANA timezones, deterministic occurrence identities, and startup catch-up mechanisms to handle missed executions during downtime.
- Resource isolation: Each container can have specific memory, CPU, and PID limits, ensuring that heavy workloads do not starve other services within the same host.
- Observability suite: Built-in support for Prometheus metrics, structured logs, and OpenTelemetry tracing provides visibility into function performance and system health without external agents.
Background
To understand Relay, it helps to distinguish between serverless functions and traditional services. Serverless functions are "stateless" and "ephemeral," meaning they spin up, execute a specific task in response to a trigger, and then shut down. This model is efficient for sporadic workloads but often requires complex orchestration when mixed with long-running processes like web servers or background workers. Traditionally, teams would use separate tools for these needs: a cloud provider for functions, a cron daemon for schedules, and Docker or Kubernetes for services.
Relay attempts to bridge this gap by providing a single runtime process that manages all three workload types. It uses Redis Streams as a central nervous system for event distribution. Redis Streams are a data structure that allows for reliable message processing, consumer groups, and history retention, making them ideal for building robust event-driven architectures. By handling the complexity of message routing, retry logic, and container lifecycle management internally, Relay aims to offer the developer experience of a managed cloud platform while remaining fully self-hostable.
Why it matters
For teams that self-host their software, managing the infrastructure for event-driven architectures is often a significant operational burden. Cloud providers offer convenient solutions for serverless functions and managed queues, but these come with vendor lock-in, unpredictable costs, and data residency concerns. Relay provides a way to replicate this functionality on-premises or in private clouds, giving organizations full control over their data and execution environment. This is particularly valuable for companies with strict compliance requirements or those looking to optimize costs by utilizing existing hardware more efficiently.
Furthermore, the unification of functions and services reduces architectural fragmentation. Instead of maintaining separate CI/CD pipelines, monitoring stacks, and configuration stores for different types of workloads, teams can manage everything through a single declarative interface. This simplification can lead to faster development cycles and easier troubleshooting, as the boundaries between event triggers, scheduled tasks, and persistent APIs are blurred within a consistent operational model. The ability to run both short-lived and long-running processes with shared resource controls also improves hardware utilization, preventing the waste associated with over-provisioning separate environments.
What you can do
- Evaluate your current workload mix: Identify if your team is juggling multiple tools for cron jobs, webhooks, and background workers, and consider if a unified runtime could simplify your stack.
- Test the runtime locally: Clone the Relay repository and use the
relay startcommand to run the process in the foreground, supervised by Docker or systemd, to assess its resource footprint. - Review Redis dependencies: Ensure your infrastructure can support the required Redis Stream usage, including persistence and memory allocation for high-throughput event processing.
- Map existing cron jobs: Audit your current scheduled tasks to see if they would benefit from Relay’s deterministic occurrence identities and startup catch-up features.
- Check language compatibility: Verify that your existing functions are compatible with the supported runtimes, specifically Python 3.14 or Node 24, before planning a migration.
- Configure observability early: Set up Prometheus and OpenTelemetry collectors to capture metrics and traces from the start, leveraging Relay’s built-in instrumentation for immediate visibility.



