Fetch Static Collection via Workflow When a User Submits a Form

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!

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!