Overview
Adapt integrates directly with Webflow using OAuth 2.0 authentication and publish webhooks. This enables automatic cache warming and site health monitoring whenever you publish changes to your Webflow sites. Key Features:- OAuth 2.0 authentication with Webflow workspaces
- Automatic webhook registration per site
- Publish-triggered crawls for instant cache warming
- Per-site scheduling configuration
- Secure token storage in Supabase Vault
OAuth Flow
Initiating Connection
Start the OAuth flow by making a POST request to initiate the connection:auth_url to complete authorization.
Required OAuth Scopes
Adapt requests the following scopes from Webflow:authorized_user:read- Identify the connecting usersites:read- List sites in the workspacesites:write- Register webhooks for publish eventscms:read- Access CMS content for crawling
The
workspaces:read scope is Enterprise-only, so Adapt uses authorized_user:read to identify connections.OAuth Callback
Webflow redirects back to:- Validates the OAuth state parameter (HMAC-signed with
SUPABASE_JWT_SECRET) - Exchanges the authorization code for an access token
- Fetches workspace and user information
- Stores the connection and access token securely
- Redirects to your settings page with success status
Implementation Reference
Frominternal/api/auth_webflow.go:99-108:
Connection Management
List Connections
Retrieve all Webflow connections for your organisation:Delete Connection
Site Configuration
List Sites
Fetch all sites in a connected workspace:Configure Site Settings
Enable or disable auto-crawl on publish for a specific site:Webhook Registration
When
enabled: true, Adapt automatically registers a webhook with Webflow for site_publish events.Scheduler Creation
If
schedule_interval_hours is provided, a recurring scheduler is created for the site.Publish Webhooks
Webhook URL Format
Adapt registers webhooks with Webflow using workspace-scoped URLs:This format allows multiple organisations to use the same workspace by mapping the workspace ID to the correct organisation.
Webhook Payload
When you publish a site, Webflow sends:Processing Logic
Frominternal/api/handlers.go:916-985, Adapt:
- Parses the webhook payload - Extracts site ID and workspace ID
- Resolves the organisation - Maps workspace ID to organisation using
platform_org_mapping - Checks site settings - Verifies auto-publish is enabled for the site
- Creates a job - Starts a new crawl job with configured settings
- Returns 200 OK - Acknowledges receipt to Webflow
Webhook Registration Code
Frominternal/api/webflow_sites.go:763-811:
Handling Conflicts
If a webhook already exists, Adapt:- Lists existing webhooks for the site
- Finds the matching webhook by URL and trigger type
- Returns the existing webhook ID
Security
Token Storage
Access tokens are stored in Supabase Vault (encrypted at rest):internal/api/auth_webflow.go:186-195.
State Validation
OAuth state parameters are HMAC-signed usingSUPABASE_JWT_SECRET to prevent CSRF attacks:
Organisation Isolation
All operations are scoped to the authenticated user’s organisation via Row Level Security (RLS) in PostgreSQL.Environment Variables
Common Issues
Webhook Registration Fails
Symptom: Error when enabling auto-publish Causes:- Missing
sites:writescope - Invalid access token (expired or revoked)
- Webflow API rate limits
Workspace ID Missing
Symptom: Connection saved but webhook callbacks fail Cause: Webflow token introspection didn’t return workspace IDs Solution: Adapt falls back to extracting workspace IDs from the sites API. Ensure the connection has at least one site.Multiple Organisations
Symptom: Webhook triggers crawl for wrong organisation Cause: Missing or incorrectplatform_org_mapping
Solution: Verify the workspace ID is correctly mapped to your organisation in the database.
API Reference
| Endpoint | Method | Description |
|---|---|---|
/v1/integrations/webflow | POST | Initiate OAuth flow |
/v1/integrations/webflow | GET | List connections |
/v1/integrations/webflow/{id} | DELETE | Remove connection |
/v1/integrations/webflow/{id}/sites | GET | List sites |
/v1/integrations/webflow/{id}/sites/{site_id}/settings | PUT | Configure site |
/v1/webhooks/webflow/workspaces/{workspace_id} | POST | Webhook endpoint |
Next Steps
Slack Notifications
Get notified when crawls complete
Custom Webhooks
Send crawl results to your systems