Webflow API publishing conflict causes Automation Failure

So I have an API/Webhook Set up for a client that publishes their Real estate listings into the CMS.

Data flow is:

  • They publish property manually in their DB.
  • Webhook is sent to my worker.
  • Worker transforms & Publishes it into webflow CMS (it is now “Staged for Publish”).

However, in order for the CMS item to be fully published on the website I must now publish my webflow site.

I have a cron job set up to publish the website every 4 hours. It works fine. However my staging/development site cannot be published via the API as it doesn’t fall under the “customDomain” value. Nor does it seem to have an ID that I can use.

Essentially all website domains need to be published at the same time/all must be in sync. Otherwise I will get this error when adding in CMS items via the API - 409:

“message”: “Conflict: Site is published to multiple domains at different times”.

TLDR: Automation is broken by the fact that:
A. Website must be Published Manually so that staging lines up with production.
B. It doesn’t seem possible to fully publish CMS items using the API, you can only stage them for publishing. Which requires A

Is this an existing issue that is going to be fixed? Or am I missing something from the webflow docs? I get the feeling I am missing something.

Any advice/work-around would be much appreciated!

Hey @Micky_Dollimore - sorry your automation looks to be broken! A few things that might help:

  1. You do not need to set your staging domain as a custom domain for your Webflow site to call the Publish Site API. Instead of passing in customDomains, pass in publishToWebflowSubdomain: true instead in the body to publish your site to staigng
  2. There’s some upcoming new behavior coming to /v2/APIs in how single-item publishing will work so that you no longer should face the 409’s domain sync issue. See more here. Good news is that you can try this new behavior out with the /beta endpoints. So I would try using /beta (no API changes necessary beyond the API route change) to see if this can help alleviate the immediate issues in your workflow on the site conflicts. This will ensure you don’t need to publish your site to sync staging/production if you just want to publish updates to a CMS item.

Hope this helps!

2 Likes

Hey @zachplata. Thank you for answering so promptly.
#1 Completely saved the automation. Can’t believe I missed that!

Thank you kindly for your help! :slight_smile:

1 Like