Connect /

Sync events in Netlify Connect

This feature is available on Connect Enterprise plans.

Netlify Connect automatically syncs and updates your data layer to ensure that you always have access to the latest data.

This document covers the types of sync events that occur, what triggers automatic data syncs, and how to trigger a sync manually.

To learn how to access sync event logs, review monitor activity.

# Sync event types

There are three types of events that can occur in Connect:

  • Sync from all data sources: the system reads data source configurations, installs dependencies, and then retrieves data from all data sources. Once the data is retrieved, the system uses the information to build or update the GraphQL schema for the data layer
  • Sync from {data source type}: the system retrieves data from the specified data source
  • Sync to database: the system syncs data to the data layer’s database as a new data revision and makes it available through the GraphQL API

Netlify does a full sync to set up or update your data layer when you create a new data layer and when you add or update data source configurations, cross-references, and API scopes. Netlify also does a full sync when you manually trigger a sync. When a full sync occurs, the events are Sync from all data sources, and then Sync to database.

When there is a data update, such as newly published content in your CMS, Netlify only syncs the updated data source. The events are Sync from {data source type}, and then Sync to database.

Each successful sync generates a new data revision. You can review all available data revisions in the Revisions section on the data layer’s overview page. Learn more about data revisions.

# Automated syncs

One of the benefits of Connect is that it automatically updates your data layers to ensure they always have access to the latest data.

The API will use the pinned revision, even if syncs generate new ones

If you pin a data revision, successful syncs will continue to generate new revisions but the GraphQL API for your data layer will always use the pinned one.

Automated syncs occur in the following scenarios:

  • When you create a new data layer and when you add or update data source configurations, cross-references, and API scopes. This triggers a sync of all data sources and Netlify creates a new data revision and updates the GraphQL schema and API to reflect the change.
  • When data in a data source updates, such as when you publish new content in your CMS. Netlify is notified of the change and automatically creates a new data revision and updates your data layer.

# Manual syncs

If you are troubleshooting and want to manually trigger a refresh of all data in your data layer, you can start a sync from all data sources through the Netlify UI or a webhook.

Note that if your data layer’s API is using a pinned data revision, Netlify will generate a new revision to reflect the data sync but the API will continue to use the old data. Make sure to unpin the old data revision and/or pin the new revision once the data refresh is complete.

# Trigger a sync with the Netlify UI

  1. Navigate to the

    page for your team and select the data layer from the Data layers list.

  2. In the Activity section, select

    . Netlify will start syncing the data.

# Trigger a sync with the webhook

  1. Navigate to the page for your team and select the data layer from the Data layers list.
  2. Select Data layer settings.
  3. Find the Webhook URL under . It is formatted as https://webhook.netlify-connect.com/hooks/data_layer/data_source/publish/{data_layer_id}.
  4. Send a POST request to this webhook and Netlify will start syncing the data. You can leave the request body empty.

# Review data layer sync events

Netlify retains sync event logs for five days. Learn how to review data layer sync events and their logs in the monitor activity doc.