Function containers on Cycle have always been the efficient way to run batch jobs and workloads, with far more customization than traditional FaaS or serverless. What they couldn't do was run themselves. Over the past year, team after team told us the same thing: they wanted these functions on a schedule without standing up and babysitting a cron service. As of this release, Cycle fully supports CRON scheduled function containers.
When adding features to our platform, we try to be deliberate about how we architect a solution. Something that looks straightforward, let a function container run on a schedule, has to answer for availability, atomicity, and outcomes before it ships. Lets take a look at some of the supporting work the team did leading up to this and then dive into how to use the new scheduled function containers.
Developing Scheduled Functions
While our team was bringing this feature to the platform, we found that there were a few things we wanted to improve along the way:
- Higher availability out-of-the-box for the scheduler service
- Better queue handling for triggered functions
In a recent release, we introduced HA elections for containers - exposing a native platform interface for Cycle developers to ask for elections. We implemented this feature natively into our gateway service (which now supports static egress IPs) and then our scheduler service which adds redundancy to the service which is responsible for bringing the function container online.
On top of that, we wanted to make sure that the scheduler queue was as robust as possible so we also increased its ability to handle trigger events even when there are no available function instances at the time of the work being scheduled.
Both changes were load-bearing for scheduled functions, and together they improve reliability and the experience of using scheduled functions.
Scheduling Functions
The new scheduled functions consist of two fields added to the container deployment configuration:
- Enable Schedule
- Schedule (Cron)
Enable schedule is basically just an on off switch for the Cron string. Disabling this setting would allow a Cycle developer to leave the Cron string in place but temporarily halt the execution.
The Cron string itself respects the Unix standard and officially supported extensions like @daily.
Functions that have scheduling enabled are able to be triggered through the scheduler API or platform API via Create Function Job - they are not bound to only run during scheduled executions.
A Quick Example: Nightly Database Session Cleanup
A very simple example, if you'd like to test this feature, is clearing the expired sessions that pile up in a database (in this case Postgres).
To keep things super simple, we'll use an official image and mount a script to the container so we don't have to manage a custom container image.
The postgres:16-alpine image works for this (or if you're using MySQL or a different db use that official image + version):
- Add it as a DockerHub image source in the portal and then import a copy.
- Create a container with the deployment strategy as
functionthat uses the imported DB image. - Create a file type scoped variable in that environment, use the
blobcheckbox and paste in the following script.
#!/bin/shset -eif [ -z "$DATABASE_URL" ]; then echo "DATABASE_URL is not set" >&2 exit 1fi
psql "$DATABASE_URL" -c "DELETE FROM sessions WHERE expires_at < now();"echo "expired sessions cleared"Set the container configuration under deployment > function to enable schedule and use the every minute Cron string * * * * *.
Watch it for a few minutes and you'll see the scheduler and function in action, on the minute, or for a more real world test set it to @daily and come back to check on it tomorrow.
Let Us Hear About It
Thanks for taking the time to read through this announcement. We hope you enjoy this useful new feature and we would love to hear from you about your experience. In case its been a while since you've been in touch here are some great ways to get in touch with us:
If you're new to Cycle and want to see functions or any other part of the platform in action - schedule a demo here.

