# Module lifecycle

**URL:** <https://forum.inductiveautomation.com/t/module-lifecycle/108827>\
**Category:** Module Development\
**Tags:** ignition81, perspective\
**Created:** [July 23, 2025, 12:18pm UTC](https://forum.inductiveautomation.com/t/module-lifecycle/108827 "2025-07-23T12:18:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Mulcahy](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@Thomas\_Mulcahy](https://forum.inductiveautomation.com/u/Thomas_Mulcahy)\
**Post date:** [July 23, 2025, 12:18pm UTC](https://forum.inductiveautomation.com/t/module-lifecycle/108827/1 "2025-07-23T12:18:08Z")

</div>

Hi,

So, I have 2 modules developed. module A and module B. Module B is dependant on module A.

Module A declares some APIs that I need to use in module B. I was assuming that when modules are loaded the `setup()` method for each module will be called, then each `startup()` method.

When a module is dependant on other module, it seems that module A goes through its entire lifecycle (`setup()` -\> `startup()`) before module B.

Is there anyway I can prepare some APIs in module A `setup()`, then have module B `setup()` do some registering of said APIs, then module A calls it `startup()` method?

I don't think this is possible, but I wanted to make sure.

Thanks,  
Tom

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 23, 2025, 12:30pm UTC](https://forum.inductiveautomation.com/t/module-lifecycle/108827/2 "2025-07-23T12:30:10Z")

</div>

I think you've diagnosed this incorrectly.

You will see this order:

- `A.setup()`
- `B.setup()`
- `A.startup()`
- `B.startup()`

The dependency of B on A ensures A is setup before B, but _all_ modules have `setup()` called before all modules have `startup()` called.

---

<div class="post-metadata">

**Author:** ![Thomas\_Mulcahy](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@Thomas\_Mulcahy](https://forum.inductiveautomation.com/u/Thomas_Mulcahy)\
**Post date:** [July 23, 2025, 12:46pm UTC](https://forum.inductiveautomation.com/t/module-lifecycle/108827/3 "2025-07-23T12:46:03Z")

</div>

Hi Kevin,

This doesn't look to be the case. If I install module A then module B. Once I restart module A. This is the sequence I get. I put a breakpoint in each method.

- `A.setup()`
- `A.startup()`
- `B.setup()`
- `B.startup()`

Does the sequence change when restarting modules, opposed to restarting the gateway?

---

<div class="post-metadata">

**Author:** ![Thomas\_Mulcahy](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@Thomas\_Mulcahy](https://forum.inductiveautomation.com/u/Thomas_Mulcahy)\
**Post date:** [July 23, 2025, 12:49pm UTC](https://forum.inductiveautomation.com/t/module-lifecycle/108827/4 "2025-07-23T12:49:11Z")

</div>

For clarity, I tested restarting the gateway instead of the parent module and the sequencing turned out as you said. So, it looks like when restarting the parent module the sequencing is different.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 23, 2025, 12:57pm UTC](https://forum.inductiveautomation.com/t/module-lifecycle/108827/5 "2025-07-23T12:57:14Z")

</div>

Yeah, looks like the behavior is different when restarting a module than it is during gateway startup.

This is arguably incorrect, at the very least inconsistent, but unlikely to get changed.

In Ignition 8.3 there is no module hot loading, so it should at least be consistent there.

---

<div class="post-metadata">

**Author:** ![Thomas\_Mulcahy](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@Thomas\_Mulcahy](https://forum.inductiveautomation.com/u/Thomas_Mulcahy)\
**Post date:** [July 23, 2025, 1:23pm UTC](https://forum.inductiveautomation.com/t/module-lifecycle/108827/6 "2025-07-23T13:23:22Z")

</div>

That is a shame. Don't suppose you can think of a solution to this? Restarting the gateway isn't always going to be possible once we ship this project.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 23, 2025, 1:43pm UTC](https://forum.inductiveautomation.com/t/module-lifecycle/108827/7 "2025-07-23T13:43:41Z")

</div>

In either scenario B.startup() is called after A.startup(), so you can try to figure out how to rely on that.

> [@Thomas\_Mulcahy](#):
>
> Restarting the gateway isn't always going to be possible once we ship this project.

Installing your module happens what, once? Restarting modules shouldn't be part of any regular workflow.

---

<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:** [July 23, 2025, 1:49pm UTC](https://forum.inductiveautomation.com/t/module-lifecycle/108827/8 "2025-07-23T13:49:28Z")

</div>

> [@Kevin.Herron](#):
>
> Installing your module happens what, once?

I see users _upgrading_ modules on the fly pretty regularly. Common practice, and very handy on critical systems. (For 3rd party modules--meaningless for IA modules.) That this is not possible in v8.3 is a **trade-off** , not an unalloyed win, for the ecosystem as a whole.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 23, 2025, 1:53pm UTC](https://forum.inductiveautomation.com/t/module-lifecycle/108827/9 "2025-07-23T13:53:42Z")

</div>

> [@pturmel](#):
>
> That this is not possible in v8.3 is a **trade-off** , not an unalloyed win, for the ecosystem as a whole.

I don't disagree with this. It just is what it is now :-/
