# Gateway Script Behavior

**URL:** <https://forum.inductiveautomation.com/t/gateway-script-behavior/117819>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [November 12, 2026, 12:27pm UTC](https://forum.inductiveautomation.com/t/gateway-script-behavior/117819 "2026-11-12T12:27:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xander\_Dawson-Fink](https://avatars.discourse-cdn.com/v4/letter/x/73ab20/32.png) [@Xander\_Dawson-Fink](https://forum.inductiveautomation.com/u/Xander_Dawson-Fink)\
**Post date:** [November 12, 2026, 12:27pm UTC](https://forum.inductiveautomation.com/t/gateway-script-behavior/117819/1 "2026-11-12T12:27:33Z")

</div>

Hey y'all,

I know that Gateway Timers and Tag Change scripts don't overlap in execution. Is this the same behavior for Message, (god forbid these actually ever happen) Scheduled, and Update Scripts? Like if I call the same message script using `system.util.sendMessage()`, from a couple different scripts, is the message going to race against itself, or will it just handle a like a queue and handle the first message first?

Also, is this behavior documented in the User Manual? I looked around for a good bit and couldn't find anything, but I also could have just completely missed it. If not, I may send an email to the documentation group for that, as it is important behavior when dealing with tags changing from multiple sources.

---

<div class="post-metadata">

**Author:** ![Xander\_Dawson-Fink](https://avatars.discourse-cdn.com/v4/letter/x/73ab20/32.png) [@Xander\_Dawson-Fink](https://forum.inductiveautomation.com/u/Xander_Dawson-Fink)\
**Post date:** [November 12, 2026, 12:40pm UTC](https://forum.inductiveautomation.com/t/gateway-script-behavior/117819/2 "2026-11-12T12:40:22Z")

</div>

Ok, I figured out a test I could do for the messaging system, and it definitely seems that messages sent to the same handler are queued.

> **Gateway Message Called 'A' in 'project'**
>
> ```python
> from time import sleep
> sleep(6)
> system.util.getLogger('Debug').warnf('completed execution at %s', system.date.now())
> 
> ```

> **Script Console**
>
> ```python
> system.util.sendMessage('project', 'A')
> system.util.sendMessage('project', 'A')
> system.util.sendMessage('project', 'A')
> 
> ```

> **Result**
>
> ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/e/2e2d0c55103f87f97ee8d3bcd9554d535dd1e768.png)

I didn't initially realize how trivial it would be to test the message system. It's early

This was with `Shared` Threading

---

<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:** [November 12, 2026, 12:55pm UTC](https://forum.inductiveautomation.com/t/gateway-script-behavior/117819/3 "2026-11-12T12:55:22Z")

</div>

> [@Xander\_Dawson-Fink](#):
>
> send an email to the documentation group

Please do. It is well-established behavior that each distinct event definition in the project event scripts gets one dedicated thread, except timers, where you can opt to share.

---

<div class="post-metadata">

**Author:** ![Noah\_Burnette](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/noah_burnette/32/83777_2.png) [@Noah\_Burnette](https://forum.inductiveautomation.com/u/Noah_Burnette)\
**Post date:** [November 12, 2026, 1:10pm UTC](https://forum.inductiveautomation.com/t/gateway-script-behavior/117819/4 "2026-11-12T13:10:39Z")

</div>

Hey Xander,

There's documentation regarding threading. Based on the wording for `Shared`, to me it would be possible to execute two of the same messages in parallel since it is a shared thread pool. But your test proves other wise 🤔

> **[Gateway Message Handler Settings​ - Gateway Event Scripts | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.3/platform/scripting/scripting-in-ignition/gateway-event-scripts#gateway-message-handler-settings)**
>
> Gateway Event Scripts are scripts that run directly on the Gateway. They are useful because they always run, regardless if any Sessions or Clients are open. They also provide a guaranteed way to make sure only a single execution of a particular...

---

<div class="post-metadata">

**Author:** ![Xander\_Dawson-Fink](https://avatars.discourse-cdn.com/v4/letter/x/73ab20/32.png) [@Xander\_Dawson-Fink](https://forum.inductiveautomation.com/u/Xander_Dawson-Fink)\
**Post date:** [November 12, 2026, 1:27pm UTC](https://forum.inductiveautomation.com/t/gateway-script-behavior/117819/5 "2026-11-12T13:27:57Z")

</div>

Messages have shared or dedicated threading, as well. I only tested with `Shared` threading (which I'll add in an edit), which gave this behavior. I might try `Dedicated` threading if I get a lull at work and see if that gives different behavior.
