Skip to content

Configure cron automations

Register a workflow automation that submits jobs on a cron schedule.

Use cron automations when a workflow should run on a schedule, such as hourly catalog checks, daily quality-control jobs, or recurring data processing.

Tilebox automations submit workflow jobs when their trigger condition matches. A runner on the target cluster still needs to execute the submitted tasks.

Create a task that can run from a scheduled trigger.

Python
from tilebox.workflows import ExecutionContext
from tilebox.workflows.automations import CronTask
class DailyCatalogCheck(CronTask):
def execute(self, context: ExecutionContext) -> None:
context.logger.info("Running daily catalog check", trigger=str(self.trigger))

Use the automation client to register a schedule and target cluster.

Python
from tilebox.workflows import Client
client = Client()
automations = client.automations()
automations.create_cron_automation(
"daily-catalog-check",
DailyCatalogCheck(),
cron_schedules=["0 6 * * *"],
)

The automation submits jobs. It does not execute them by itself. Start a runner that can execute the task identifier.

Python
runner = client.runner(tasks=[DailyCatalogCheck])
runner.run_forever()