Automate with Loops, Watch, and Schedules
Flux provides three session-based automation mechanisms. Flux must remain open for all three.
#Scenario: monitor tracker work
#Repeat an agent check
While investigating generated data, ask Flux to recheck it every 15 minutes:
/loop 15m inspect data/deprecations.json and report shutdowns in the next 60 days
Stop it with /loop stop.
#React to scraper edits
The repository already has checks. Run the command once yourself, then watch the scraper directory:
/watch scraper python -m pytest -q
Stop it with /watch stop. Watch commands run directly in your shell, so use only commands you trust.
#Save a timed review
Create a weekday morning prompt:
/schedule add "0 9 * * 1-5" review data/deprecations.json and summarize shutdowns in the next 30 days
Use /schedule list, then enable, disable, or remove a task by ID.
#Choose the right mechanism
| Need | Use |
|---|---|
| Repeat an agent prompt during this session | /loop |
| Run a command after a file changes | /watch |
| Save a cron prompt that runs while Flux is open | /schedule |
| Run after logout or in CI | An external scheduler with flux run or flux -P |
#Expected result
Tracker reviews repeat at the right trigger without treating Flux as an unattended system service.
Next: Use Memory Across Sessions.