How to pass environment variables between monitors

Hi all

I have a collection that I want to monitor but due to the time out error I followed the advise to split the collection into multiple one and to create monitors as so.

I added a put request at the end of my first monitors to update my env variables and I also added a postman APi request to run the second monitor at teh end of teh first one.

Unfortunately I did not managed to run th esecond monitor as an error appeared that the variable weren’t created.

Can someone explain me the methodology to follow ?

Many thanks in advance

Hi @nawelmele

I was wondering if you would be able to provide a bit more information, as I have an idea of the issue that you are having but it would help out to see some of the details.

First, could you explain the timeout issue that you are having with the monitor for the collection in the first place? If you can provide a bit more information I may be able to assist with a workaround.
Could you please include the following information in snippets or screenshots:

  • Code where the EnvironmentVariable in Collection1 is set
  • Code where the EnvironmentVariable in Collection2 is get
  • Environment where the EnvironmentValue is stored, and its current value
  • Value set for Environment for Monitor 1 and 2.

I have a couple theories but need a bit more information if possible. Please ensure to blank out any sensitive data.

Thanks.

Hi @nrelkov ,

Many thanks for your reply. I actually fixed my problem and here what was it and how did I fixed it:

My issue: I had a collection that I wanted to minitor and when I created a monitor I had the following error: “Error: callback timed out”
After reading Postman Post I understood that I had to split my collection into multiple one and to create monitor for each new smaller collection.
During this process I had to reuse variables from one monitor to the next one and that was my issue: how to pass variable between monitors?

How to solve that:

  • Create an empty environnement and add all the variables you need before any run ( for me it was the URL).
  • For each collection created, create a monitor to be run in the environment created( C1 → C2 → C3 : M1 → M2 → M3)
  • In each collection save each new variable as global variable and at the end of each collection add a request (Postman API: https://www.postman.com/postman/workspace/postman-public-workspace/documentation/12959542-c8142d51-e97c-46b6-bd77-52bb66712c9a ) to update the environnement with all the global varaibles created in the collection.
  • At the end of each collection add a request to run the next monitor.

And so this is how I solved my issue.

Many thanks,

1 Like

Hi @nawelmele

Good to hear you were able to find a solution. I was leaning towards recommending that as a solution but was not sure if there was a possible solution to the initial timeout, but it sounds like that is a known issue. Good to hear you are up and running now!

1 Like