Loading flows from Git
Keep flows and resources in a Git repository and let flowgen load them: a flow with git_sync pulls the repository and writes every flow and resource into the system cache, where the runtime picks them up.
Repository layout
One repository carries both directories under the configured path:
<path>/
├── flows/
│ └── orders/sync.yaml
└── resources/
└── scripts/transform.rhai Flow
examples/git/sync_workspace.yaml mirrors the directory tree into the system cache:
- A
bufferwithflush_on_completioncollects each pull into one batch. - A script routes each file by its top-level directory.
flows/*are keyed by the path with theflows/prefix and the file extension stripped, matching the flow’s path-based identity.resources/*are keyed by the path with theresources/prefix stripped. Any other file, such as aREADME.md, is dropped. - Two
nats_kv_storeentry puts withprune: truewrite new and changed keys and delete the keys the repository no longer holds.
A batch cut short by the buffer timeout is skipped, and the flows put leaves allow_empty off, so a partial or empty pull deletes no flows.
When the repository HEAD has not moved, git_sync skips the file walk, so a tick without changes costs one git fetch. See Resources for how the runtime reads back from resources.*.
Publishing changes
To change flows from the web UI and commit them to the same repository, see Authoring.