CMS Data

CMS Data action allows you to fetch and retrieve data from Webflow CMS collections within your workflows. This action is designed for reading CMS content and making it available to subsequent actions in your workflow.

Overview

The CMS Data action connects to your Webflow site's CMS collections and retrieves items based on your configuration. Unlike CMS Data Sync which writes data back to Webflow, this action is focused on reading and consuming CMS content.

Configuration

Site Selection

The action automatically uses your connected Webflow site. Ensure you have proper permissions to access the CMS collections you want to read from.

Collection Settings

Collection: Select the CMS collection you want to fetch data from. The dropdown will show all available collections in your connected Webflow site.

Live Publish:

  • Enabled - Fetches data from your live, published site

  • Disabled - Fetches data from your staging/draft site

Choose based on whether you need the most current published content or if you're working with draft content.

Data Expression

The Expression field allows you to write JavaScript code that processes the retrieved CMS data. Within this expression, you have access to:

  • items - Array of CMS collection items

  • ctx - Context object from previous actions

  • slug() - Utility function to create URL-safe slugs

Working with CMS Data

Accessing Collection Items

CMS collection items are available in the items variable within your expression:

Data Structure

Each item in the items array has the following structure:

Expression Examples

Here are common patterns for working with CMS data:

Accessing Field Data

CMS fields are accessible via the fieldData object. The available fields depend on your specific CMS collection structure:

Note: The actual field names depend on your CMS collection structure. Common fields include name, slug, dateCreated, and dateUpdated, but your collection may have different field names.

Using the Slug Utility

The slug() function creates URL-safe slugs from text:

Use Cases

Populating Reference Fields

The primary use case for CMS Data action is populating reference and multi-reference fields in other CMS collections:

Content Aggregation

Data Validation

Dynamic Workflows

Reporting

Data Transformation

Best Practices

Performance Optimization

  • Filter early: Apply filters to reduce data processing

  • Limit results: Use .slice() to work with smaller datasets when possible

  • Avoid deep processing: Keep complex operations minimal for large collections

Data Handling

  • Check for existence: Always verify fields exist before accessing them

  • Handle empty collections: Check items.length > 0 before processing

  • Preserve original data: Store original items if you need them later

Context Management

Error Handling

Common Issues and Solutions

Empty Results

Missing Fields

Type Safety

Expression Requirements

Your expression must:

  • Process the items array as needed

  • Store results in the ctx object for next actions

  • Not explicitly return anything (the system returns { ctx: ctx } automatically)

The processed context data will be available to all subsequent actions in your workflow.

Last updated