# Fetch Static Collection via Workflow When a User Submits a Form

**URL:** <https://community.weweb.io/t/fetch-static-collection-via-workflow-when-a-user-submits-a-form/17223>\
**Category:** How do I?\
**Created:** [March 17, 2025, 1:26am UTC](https://community.weweb.io/t/fetch-static-collection-via-workflow-when-a-user-submits-a-form/17223 "2025-03-17T01:26:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rivan\_lukas](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@rivan\_lukas](https://community.weweb.io/u/rivan_lukas)\
**Post date:** [March 17, 2025, 1:26am UTC](https://community.weweb.io/t/fetch-static-collection-via-workflow-when-a-user-submits-a-form/17223/1 "2025-03-17T01:26:56Z")

</div>

I’ve been exploring solutions for fetching a static collection via a workflow when a user submits a form but haven’t found an up-to-date or clear answer. Here’s my use case:

- We use static collections with REST API sourcing (connected to Supabase) to benefit from SEO.
- When an Admin user submits a new post entry via a form, I want the workflow to fetch the updated static collection so the changes are reflected without manual intervention.

From what I understand, this might require triggering a “Sync REST API” action or using “Hooks to sync WeWeb cache: Sync All the Collection”, but I’m unsure how to implement this in the workflow.

Could someone guide me on how to set this up? Specifically:

1. How can I trigger the static collection to fetch new data after a form submission?
2. Is there a way to automate this process without requiring the Admin to manually click “Sync REST API” in the editor?

Any help or examples would be greatly appreciated!

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![rivan\_lukas](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@rivan\_lukas](https://community.weweb.io/u/rivan_lukas)\
**Post date:** [March 17, 2025, 2:46am UTC](https://community.weweb.io/t/fetch-static-collection-via-workflow-when-a-user-submits-a-form/17223/2 "2025-03-17T02:46:59Z")

</div>

So, I tried triggering the Hooks to Sync WeWeb Cache by opening it in a new tab via JavaScript and closing the tab immediately after it loaded. This successfully synced the collection, and when we refreshed the editor, the new post appeared.

However, **this only works in Editor mode** , not on the production site, I suspect the changes don’t show unless we manually republish the ap, cmiiw.

Can anyone clarify the best/common practice for handling this? Is there a way to sync static collections in production without requiring a manual republish?

Btw, I asked Weweb AI to reconstruct my workflow to trigger the Hooks to Sync Weweb Cache and it built for me edge function which I think a great solution, but it didn’t work. I suppose it has something to do with having to republish the app somehow.

Would really appreciate any insights  
Cheers!
