We’re thrilled to announce the availability of the Temporal Worker scaler in the latest version of KEDA (v2.17.0). KEDA is a Kubernetes-based Event-Driven Autoscaling component. It provides event-driven scaling for any container running in Kubernetes. This solution empowers developers to dynamically scale the number of Temporal workers based on the size of the Task Queue backlog, enabling efficient resource utilization in Kubernetes environments.
This integration would not have been possible without contributions from our own Temporal community, as well as the maintainers of KEDA – thank you to all who were involved!
Why it matters
Scaling Temporal workers dynamically has several key benefits:
- Cost Efficiency: Scale workers down to zero when there’s no workload, reducing infrastructure costs.
- High Throughput: Automatically scale up during traffic spikes to meet demand and maintain SLAs.
- Operational Simplicity: Eliminate the need for manual scaling by relying on event-driven automation.
This approach is ideal for use cases where workloads are unpredictable or seasonal, such as e-commerce platforms, financial systems, and IoT data processing pipelines.
Auto-scaling demo
We’ve released a new demo that showcases KEDA-based auto-scaling for Temporal Workers. This demo highlights how you can use KEDA to automatically adjust the number of Temporal Worker pods in real time. By scaling Workers up or down based on Task Queue activity, you can ensure your workflows are processed efficiently, even during traffic spikes or periods of low activity.
The demo is built on Temporal’s Order Management System (OMS) reference application, which simulates a realistic e-commerce system with Workflows for order processing, payments, and shipments. With KEDA integration, this system can now handle variable workload demands without requiring manual intervention.
How the demo works
The demo uses KEDA’s Temporal scaler to monitor Task Queue backlogs and trigger scaling events based on predefined thresholds. For example, when the backlog of orders or shipments increases beyond a certain point, KEDA automatically scales up the Worker pods to process tasks more quickly. Once the backlog is cleared, the system scales back down to conserve resources.
The OMS web application now includes a page that enables you to visualize application load in real time—tracking order completion rates, Task Queue backlogs, and the number of active worker pods as scaling occurs.
Try it yourself
We’ve made it easy for you to explore this functionality with a preconfigured demo environment that includes all necessary components: Temporal Server, KEDA, and the OMS application itself. For detailed installation instructions, technical configurations, and source code, visit the GitHub repository.
What’s next?
We’re excited to see how you leverage this pattern to build scalable and cost-effective Temporal applications. Whether you’re orchestrating complex workflows or managing high-throughput systems, KEDA’s auto-scaling capabilities can help you optimize performance while simplifying operations.
We’d love to hear your feedback! Try out the demo and share your thoughts on GitHub or in our Slack community.
Community Shout-outs
We also want to take a moment to appreciate the following Community members who led the charge on this initiative over several attempts:
- Prajith P. who re-invigorated a previous attempt at introducing a Temporal Scaler with a fresh approach (#6191) and worked tirelessly to address and respond to feedback. Prajith is a DevOps Engineer at ClearTax who hails from India and is passionate about open-source software and innovations. His motivation for contributing to the KEDA scaler for Temporal is to give back to the open-source community and help build scalable solutions that benefit everyone.
- Ross P Smith, who spear-headed the initial attempt (#4724) at a Temporal KEDA scaler.
- Rob Holland and Chad Retz who reviewed the PRs and collaborated with Prajith on addressing feedback. Rob also produced the demo.
- Jan Hecking, who thoroughly tested the PR and gave detailed feedback on its performance.
- Nikitha Suryadevara and febinct who helped shepherd the PR process along at various key points.
From the KEDA side, we would also like to thank the following maintainers who reviewed and approved the PR that ultimately led to inclusion of Temporal support in KEDA:
- Jorge Turrado Ferrero (who also tagged the KEDA v2.17.0 release)
- Zbynek Roubalik