time.sleep stands in for real work such as downloading scenes, processing tiles, calling a model, or writing output files.
Prerequisites
- You have a Tilebox API key.
- You have installed
uv. - You have installed the Tilebox command-line tool if you want to use
tilebox parallel.
Create the workflow file
Create a file namedparallel_workflow.py. The script uses inline uv dependencies, so you can run it directly with uv run parallel_workflow.py.
parallel_workflow.py
ParallelSleepWorkflow, does not do the slow work itself. It submits many independent SleepTask subtasks. Tilebox tracks the tasks in one job and lets any eligible runner claim queued work.
Submit a job
Submit one job with 20 subtasks. The script exits after submitting the job, so no work is executed yet.Output
Run one direct runner
Start one direct runner from the same file.Run five direct runners
Submit another job, then start five runner processes for the same workflow file.SleepTask instances run at the same time.
What to expect
The first runner to claimParallelSleepWorkflow submits the subtasks. After that, all runners can claim compatible SleepTask tasks from the same job.
In the Console, you should see:
- one root task that submits the subtask fan-out
- many
SleepTask(index)tasks - multiple tasks running at overlapping times when five runners are active
- logs from each task attached to the same job
Next steps
Runners
Learn how runners claim queued tasks and how direct runners differ from release runners.
Tasks
Learn how parent tasks submit subtasks, define dependencies, and report progress.
Debug a failed workflow run
Inspect task state, logs, traces, runner context, and cluster alignment.