# Gateway Tag Change Script Vs Tag Scripting Value Changed

**URL:** <https://forum.inductiveautomation.com/t/gateway-tag-change-script-vs-tag-scripting-value-changed/102022>\
**Category:** General Discussion\
**Tags:** ignition81, scripting\
**Created:** [February 7, 2025, 1:05am UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-vs-tag-scripting-value-changed/102022 "2025-02-07T01:05:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yousef\_Ali](https://avatars.discourse-cdn.com/v4/letter/y/87869e/32.png) [@Yousef\_Ali](https://forum.inductiveautomation.com/u/Yousef_Ali)\
**Post date:** [February 7, 2025, 1:05am UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-vs-tag-scripting-value-changed/102022/1 "2025-02-07T01:05:54Z")

</div>

I have few Tags which each tag going to run function which mainly used to send API through` httpclient` `POST` .  
There are two approach and i confused a lot which one is better

1. in each tag, i will use `Tag Event Script` based on `Value Changed`

2. in Gateway, i will use` Gateway Tag change script`

- What's the different from performance side if i have a lot of tags going to call certain function for http client?

- What's the different between two technique, while both can achieve the result ?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 7, 2025, 1:38am UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-vs-tag-scripting-value-changed/102022/2 "2025-02-07T01:38:11Z")

</div>

It is extremely bad to do slow functions in a tag's `valueChange` event. (Where slow means "longer than a millisecond or two or three"). You can lock up all tag scripts in your gateway.

---

<div class="post-metadata">

**Author:** ![csjohnson](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@csjohnson](https://forum.inductiveautomation.com/u/csjohnson)\
**Post date:** [February 10, 2025, 5:48am UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-vs-tag-scripting-value-changed/102022/3 "2025-02-10T05:48:24Z")

</div>

> [@pturmel](#):
>
> You can lock up all tag scripts in your gateway.

Phil, I read this as it would lock _all_ tag valueChange events in every tag provider on a single gateway.  
Meaning, it’s not based on a per-tag provider basis. You get three? threads on a gateway to run tag valueChange events for all tag providers on said gateway.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 10, 2025, 12:20pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-vs-tag-scripting-value-changed/102022/4 "2025-02-10T12:20:36Z")

</div>

The tags themselves won't lock up, but all tag event scripts will be blocked. And yes, gateway-wide, just three threads. (A similar thread pool is used for expression tags, too.)
