How do I run few requests in sequence to get result

Hi All

Saw all the beginners video and got some individual calls working but need a bit more help.

My question:

I have created 4 posts calls… 1st one feeds a collection variable into the other and so on in a sequence. The 4th one has a body which has an input which I want to make a variable and that gives me a result. Ideally I just want to put a variable value in the 4th call which requires 3rd call which requires 2nd which requires 1st…

If I run 1st, 2nd, 3rd and then 4th in sequence… the collection variable gets populated and all run. But I am wondering if there is a easier method to run the 4th one and that automatically calls 3rd which needs 2nd which needs 1st in sequence. 1-3rd calls are various access_tokens or sessions ID which expire so that is the reason. I guess it can be complex on checking 404 and calling but to simplify 4th calls should trigger 1-2-3-4 in sequence to always get new token from each?

Issues

  1. Call 4th should call 1-2-3-4 in sequence
  2. Able to put the value of body of 4th call in a variable (not mandatory - I can manually put) if automated.

I’ve already tried:

  1. Runner - had additional calls in the collection - I guess I can remove them and create a new collection just with the 4 calls. But like the output in a nice big screen for 4th call instead of just a inline success in runner?
  2. I was looking into flows but not sure if that can help with my calls.

What’s the best way to do this chaining and only needing to call 4th which triggers all previous in sequence?

Best way for me would be just clicking send on the 4th call and perhaps some pre-request scripts sequences first 3 calls? or maybe runner / flow is the way.

Very new to postman and JS.

Thanks

My advice is don’t.

You can indeed use the pre-request scripts and the Postman sendRequest() function to achieve the setup steps. Or just have the three steps that you’ve got now.

Sounds like adding complexity where it’s not needed.

Whats “wrong” with just running through the steps one at a time?
If you call out the individual steps, when something goes wrong, it’s much easier to troubleshoot.

Thanks @mdjones

Yes it does but it was more about learning as well… Would have loved to see how to get it working

Yes - I am currently clicking 4 times individually to get result