My question: I want to run my Postman Collection using the Schedule feature in Runs. But, the endpoints can only be reached when behind a certain VPN. When the scheduler runs postman collections, it is run the Postman Cloud, and isn’t run behind the required VPN, so I get the ECONNRESET error. Help please!!
Update: someone from Postman told me this:
From my understanding, you cannot leverage our scheduler because the endpoint is private.
We have users implement a cron script with either (Postman CLI or Newman) on a server.
However, I’m unsure if this would be by creating a Postman API or utilizing the Monitor.
Details (like screenshots):
How I found the problem:
I’ve already tried:
Hey @catherinewills-denve !
Yes, you’re right. When using the Postman Collection Runner (the scheduling feature you’re referencing), the collections are run on Postman’s own cloud infrastructure, and we don’t have access to your private network or VPN.
A potential solution would be to set up a proxy server that is accessible from both the Postman cloud and your internal network. This server would need to be set up to forward requests from Postman to the intended endpoint through the VPN. Essentially, it would act as a bridge between Postman’s cloud servers and your internal network.
Using a proxy in this manner does introduce some security concerns. The proxy would be a publicly accessible endpoint that routes requests into your internal network. Proper authentication, rate limiting, logging, and possibly even content inspection might be necessary to ensure that this proxy does not become a security vulnerability.
If setting up such a proxy is not feasible or desired due to security or other concerns, you may consider alternatives. One alternative would be using the Postman CLI or Newman, to run the collections locally (on a machine that’s connected to the VPN) and perhaps automate this using a CI/CD tool or task scheduler.
Thanks Kevin! This is very helpful.
We wouldn’t want this API to be redeployed nightly (aka run on CICD). But can you further explain the task scheduler?
Or is there a way to utilize Postman API for my API to ping nightly on a schedule and run my Postman collection.
So you could set up a task with windows task scheduler or a cron job to execute a Newman command.
Here’s a basic step-by-step:
- First, ensure you’ve installed Newman on your machine.
- Export your Postman collection and the required environment (if any) as JSON files.
- Create a simple batch script or command-line instruction to use Newman to run your collection.
newman run path_to_your_collection.json -e path_to_your_environment.json
- Open Task Scheduler and create a new task.
- Define when you want the task to run (e.g., nightly at a specific time).
- For the task action, select “Start a program” and input the command to run the script or Newman command.
- Make sure the machine will be powered on and connected to the VPN during the scheduled time, and the Task Scheduler will handle the execution.
Postman’s API is more about managing and accessing Postman resources (like collections, environments, etc.) programmatically, rather than executing them. You won’t be able to run a Postman collection directly through the Postman API in a way that would bypass the connectivity issues you’re experiencing with Postman’s cloud runner.
To automate the running of your Postman collection, using a task scheduler on a machine that’s connected to the required VPN would be the most straightforward approach.
I hope that clears things up. If you have any more questions or need further clarification, please don’t hesitate to ask!
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.