Postman Flow - Webhook trigger not updating headers, URL parameter

In my case i want to update the URL path variable, for this i have tried multiple ways but all works until i run the flow manually from postman but as soon as i use webhook it doesn’t work.

Things tried

  1. {{URL}}/{{localVariable}}/abc
pm.environment.set("localVariable", isValid);

This works fine for manual run but not with webhook

  1. {{URL}}/:is_valid/abc
const url = pm.request.url.toString();
const updatedUrl = url.replace('is_valid', isValid.toString());
pm.request.url.update(updatedUrl);
  1. Even updating headers from pre script is not working with webhooks.
pm.request.headers.add({ key: 'IsValid', value: isValid });

This works fine for manual run but not with webhook

Hi @avionics-specialist3

Method 2 works when I run it on a webhook, what problem are you running into with it?

I had to slightly change url.replace('is_valid', isValid.toString() to url.replace(':is_valid', isValid.toString()