Skip to main content

Module schedule

Module schedule 

Source
Expand description

What the step scheduler needs to know about a graph, and the rules a graph with a loop must meet (docs/specs/SPEC_DRONE_GENERAL_AUTOMATION_2026_11_11.md §3.1). Pure: nothing here runs a block.

A graph may hold a cycle, but every cycle must pass through a Condition, which is the loop’s guard. A guard has max_iterations (1 to 1,000, 25 when absent), on_cap (end_run, the default, or exit_loop), and optionally max_cost_usd and max_minutes. Each time a guard sends the run along an edge that stays inside its cycle that is one more iteration; the scheduler stops the loop at any cap.

Structs§

ForEachConfig
A for-each block’s settings (§3.1). The body is one block of the graph, named by id, that has no edges of its own and runs once per item.
Guard
A Condition that sits on a cycle.
Issue
A reason a graph cannot run, for the author: which block, and what to do.
Plan
What the scheduler reads of a graph that passed analyze.

Enums§

OnCap
What happens when a loop reaches its max_iterations.
OnItemError
What a for-each does when one item’s body fails.

Constants§

DEFAULT_MAX_ITEMS
DEFAULT_MAX_ITERATIONS
MAX_ITEMS_CEILING
MAX_ITERATIONS_CEILING
MAX_TIMEOUT_SECONDS 🔒
The longest a block may be given to run: a day.

Functions§

analyze
Check the graph’s loops and say how the scheduler should run it. A graph with no cycle gets an empty plan.
check_block_limits 🔒
Each block’s own timeout_seconds and retry are well formed.
check_foreach 🔒
Check each for-each: its settings, and that its body is a block of the graph that is not wired into it, is not a for-each, and is not another one’s body.
check_joins 🔒
Each Join is set rightly and has branches to bring together.
closure 🔒
Every pair (u, v) with a path of one edge or more from u to v, following only edges between nodes keep allows.
cycle_group 🔒
u and everything on a cycle with it.
foreach_config
Read and check a for-each block’s settings.
kind_of 🔒
names 🔒
positive 🔒
read_guard 🔒
Read a guard’s settings. Errors are issues, so a bad value is named, not guessed.
timeout_seconds 🔒
A block’s own timeout_seconds, when it has one: a whole number from 1 to a day.
walk_back_edges 🔒
The edges that close a cycle, found by a walk from the blocks nothing leads to, and the blocks that walk never reached.