Executing custom scripts/operations in Postman Flows

Background:
I have been using Postman Collection to automate extraction and parsing of body of API responses. This can be done via the Pre-request and Tests scripts that are executed before and after the Request is made.

I am able to perform tasks such as JWT Token Parsing, string manipulations, as well as various other checks. The values can then be passed on to a different Postman Request. (I understand variable modification is not supported in Postman Flows)

I do not see such capability in Postman Flows to execute such scripts. I am bounded by the Blocks that are available in Postman Flows.

My Question:

  1. How do I run custom scripts in Postman Flows as to pass on the calculated values to the next Block?

  2. How do I convert an extracted JSON string (e.g. ’ { “field1” : " value1", “field2” : “value2”}') back into a JSON object that can be read by a Postman Flows Block?

I’ve already tried:

  1. Can’t find a way to run custom javascripts

  2. Fed string ’ { “field1” : " value1", “field2” : “value2”}’ as input to Create Data block. Doesn’t detect it as a JSON object.

Current version:
Postman for Windows
Version 9.29.2
UI Version 9.29.2-ui-220818-1441
Desktop Platform Version 9.29.0
Architecture x64
OS Platform win32 10.0.19044

Here is documentation to pass along values to subsequent blocks. We’ve also tackled this challenge in a few livestreams this season, if you care to browse a live coding session.

Flows is currently a beta feature, so a lot of the discussion is being handled in this separate spot, if you want to speak directly to the team building Flows and provide your feedback: Discussions · postmanlabs/postman-flows · GitHub

We really need to be able to get/set environment level variables, from scripts attached to flow block items.

It’s now 2025, and this feature is exceptionally important.

In fact, without this feature flows are virtually impotent.

As well as this, we need flow level scripts like collection level scripts, in both pre & post flavours. These should run before & after every HTTP flow block.

1 Like