Procedure DSL#
The CaptureGraph DSL (Domain-Specific Language) lets you define capture workflows as Python code. Procedures are structured as Directed Acyclic Graphs (DAGs) that serialize to JSON and execute on mobile devices.
Core Concepts#
| Concept | Description |
|---|---|
| Procedure | A node in the graph that does something (capture, compute, store) |
| PType | The type of data a procedure produces (PImage, PString, PVoid, etc.) |
| Target | The root project directory for a capture subject |
| Session | A timestamped subfolder for each procedure execution |
How Procedures Execute#
The iOS app processes your procedure graph by:
- Topologically sorting nodes to determine execution order
- Auto-running invisible nodes (computations, constants)
- Blocking on visible nodes until user input is provided
- Persisting all data at the end when the user completes the procedure
Section Contents#
Understand PTypes, the node taxonomy, and the PVoid workflow
File system structure and data organization patterns
Method chaining: .save(), .cache(), .load(), and more
Conditional logic, switch cases, and operator overloading
Pre-built modules for location, notifications, and thumbnails
Creating your own procedure nodes with @make_procedure