# Trigger a script to run in a gateway context from client

**URL:** <https://forum.inductiveautomation.com/t/trigger-a-script-to-run-in-a-gateway-context-from-client/60904>\
**Category:** Ignition\
**Created:** [June 17, 2022, 6:05pm UTC](https://forum.inductiveautomation.com/t/trigger-a-script-to-run-in-a-gateway-context-from-client/60904 "2022-06-17T18:05:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShaneH](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@ShaneH](https://forum.inductiveautomation.com/u/ShaneH)\
**Post date:** [June 17, 2022, 6:05pm UTC](https://forum.inductiveautomation.com/t/trigger-a-script-to-run-in-a-gateway-context-from-client/60904/1 "2022-06-17T18:05:28Z")

</div>

Trying to figure out an easy way for a client script to trigger a script to run in a gateway context.

I can set the “gateway” script up in a timer event with a message handler (never done this, but should work).

Or maybe setup a tag with an event script (which includes the script I want to run in a gateway context) that I trigger via a write.

Anything easier?

Thanks.  
-Shane

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 17, 2022, 6:14pm UTC](https://forum.inductiveautomation.com/t/trigger-a-script-to-run-in-a-gateway-context-from-client/60904/2 "2022-06-17T18:14:24Z")

</div>

`sendMessage` (or `sendRequest`, if you need a return value) is absolutely the way to go.
