# Postman flow ignoring environment when triggered by webhook

**URL:** <https://community.postman.com/t/postman-flow-ignoring-environment-when-triggered-by-webhook/59876>\
**Category:** Help Hub\
**Tags:** webhook, postman-flows\
**Created:** [April 12, 2024, 7:21am UTC](https://community.postman.com/t/postman-flow-ignoring-environment-when-triggered-by-webhook/59876 "2024-04-12T07:21:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![beppecatanese](https://avatars.discourse-cdn.com/v4/letter/b/e36b37/32.png) [@beppecatanese](https://community.postman.com/u/beppecatanese)\
**Post date:** [April 12, 2024, 7:21am UTC](https://community.postman.com/t/postman-flow-ignoring-environment-when-triggered-by-webhook/59876/1 "2024-04-12T07:21:19Z")

</div>

I am able to run the flow locally: the flow involves several API calls that require  
an API key. This is defined in a Postman environment which I link to the flow steps. All is working fine.

However when I try to execute the flow **using a webhook** the Postman environment is ignored, and the API calls fail. This happens on both Postman web and desktop app (10.14.0).

Do I miss a step in the webhook configuration? How do I make sure the Postman requests (part of the flow) use my API key?

---

<div class="post-metadata">

**Author:** ![flows-daniel](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/flows-daniel/32/25516_2.png) [@flows-daniel](https://community.postman.com/u/flows-daniel)\
**Post date:** [April 12, 2024, 10:14pm UTC](https://community.postman.com/t/postman-flow-ignoring-environment-when-triggered-by-webhook/59876/2 "2024-04-12T22:14:30Z")

</div>

Hi @beppecatanese

Welcome to the forums!

When your calls fail, in the console, do you see that instead of your intended API key, it’s the request is being made with the variable name (something like `{{api key}}`)? If you made any changes to the environments, you will need to click the publish button again to sync the environment changes to your deployed flow.

---

<div class="post-metadata">

**Author:** ![beppecatanese](https://avatars.discourse-cdn.com/v4/letter/b/e36b37/32.png) [@beppecatanese](https://community.postman.com/u/beppecatanese)\
**Post date:** [April 15, 2024, 7:53am UTC](https://community.postman.com/t/postman-flow-ignoring-environment-when-triggered-by-webhook/59876/3 "2024-04-15T07:53:58Z")

</div>

Thanks Daniel!

I managed to make it work by defining both the `Initial value` and `Current value` in the Environment used by the flow. I guess the Current Value is not synchronised/saved on the cloud therefore cannot be used by the webhook.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [May 15, 2024, 7:54am UTC](https://community.postman.com/t/postman-flow-ignoring-environment-when-triggered-by-webhook/59876/4 "2024-05-15T07:54:42Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
