Skip to content

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:

  1. Topologically sorting nodes to determine execution order
  2. Auto-running invisible nodes (computations, constants)
  3. Blocking on visible nodes until user input is provided
  4. 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