The Flow block
The Flow block references a flow from your workspace and outputs its result. This block lets you use the logic of multiple other flows in your current flow. By accepting input data and referencing other flows, Flow blocks can work like code functions.
Suppose you have two flows: flow A and flow B. Flow A checks the availability of meeting rooms in your office based on input data such as location, time, and room preference. It then outputs whether a room is available. Flow B can use a Flow block to send input data to flow A and retrieve its result (room availability), then use that result in its own logic (for example, to decide to send an API call that reserves the room).
The Flow block can reference any flow in your workspace that has a Start block and at least one snapshot. Snapshots are saved versions of a flow. To learn more, see Version flows with snapshots.
Inputs
By default, the Flow block has one Run input port and one input port for each input present in the Start block of the flow it references. When the Run port receives data, it triggers the Flow block. If it’s not connected, the Flow block triggers when its host flow runs.
If the referenced flow has a Start block with inputs, the Flow block will also have input ports that correspond with the Start block’s inputs. For example, if a Flow block references a flow with three inputs defined in its Start block, the Flow block will have three input ports with the same names and data types as the Start block’s inputs. Data sent to the Flow block’s input ports will be passed to the corresponding Start block inputs in the referenced flow.
When the referenced flow has Start block inputs, the Flow block must receive data in each of its corresponding input ports to trigger the referenced flow.
Configurations
If the referenced flow uses configurations, the Flow block has a Configurations section with one input port for each configuration. The section’s heading shows how many configurations the referenced flow has.
The Flow block doesn’t use the values you set in the referenced flow. Instead, your flow provides the values. Send a value to each configuration port, such as a string, number, or boolean, or the output of a Get Configuration block in your flow.
Outputs
The Flow block has one output port for each input port in the referenced flow’s Output block. Each output port sends the value received by its corresponding input port in the referenced flow’s Output block.
If the referenced flow’s Output block has Include test data in output turned on, the referenced flow’s test results come through a single Flow tests output, not through each output port.
The Flow block also has a Done output port that sends a boolean true signal when the referenced flow has completed.
Setup
When you add a Flow block, it prompts you to select a flow to reference. The Flow block can only reference flows in your workspace that have a Start block and one or more snapshots.
To set up a Flow block, do the following:
-
Create a flow and add a Flow block. A list of flows you can reference appears.
If the list is empty, make sure the flow you want to reference has a Start block and at least one snapshot.
-
Select a flow from the list. The Flow block appears with the same title as the referenced flow. The latest snapshot number appears next to the title. When a newer snapshot is available, a dot indicator appears on the
Snapshots icon. Hover over the icon to see a tooltip that says a newer snapshot is available. To control whether the block stays on the latest snapshot, see Select a different snapshot.
Select a different snapshot
When you add a Flow block, it automatically selects the latest snapshot of the referenced flow.
To select a different snapshot, do the following:
-
In the Flow block, click
Snapshots.
-
Turn off Always use latest. This setting is turned on by default, and you can’t select a different snapshot while it’s turned on.
-
Select a snapshot from the dropdown list. The Flow block uses the selected snapshot of the referenced flow.
To pin the Flow block to the latest snapshot again, turn on Always use latest. While it’s turned on, Postman automatically moves the block to each new snapshot when it’s published.
If the Flow block isn’t using the latest snapshot and a newer one is published, a banner appears on the block. To use the new snapshot, click Update. To keep your selected snapshot, click Dismiss. Switching between existing snapshots doesn’t trigger the banner.
Example
To see the Flow block in action, check out Flow Snippets: Flow block.
Related blocks
The Start block is automatically added to every new flow. The Output block sends the result from one flow to a Flow block in a different flow.