Assign input values with scenarios
Scenarios are sets of values assigned to Start block inputs. You can define multiple scenarios with different values for inputs, and change between scenarios for different use cases. For example, scenarios are convenient when you’re testing flows that require the same inputs but different values for each test. They’re also useful when you want to use different input values for a beta or production deployment.
Start block inputs
You can add inputs to the Start block to receive data from a scenario. The Start block can then pass that data to other blocks as key-value pairs. The key is the input’s name and the value is any data received by the input.
Create a scenario
When you add inputs to the Start block, you can assign them values with a scenario. Your flow will then use the scenario’s values when it runs. To create a scenario, do the following:
1.Add one or more inputs to your Start block.
-
In the right sidebar, click
Scenarios > Create scenario. The scenario editor appears with editable fields for each input in the Start block. -
Enter data for each input field.
-
Click Save.
Run a flow using scenario data
Once you’ve created a scenario, you can run the flow using the scenario’s data as values assigned to the Start block’s inputs. To run a flow using a scenario’s data, do the following:
-
Click
Scenarios. -
Hover over the scenario you want to use and click Run. The flow runs using data defined in the scenario.
Secrets in scenarios
When adding inputs to the Start block, you can designate an input as Secret provided its value will be a string. Postman encrypts the values of Secret inputs and stores them securely, giving you a safe way to handle API keys or other sensitive values in your flows. Postman redacts them in run logs, Output blocks, and the Console, even when used in flows referenced by Flow blocks.
When you clone a flow that has a secret input, the input appears in the Start block and scenarios pane, but its value is left blank and is never present in the clone.
In the Scenarios pane, inputs designated as Secret in the Start block:
- Also have type
Secret.
- Are shown with their values masked by default.
What you can do with secret inputs depends on your permissions:
- Flow Editors can unmask secret inputs by clicking
Show. They can create, edit, and save secret input values.
- Runners can run flows with secret inputs, but can’t view their values. At runtime, Postman decrypts secret values if needed, without making them visible.
- Viewers can’t run flows with secret inputs, and can’t view the values of secret inputs.
Edit a scenario
You can change and save the values in a scenario. To edit a scenario, do the following:
-
Click
Scenarios. -
Hover over the scenario you want to edit and click Edit.
-
Enter new values in the input fields.
-
Click Save.
Rename a scenario
You can change a scenario’s name. To rename a scenario, do the following:
-
Click
Scenarios. -
Hover over the scenario you want to delete and click
the more actions icon > Rename.
-
Enter a new name.
-
Press the Return or Enter key.
Duplicate a scenario
You can make a copy of an existing scenario. To duplicate a scenario, do the following:
-
Click
Scenarios. -
Hover over the scenario you want to delete and click
the more actions icon > Duplicate.
-
Click Save.
Delete a scenario
To delete a scenario, do the following:
-
Click
Scenarios. -
Hover over the scenario you want to delete and click
the more actions icon > Delete.