Example: Flows Manager
10 min
end to end walkthrough create a node red flow, start it, download a backup of its file, then clean up setup from litmussdk import flows the flow content itself (nodes, wires, tabs) is managed via node red's api directly; this sdk only handles the flow lifecycle (create, start/stop, update, delete) and file download 1\ create a flow create flow returns a stopped, empty flow the node red ui or api is then used to populate its tabs flow = flows create flow( name="my flow", secret="my flow secret", memory limit=256, ) flow id = flow\["id"] print(f"created flow {flow id}") 2\ start the flow flows start flow(flow id) the flow is now running calling start flow again raises an error 3\ list flows and find yours all flows = flows list flows() me = next(f for f in all flows if f\["id"] == flow id) print(f"name={me\['name']} memory limit={me\['memory limit']}") 4\ update a flow flows update flow( flow id=flow id, name="my flow (renamed)", memory limit=512, ) 5\ download the flow file (4 0 x+) the flow's json definition can be downloaded as bytes for backup or air gap deployment as of sdk 2 6 0 , this returns proper bytes; prior versions silently corrupted binary content via utf 8 decode content bytes = flows download flow file(flow id) with open("my flow\ json", "wb") as f f write(content) logs work the same way logs bytes = flows download flow logs(flow id) with open("my flow\ logs", "wb") as f f write(logs) both functions raise unsupportedversionerror on litmus edge 3 x 6\ delete flow artifacts (4 0 x+) clean up individual files without deleting the flow itself flows delete flow logs(flow id) flows delete flow node modules(flow id) flows delete flow credentials(flow id) flows delete flow flows json(flow id) 7\ stop and remove the flow flows stop flow(flow id) flows remove flow(flow id) see also flows manager docid\ llyidmwf8xc7evu7mjik6 full reference air gap features docid\ dmvq8b6h macksn07230r bundling flows into deployment templates