Alert When Integration Field Sync Fails

Hey,

I have a client who's integration field sync is mission critical, and 99% of the time it works seamlessly. But it seems like maybe once a month, the sync fails and we're left with an error message.

Is there a way to be alerted when this happens so I can go in and manually click the re-sync button? Or even better if I could have some kind of automated system where the alert comes in, and I can manually trigger a re-sync via an API.

At the moment the client has to alert me to the fact things aren't updating, and if I haven't checked in recently it could mean the sync has been down for a few days.

Thanks!

Hey @kieranstartup, are you using the integration field in pull mode (with this one, Prismic crawls your Custom API endpoint and refreshes roughly every 30 min) or push mode (here you send data to Prismic's write API)? The best approach for alerting is pretty different depending on which one you're on.

If you're on push, you're already the one triggering each sync, so you've got the most control — you could wrap your push calls with your own retry + alert logic so you get pinged the moment one fails, without waiting on anything from us.

If you're on pull, one thing worth knowing is that Prismic re-crawls the endpoint on its own about every 30 minutes, so a lot of transient hiccups should clear at the next cycle. Is the error sticking around longer than that, or does it need the manual re-sync every time?

could you share a screenshot of the error you're seeing when it fails, plus which mode you're on and any pattern to when it happens?

Hey @Pau ,

I've only ever tried out the pull mode for integration fields, so I'll take a look into the push mode. Is push mode restricted to the same 30 min refresh window, or does it essentially work on demand?

With pull mode, across the various sites I've used it on (maybe roughly 20 or so) anytime it fails, it never re-syncs, I always have to manually go in and do that. That's happened on when using both the dedicated 'Shopify' endpoint version of it, and my own custom endpoints anytime I've built that out.

I'll share any screenshots next time it happens, but the usual message I see is "java.net.SocketTimeoutException: Read timed out" which may be due to the size of the integration field catalog? I have roughly 7500 items in it.

Thanks!

Yes, push integrations are on-demand. In push, you trigger each sync by sending items to Prismic's write API, so you decide exactly when data updates.

On the timeout — your hunch is right. In pull mode we page through your endpoint 50 items at a time, so ~7,500 items means roughly 150 calls, and Read timed out means one of those page responses didn't come back fast enough. The bigger the catalog, the easier it is to trip that, and once a pull fails it won't reliably re-sync on its own (which lines up with what you're seeing). Push avoids that whole class of failure.

One thing to flag so you can plan for it: push and pull are two different catalog types, not a toggle, for example. So moving over is a fresh setup, not a button. Roughly: create a new "Push data to Prismic" catalog in Settings → Integration Fields, grab its endpoint + token, build the job that POSTs your items (it also handles updates and deletes), then repoint the integration field in your content model to the new catalog ID and re-select the content in the affected docs. Nothing tricky if you're comfortable with the API, but it is a from-scratch build rather than a quick switch, so worth budgeting a little time for it.

Thanks for the explanation @Pau , that all makes sense. I just spotted a failed sync on the integration field just now - the message says "An error occur during sync. Please check later or contact us if it doesn't resolve itself" but I'm not sure when it occurred since I last checked yesterday and whether the sync had tried to re-sync automatically again or not.

I'll take a look into the Push catalog type too, that sounds like a good approach.

Thanks!

(Edited to remove screenshot)