Introduction

Tilebox Workflows can execute jobs in two ways: a one-time execution triggered by a user, typically a batch processing, and near-real-time execution based on specific external events. By defining trigger conditions, you can automatically submit jobs based on external events.

Tilebox Workflows currently supports the following trigger conditions:

Dataset Event Triggers, which will trigger jobs when new data points are ingested into a Tilebox dataset, are on the roadmap. Stay tuned for updates.

Recurrent Tasks

To create a trigger, define a special task that serves as a prototype. In response to a trigger condition met, this task will be submitted as a new job. Such tasks are referred to as recurrent tasks.

Each recurrent task has a task identifier, a version, and input parameters, just like regular tasks. Recurrent tasks also automatically provide a special trigger attribute that contains information about the event that initiated the task’s execution.

Recurrent Task Client

The Tilebox Workflows client includes a sub-client for managing recurrent tasks. You can create this sub-client by calling the recurrent_tasks method on the main client instance.

Listing Registered Recurrent Tasks

To list all registered recurrent tasks, use the all method on the recurrent task client.

Python
from tilebox.workflows import Client

client = Client()
recurrent_tasks = client.recurrent_tasks()

recurrent_tasks = recurrent_tasks.all()
print(recurrent_tasks)
Output
[
    RecurrentTaskPrototype(
        name='Run MyCronTask every hour at 15 minutes past the hour',
        prototype=TaskSubmission(
            cluster_slug='dev-cluster',
            identifier=TaskIdentifier(name='MyCronTask', version='v0.0'),
            input=b'{"message": "Hello"},
            dependencies=[],
            display='MyCronTask',
            max_retries=0), 
        storage_event_triggers=[],
        cron_triggers=[CronTrigger(schedule='15 * * * *')],
    )
]

Registering Recurrent Tasks

To register a recurrent task, use the create_recurring_... methods specific to each trigger type provided by the recurrent task client. Refer to the documentation for each trigger type for more details.

Overview in the Tilebox Console

You can also use the Tilebox Console to manage recurrent tasks. Visit the recurrent tasks section to check it out.

You can also register new recurrent tasks or edit and delete existing ones directly from the console.