# Page workflows not firing on Home page on first load

**URL:** <https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032>\
**Category:** Ask us anything\
**Tags:** workflows, bug, components\
**Created:** [October 20, 2024, 5:26pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032 "2024-10-20T17:26:57Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![kanepaamauloa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kanepaamauloa/32/8944_2.png) [@kanepaamauloa](https://community.weweb.io/u/kanepaamauloa)\
**Post date:** [October 20, 2024, 5:26pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/1 "2024-10-20T17:26:57Z")

</div>

I have just published my app, and I noticed that on the first time hitting the app (e.g., going directly to the homepage), the page workflows are not firing.

These page workflows make calls to the database to present dynamic data, so I can tell they aren’t being called because the data isn’t showing on the screen.

Also, looking at the Network panel, no requests are being sent to my database (Supabae) on the first load (see screenshot)

 ![CleanShot 2024-10-20 at 13.16.33@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/e/ee70fa5f5e2bceb3f829e9e5efd51153591f27db.png)

When I click around and come back to the Home page, the page workflows are fired, and requests are made to the database (see screenshot).

 ![CleanShot 2024-10-20 at 13.16.52@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/4/41f6e27c8c3dc070581709686d67a1f02688a9bc.png)

I have tried changing the Trigger Event of the page workflow from

- On page load
- On page load (before fetching collections)
- On app load
- On app load (before fetching collections)

None of them seem to work.

---

<div class="post-metadata">

**Author:** ![kanepaamauloa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kanepaamauloa/32/8944_2.png) [@kanepaamauloa](https://community.weweb.io/u/kanepaamauloa)\
**Post date:** [October 23, 2024, 1:28pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/2 "2024-10-23T13:28:33Z")

</div>

Anyone?

@Joyce @aurelie @Broberto @DanielL ?

---

<div class="post-metadata">

**Author:** ![kanepaamauloa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kanepaamauloa/32/8944_2.png) [@kanepaamauloa](https://community.weweb.io/u/kanepaamauloa)\
**Post date:** [October 27, 2024, 5:55pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/3 "2024-10-27T17:55:38Z")

</div>

I could use some help here!

I can’t ship my MVP if the first page people will see is an **EMPTY** page!

---

<div class="post-metadata">

**Author:** ![Micah](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/micah/32/9102_2.png) [@Micah](https://community.weweb.io/u/Micah)\
**Post date:** [October 27, 2024, 5:57pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/4 "2024-10-27T17:57:10Z")

</div>

It would be helpful to see a video showing your setup and what’s happening. It’ll be difficult to help otherwise. 😄

---

<div class="post-metadata">

**Author:** ![kanepaamauloa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kanepaamauloa/32/8944_2.png) [@kanepaamauloa](https://community.weweb.io/u/kanepaamauloa)\
**Post date:** [October 27, 2024, 8:23pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/5 "2024-10-27T20:23:30Z")

</div>

Thanks @Micah !

Here’s a video: [CleanShot 2024-10-27 at 16.18.58 · CleanShot Cloud](https://share.cleanshot.com/t8Mskpzf)

---

<div class="post-metadata">

**Author:** ![Micah](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/micah/32/9102_2.png) [@Micah](https://community.weweb.io/u/Micah)\
**Post date:** [October 27, 2024, 8:27pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/6 "2024-10-27T20:27:38Z")

</div>

Hmmm just a thought, have you tried putting a delay on the on page workflow? Try a 5sec delay as the first node and if it works, try decreasing it

---

<div class="post-metadata">

**Author:** ![kanepaamauloa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kanepaamauloa/32/8944_2.png) [@kanepaamauloa](https://community.weweb.io/u/kanepaamauloa)\
**Post date:** [October 27, 2024, 8:35pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/7 "2024-10-27T20:35:21Z")

</div>

I added a Custom JS node with `setTimeout(5000);`

The page workflow doesn’t seem to respect it – it just continues on! Haha

---

<div class="post-metadata">

**Author:** ![Micah](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/micah/32/9102_2.png) [@Micah](https://community.weweb.io/u/Micah)\
**Post date:** [October 27, 2024, 8:41pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/8 "2024-10-27T20:41:13Z")

</div>

Trying using the built in weweb one, time delay

---

<div class="post-metadata">

**Author:** ![kanepaamauloa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kanepaamauloa/32/8944_2.png) [@kanepaamauloa](https://community.weweb.io/u/kanepaamauloa)\
**Post date:** [October 27, 2024, 8:55pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/9 "2024-10-27T20:55:43Z")

</div>

That seemed to work, but it was a bit unreliable.

In the Editor environment, the first time, the requests returned null.

 ![CleanShot 2024-10-27 at 16.46.04@2x](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/8/88e285b490fca52be7fe9c7f438438e95b752f72.png)

I published the site anyway, and it works. It’s just an odd interaction/experience, as things do not appear until 5 seconds later.

I checked the Editor environment again after this, and it seems to work now. Still, the same odd experience of waiting.

I’m hoping there’s a better solution.

---

<div class="post-metadata">

**Author:** ![Vi56](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/vi56/32/11392_2.png) [@Vi56](https://community.weweb.io/u/Vi56)\
**Post date:** [October 27, 2024, 9:05pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/10 "2024-10-27T21:05:06Z")

</div>

Hi,  
Do you have caching set up for some APIs?

---

<div class="post-metadata">

**Author:** ![Micah](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/micah/32/9102_2.png) [@Micah](https://community.weweb.io/u/Micah)\
**Post date:** [October 27, 2024, 9:14pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/11 "2024-10-27T21:14:22Z")

</div>

What’s likely happening is your on page workflow is executing before your component is fully rendered, therefore it runs nothing. The delay ensures it has time to render.

It would be best to reorganize your workflows and have your component workflows trigger on mount.

---

<div class="post-metadata">

**Author:** ![kanepaamauloa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kanepaamauloa/32/8944_2.png) [@kanepaamauloa](https://community.weweb.io/u/kanepaamauloa)\
**Post date:** [October 27, 2024, 9:34pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/12 "2024-10-27T21:34:00Z")

</div>

`On Mounted` results in the same issue as before. That’s why I don’t use it.

I just tried it again, and sure enough, the data isn’t being requested/retrieved.

---

<div class="post-metadata">

**Author:** ![kanepaamauloa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kanepaamauloa/32/8944_2.png) [@kanepaamauloa](https://community.weweb.io/u/kanepaamauloa)\
**Post date:** [October 27, 2024, 9:34pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/13 "2024-10-27T21:34:53Z")

</div>

HI @Vi56

Not that I’m aware of. I’m using the free tier of Supabase for this project, and I haven’t configured anything – it’s all default out-of-the-box settings.

---

<div class="post-metadata">

**Author:** ![kanepaamauloa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kanepaamauloa/32/8944_2.png) [@kanepaamauloa](https://community.weweb.io/u/kanepaamauloa)\
**Post date:** [October 28, 2024, 3:23pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/14 "2024-10-28T15:23:46Z")

</div>

Marking this as a bug.

- Trigger page workflows do not fire properly on any event
- Component workflows do not fire on mounted

Is there a way to send a support request formally?

---

<div class="post-metadata">

**Author:** ![Micah](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/micah/32/9102_2.png) [@Micah](https://community.weweb.io/u/Micah)\
**Post date:** [October 28, 2024, 3:28pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/15 "2024-10-28T15:28:12Z")

</div>

I don’t think either of the issues you’ve described are bugs, more-so the way things are setup. 😄

I’d have to take a deep look at how you’ve set things up, but you likely have other dependencies required for the workflows that aren’t being loaded in the correct order, causing things to look like they’re not firing, when they actually are.

---

<div class="post-metadata">

**Author:** ![kanepaamauloa](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kanepaamauloa/32/8944_2.png) [@kanepaamauloa](https://community.weweb.io/u/kanepaamauloa)\
**Post date:** [October 29, 2024, 8:39pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/16 "2024-10-29T20:39:45Z")

</div>

Hi Micah,

I can’t tell if you’re trying to help, but I assume you are doing your best to guide me in resolving this.

Consistently, I have had the experience with the `on mounted` lifecycle event not firing properly.

I’m not aware of these dependencies you speak of. If you have an idea of what sort of dependencies I should look into, especially if there is something specific, that would be more helpful.

As far as I know, WeWeb doesn’t provide access to “dependencies” as I know them in a traditional coding environment. The “No-Code” aspect is supposed to abstract from that level of detail/control.

So, I’m using everything out of the box.

Thanks for giving your best effort; however little or as much as you can is appreciated.

@Vi56 if you have any other ideas, I’m happy to look into them as well.

Still waiting to hear back from the WeWeb folks, but they seem to be sleeping on this one.

---

<div class="post-metadata">

**Author:** ![Dominic](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dominic/32/5645_2.png) [@Dominic](https://community.weweb.io/u/Dominic)\
**Post date:** [October 30, 2024, 10:32pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/17 "2024-10-30T22:32:16Z")

</div>

Hi,

Try to move your workflows to On component created event of the initialized components. From what I can see you are trying to execute workflow in non-existing component and from your video I can’t tell if it is on the page.

---

<div class="post-metadata">

**Author:** ![Vi56](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/vi56/32/11392_2.png) [@Vi56](https://community.weweb.io/u/Vi56)\
**Post date:** [November 5, 2024, 6:26pm UTC](https://community.weweb.io/t/page-workflows-not-firing-on-home-page-on-first-load/14032/18 "2024-11-05T18:26:43Z")

</div>

I’m sorry, I don’t really know the exact solution, but it could be that there’s an issue with how the page is initializing the workflows on the first load. Sometimes, if certain scripts or resources haven’t fully loaded, workflows tied to the “On page load” event might not trigger as expected.

If you already have tried adding delay idk…
