How do I use flow durables in a test?

My Postman flow looks like this:

  1. API call to create object
  2. Create durable with autogenerated id from last call (“dur_id”)
  3. API call to retrieve created object with environment variable “env_id” overwritten to “dur_id” via “Assign values to variables”.

The calls all work as expected.
The issue is the test for the retrieve call fails, because it compares the result to the original environment variable instead of the overwritten one.

How do I test against the durable variable set during the flow execution?

Hey @marco-brieden

Maybe I use a different word for the same thing but I’m not sure what you mean by durable :thinking:

Could you update your question with a visual example and the test code that is currently failing?

Hi @dannydainton, thanks for your reply!

I know it’s an odd name, but it’s what Postman chooses to call them.
Go to “Flows”, create a new one and then you can set up something similar to the flow I described above.
Unfortunately I don’t see a way to export a flow.

Here is step 1 and 2 in the overview:
Step 2: The durable to store the id:

Step 3: Overwriting the environment variable and sending the request:

The request itself succeeds, but the test attached to the request fails, because it doesn’t use the new current value.

Ah, that’s makes more sense now you updated the title and added the images.

I didn’t think about it in the context of ‘Flows’… :cry:

@samayverma Is there anything that you could suggest here?

It might also be worth taking a look at the discussions happening on the repo to see if there are any existing issues around durables?