# Sending objects through messaging between gatways

**URL:** <https://forum.inductiveautomation.com/t/sending-objects-through-messaging-between-gatways/87060>\
**Category:** Ignition\
**Created:** [March 8, 2024, 7:56pm UTC](https://forum.inductiveautomation.com/t/sending-objects-through-messaging-between-gatways/87060 "2024-03-08T19:56:03Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [March 8, 2024, 8:07pm UTC](https://forum.inductiveautomation.com/t/sending-objects-through-messaging-between-gatways/87060/2 "2024-03-08T20:07:38Z")

</div>

No, python code is not serializable to travel through a network packet, nor is there any way to ensure everything that could get called would be included.

Distribute just the code in projects. Perhaps a dedicated project.

_ **Run** _ the code with indirection, something like this:

> [@Using importlib to run any function on the gateway?](https://forum.inductiveautomation.com/t/using-importlib-to-run-any-function-on-the-gateway/33915/3):
>
> The overall idea is fine, though. Just preload all your possible code in the gateway. Pass function name, positional parameters, and keyword parameters through your sendRequest() call. Say you have script module 'beefyFunctions` set up with all the named functions (which can call other script modules as needed). Create a message handler ‘beefy’ like so: functionName, args, kwargs = [payload[x] for x in ['functionName', 'args', 'kwargs']] return getattr(beefyFunctions, functionName)(\*args, \*…

You message payload and return payload do have to be serialiazable.

---

_[View the full topic](https://forum.inductiveautomation.com/t/sending-objects-through-messaging-between-gatways/87060)._
