:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(webflow): treat 409 Conflict as non-retryable (#63979)
Tom Owers8df078e6a012
diff --git a/posthog/temporal/data_imports/sources/webflow/source.py b/posthog/temporal/data_imports/sources/webflow/source.pyindex e14569203313..a8915d7f79b4 100644--- a/posthog/temporal/data_imports/sources/webflow/source.py+++ b/posthog/temporal/data_imports/sources/webflow/source.py@@ -40,6 +40,11 @@ class WebflowSource(ResumableSource[WebflowSourceConfig, WebflowResumeConfig]):return {"401 Client Error": "Your Webflow API token is invalid or expired. Please generate a new token and reconnect.","403 Client Error": "Your Webflow API token is missing a required scope. Grant the read scopes for the resources you want to sync and reconnect.",+ # Webflow returns 409 Conflict on the Products/Orders list endpoints when the+ # connected site does not have ecommerce enabled, and on other resources when+ # the site has unpublished changes. Both are deterministic state/config issues+ # that retrying can't resolve, so stop retrying and tell the user how to fix it.+ "409 Client Error: Conflict": "Webflow returned a 409 Conflict. For the Products and Orders tables this means the connected site does not have ecommerce enabled — enable ecommerce in Webflow or remove those tables from the sync. For other resources it can mean the site has unpublished changes; publish your Webflow site, then try again.",}def get_schemas(diff --git a/posthog/temporal/data_imports/sources/webflow/tests/test_webflow_source.py b/posthog/temporal/data_imports/sources/webflow/tests/test_webflow_source.pyindex 49c4c8c11b43..94a097138921 100644--- a/posthog/temporal/data_imports/sources/webflow/tests/test_webflow_source.py+++ b/posthog/temporal/data_imports/sources/webflow/tests/test_webflow_source.py@@ -57,6 +57,19 @@ class TestWebflowSource:errors = WebflowSource().get_non_retryable_errors()assert "401 Client Error" in errorsassert "403 Client Error" in errors+ assert "409 Client Error: Conflict" in errors++ def test_409_conflict_message_is_recognised_as_non_retryable(self) -> None:+ # Webflow returns 409 on /products when the site has no ecommerce; the raised+ # HTTPError message embeds a volatile site id and URL, so we must match on a+ # stable substring that excludes them.+ errors = WebflowSource().get_non_retryable_errors()+ raised_message = (+ "409 Client Error: Conflict for url: "+ "https://api.webflow.com/v2/sites/691afa9e7404e1259a4d0802/products?limit=100&offset=0"+ )+ matches = [pattern for pattern in errors if pattern in raised_message]+ assert matches == ["409 Client Error: Conflict"]def test_get_schemas_includes_static_and_dynamic_collections(self) -> None:with patch(