Run a flow in CI/CD
Run a flow in CI/CD
You can generate a Postman CLI command from an open flow and add it to your CI/CD pipeline to run local and deployed flows. You can include collections and an environment in the same configuration to run them alongside the flow.
Cloud runs vs. local runs
The generated Postman CLI configuration runs the flow in one of two ways, depending on whether you select Run locally:
- Run locally not selected (default) — The command uses
postman flows triggerto run a deployed flow in the Postman cloud. The flow must be deployed before you generate the configuration. - Run locally selected — The command uses
postman flows runto run the flow’s local files directly on your machine. The flow’s local files must be accessible to the CI/CD runner, typically by including them in the same repo as your build configuration. You can use this option if the flow calls private APIs that aren’t reachable from the Postman cloud. To create a flow’s local files, use Local View in the Postman desktop app. This option is available with Postman Enterprise plans.
Generate the Postman CLI configuration
To generate the Postman CLI configuration for a flow, do the following:
-
Open the flow you want to run in your CI/CD pipeline.
-
In the upper right, click
More options and select Run in CI. The Generate Postman CLI Configuration page opens with the current flow already selected under Flows.
-
(Optional) Under Choose the items you want to run, do any of the following:
- Select a Collection to run during pipeline builds, and select an Environment to use. Click
Add Another Collection to include multiple collections.
- Under Flows, click
Add Another Flow to include additional flows.
- Select a Collection to run during pipeline builds, and select an Environment to use. Click
-
(Optional) To run the flow’s local files on your CI/CD machine instead of triggering the deployed flow in the Postman cloud, select Run locally. See Cloud runs vs. local runs for the differences between the two modes.
-
Under CI/CD configuration, select a CI/CD Provider and an Operating system for CI/CD.
-
Review the generated command under Postman CLI command preview.
-
Click Copy Postman CLI Command to copy the command to your clipboard.
-
Paste the command into your build configuration file. This process depends on your CI tool.
To learn more about the underlying commands and their options, see postman flows trigger and postman flows run. To learn more about running other Postman elements in CI/CD, see Run tests in CI/CD pipelines.