Temporal Schedules are a replacement for traditional Cron jobs for task scheduling because this capability provides a more durable way to execute tasks, gain insight into their progress, enable observability of schedules and workflow runs, and lets you start, stop and pause them.
Challenges with Cron
Traditional cron schedulers are a standard, but they often struggle with complex scheduling needs in modern environments, lacking features like job pausing and detailed monitoring for long-running tasks. In addition, traditional cron schedulers rely on databases and have scalability issues.
Distributed Cron solutions, such as Kubernetes CronJobs, offer more scalable job scheduling by distributing workloads across a cluster. However, this scale comes at the cost of increased complexity and a steeper learning curve associated with Kubernetes.
Introducing Temporal Schedules
We're now announcing the general availability of our new Schedules feature. This enables you to execute Temporal Workflows at specified times or intervals, similar to Cron but far more powerful. And with Schedules, we now provide developers with controls to start, backfill, delete, describe, list, pause, trigger, and update a scheduled Workflow Execution with ease.
Schedules enhance the flexibility of scheduling Workflows within the Temporal platform, streamlining the process and providing a more powerful toolset for time-based Workflow management. More explicitly, they are better than Cron because of the following:
- Enhanced Workflow control and observability: Schedules improve the manageability of Workflows and allow for better monitoring, making it easier to track scheduled Workflow runs and address any issues swiftly.
- Flexible and extensible scheduling: Schedules are more adaptable and facilitate the definition of Tasks with varied schedules and intervals. This adaptability allows for more sophisticated scheduling needs, such as handling overlapping runs.
- Elimination of external dependencies: For Temporal users, Schedules remove the need to integrate external scheduling systems. This simplifies the Workflow process and reduces complexity.
“Temporal allows us to orchestrate all our tasks, so we are able to focus on the business case and less on plumbing. Schedules extend the value of Temporal. With it, the cost of maintaining healthy time precision & traceability is becoming more and more like the job of a watchmaker.” - Frederic Tu, at Airwallex, a Fintech company
How to use Schedules
Our Solution Architect, Keith Tenzer, wrote a great overview about how to create and view Schedules.
Schedules can be configured either by using the SDK or tctl. Schedules can be viewed using tctl or the Web UI. In this example, we demonstrate using tctl to configure a Schedule and the Web UI to display it.
First we use tctl to simply get a list of Workflows that have run. Note: the new Temporal CLI also supports Schedules. More information in our docs.
Next we schedule the preceding Workflow to run every 5 minutes. In addition to the information gathered by tctl, we also need to provide a Schedule ID (sid).
Using the new Schedule widget in the UI navigation bar, we can see Schedules listed by their corresponding Schedule ID.
From here we can drill into a schedule to see its details. We can also see the result of recent runs and even schedule time for future upcoming runs.
In addition, the Schedule can be paused or resumed. All of this is also possible with the tctl command.
We will soon be adding a video demonstration to showcase the capabilities of Temporal Schedules. Stay tuned for this exciting addition!
Schedules: Like Cron but better
The release of Temporal Schedules is a significant advancement in workflow scheduling. This feature transforms traditional Cron jobs into reliable, flexible Temporal Workflows that are easier to manage and monitor. Developers can now enjoy a clear view of their schedules and runs, with the added ability to perform a variety of operations such as start, backfill, pause, and update workflows seamlessly. Each Schedule has a unique id and can be managed independently; providing a structured and adaptable scheduling system, free from the complexities and rigidities of traditional Cron. The introduction of Schedules streamlines time-based workflow management, eliminates the need for external dependencies and enhances overall control and observability for developers within the Temporal platform.
As with all other Temporal capabilities, the Schedule feature is also available in Open Source. Support for Schedules has been added to the CLI and the Web UI, and APIs support has been added to the Go SDK, the TypeScript SDK (see sample), the JAVA SDK, the .NET SDK, and the Python SDK. Also, check out the Schedules docs.