An ordinary flow reads the data you pointed it at. A reusable flow says what it needs instead, and whoever runs it supplies the data: a person on a map, a caller of an API, or another flow.
You build it once. It then runs as a custom tool on a map, as a Flow API, and as a stage inside other flows.
Say what the flow takes in
Add a "Flow Input" stage wherever the flow should read data that changes from run to run. Give each one:
- a "Label", which is what people see when they run it;
- an "Input type": "Layer", "Table" or "Area";
- for a layer, the "Geometry" it accepts (leave all off to accept any);
- whether it is "Required";
- any "Field requirements" the data must meet.
A flow can have as many inputs as it needs.
Each input also has a "Sample". The sample is used only when you test or preview the flow. Nobody who runs the flow later ever gets your sample data. For an area, the sample is "Everything" unless you narrow the test to a rectangle.
Let people change a setting
Open any stage and turn on "Ask at run time" beside a setting. Whoever runs the flow is then asked for that value, with your label, help text and limits. The value you typed stays as the default.
Say what the flow gives back
End each branch you want to return with a "Flow Result" stage. Give it a label and a "Result type": a layer or a table. A flow can return several results.
A reusable flow returns its data through "Flow Result". It cannot also write files or tables on its own, so remove any writer stages.
Test it and save it
Choose "Actions", then "Make reusable…". The dialog lists what the flow takes in, what can be set, and what it returns. If something is missing, it says what, with a link to the stage.
Press "Test with sample data". The flow must pass a test before it can be saved, and changing the flow afterwards means testing again.
Then save. Each save is a new version, and a version never changes. Editing the flow later does not affect anything that already uses a saved version until you save again.
Use a flow inside another flow
Add a "Subflow" stage and choose a reusable flow. Its inputs become the stage's input ports, its results become output ports, and its run-time settings become the stage's settings.
A Subflow stage keeps the version you chose. When a newer one is saved, the stage offers to update, and changes only when you say so. The whole thing runs as one run, with one log.
Delete and restore
Deleting a flow moves it to the trash for 14 days. While it is there, the tools and stages built on it show "Source in trash" and cannot run. Restore the flow and they work again. After a permanent delete they show "Needs a source" and ask you to choose another flow.
Anything published to Tamaat Server keeps working either way.