# Publish to CMS from Grid

## Webflow

AirOps allows you to publish your AI-generated content directly to Webflow CMS collections, streamlining your content creation and publishing workflow.

{% @arcade/embed url="<https://app.arcade.software/share/O4jLjGFYSpdRL9GW6u95>" flowId="O4jLjGFYSpdRL9GW6u95" %}

### How to Publish to Webflow CMS from Grid

1. Click the **Add Column** button in your Grid
2. Select **Webflow** from the Export to CMS section of the dropdown menu
3. Connect to your Webflow account:
   * Select an existing Webflow site authentication from the dropdown
   * Click **Continue**
4. Configure the export settings:
   * **Choose a Webflow Collection**: Select the collection you want to export to from the dropdown
   * **Collection Item Status**: Choose whether items should be:
     * **Queued for Publish**: Items stay private in Webflow and are not published to your live website
     * **Queued for Publish (Draft)**: Items stay private in Webflow, marked as drafts, and are not published to your live website
     * **Draft**: Items are published to your live website and marked as drafts in Webflow for further editing
     * **Published**: Items are published to your live website and ready for visitors to see

{% hint style="warning" %}
**Important:** If you're working with existing published items and configure your Webflow Export to use "Draft" status, those published items will be converted to draft status in Webflow, making them no longer public on your live site.
{% endhint %}

5. Map columns to Webflow fields:
   * **Item ID Handling**:
     * For creating new items: Select "Create a new column" from the Grid Column dropdown for Webflow Item ID
     * For updating existing items: Select the column that contains existing Webflow Item IDs
   * **Field Mapping**: Match your Grid columns to the appropriate Webflow fields
     * Fields marked with a red asterisk (\*) are required
     * Ensure your column data types match the expected Webflow field formats (Number, Text, HTML, etc.)
     * For unmapped fields, select "Do Not Export"
   * Click **Save Column Mappings**
6. After configuration, two new columns will appear in your Grid:
   * **Webflow Export**: Shows the export status and contains the action button
   * **Webflow Item ID**: Stores the Webflow CMS item identifiers
7. Export your content:
   * Click the **Play button** in the Webflow Export column for each row you want to publish
   * Once exported, the column will display the status and export date
   * The Webflow Item ID column will populate with the unique identifier for each exported item
8. Edit your column mappings (if needed):
   * Click the three dots (⋮) in the Webflow Export column header
   * Select **Edit**
   * Adjust your mappings as needed and save

### Converting Markdown to HTML for Webflow

Webflow doesn't support Markdown formatting. If your content is in Markdown format, you'll need to convert it to HTML first using either the **Convert Content Format** step or the [**Run Code**](https://docs.airops.com/actions/workflow-concepts/workflow-steps/logic-steps/code) step with Python's `markdown` package.

With this integration, you can create content at scale with AirOps and seamlessly publish it to your Webflow site without manual copying and pasting.

## Sanity

AirOps allows you to export your Grid content directly to Sanity, creating or updating documents in your Sanity project.

### How to Publish to Sanity from Grid

1. Click the **Add Column** button in your Grid
2. Select **Sanity** from the Export to CMS section of the dropdown menu
3. Connect to your Sanity project:
   * Select an existing Sanity authentication from the dropdown, or set up a new one by entering your **API Token** and **Project ID**
4. Configure the export settings:
   * **Choose a Dataset**: If your project has multiple datasets, select which dataset to export to (defaults to "production")
   * **Choose a Document Type**: Select the Sanity document type you want to export to (e.g., "post", "article")
5. Map the Sanity Document ID column:
   * **To create new documents**: Select "Create a new column" — AirOps will generate a new Sanity Document ID column and populate it with the document IDs after export
   * **To update existing documents**: Select the Grid column that contains existing Sanity document IDs
6. Map the Sanity Status column (optional):
   * Select a Grid column containing "draft" or "published" values to control whether documents are saved as drafts or published in Sanity
   * Select "None (all published)" to publish all documents by default

{% hint style="warning" %}
**Important:** Documents with a "draft" status will be saved to the drafts folder in Sanity and will not be publicly visible. If you update an existing published document with "draft" status, it will be moved to draft state.
{% endhint %}

7. Map columns to Sanity fields:
   * **Field Mapping**: Match your Grid columns to the appropriate Sanity document fields
   * Only Grid columns with compatible data types are shown for each Sanity field
   * AirOps will suggest possible matches based on column and field names
   * For fields you don't want to export, select "Do Not Export"
   * Click **Save Column Mappings**
8. After configuration, two new columns will appear in your Grid:
   * **Sanity Export**: Shows the export status and contains the action button
   * **Sanity Document ID**: Stores the Sanity document identifiers (if you created a new column)
9. Export your content:
   * Click the **Play button** in the Sanity Export column for each row you want to publish
   * Once exported, the column will display the export timestamp
   * The Sanity Document ID column will populate with the unique identifier for each exported document

### Field Type Mapping

Grid column types are mapped to Sanity field types as follows:

| Grid Column Type | Sanity Field Type     |
| ---------------- | --------------------- |
| Text             | String                |
| Markdown         | Markdown              |
| HTML             | Block (Portable Text) |
| Number           | Number                |
| Datetime         | Datetime              |
| Image (URL)      | Image                 |
| URL              | URL                   |
| JSON             | Object                |

{% hint style="info" %}
**Tip:** HTML content is automatically converted to Sanity's Portable Text format during export. If your content is in Markdown, consider converting it to HTML first using a workflow step before exporting.
{% endhint %}

With this integration, you can create content at scale with AirOps and seamlessly publish it to your Sanity project without manual copying and pasting.

## Contentful

AirOps allows you to export your Grid content directly to Contentful, creating or updating entries in your Contentful space.

### How to Publish to Contentful from Grid

1. Click the **Add Column** button in your Grid
2. Select **Contentful** from the Export to CMS section of the dropdown menu
3. Connect to your Contentful space:
   * Select an existing Contentful authentication from the dropdown, or set up a new one by entering your:
     * **CMA Token**: Content Management API token (starts with `CFPAT-`), found in your Contentful dashboard under Settings > API keys
     * **Space ID**: Found in Settings > General settings
4. Configure the export settings:
   * **Choose a Content Type**: Select the Contentful content type you want to export to (e.g., "Blog Post", "Page")
5. Map the Contentful Entry ID column:
   * **To create new entries**: Select "Create a new column" — AirOps will generate a new Contentful Entry ID column and populate it with the entry IDs after export
   * **To update existing entries**: Select the Grid column that contains existing Contentful entry IDs
6. Map the Contentful Status column (optional):
   * Select a Grid column containing "draft" or "published" values to control whether entries are published or kept as drafts in Contentful
   * If not specified, entries default to draft status

{% hint style="warning" %}
**Important:** Entries with a "draft" status will not be publicly visible in Contentful. If you update an existing published entry with "draft" status, it will be unpublished.
{% endhint %}

7. Map columns to Contentful fields:
   * **Field Mapping**: Match your Grid columns to the appropriate Contentful content type fields
   * Only Grid columns with compatible data types are shown for each Contentful field
   * AirOps will suggest possible matches based on column and field names
   * For fields you don't want to export, select "Do Not Export"
   * Click **Save Column Mappings**
8. After configuration, two new columns will appear in your Grid:
   * **Contentful Export**: Shows the export status and contains the action button
   * **Contentful Entry ID**: Stores the Contentful entry identifiers (if you created a new column)
9. Export your content:
   * Click the **Play button** in the Contentful Export column for each row you want to publish
   * Once exported, the column will display the export timestamp
   * The Contentful Entry ID column will populate with the unique identifier for each exported entry

### Field Type Mapping

Grid column types are mapped to Contentful field types as follows:

| Grid Column Type | Contentful Field Type            |
| ---------------- | -------------------------------- |
| Text             | Symbol / Text                    |
| HTML             | Rich Text                        |
| Number           | Integer / Number                 |
| Datetime         | Date                             |
| JSON             | Object / Array / Link / Location |

### Localized Content

Contentful supports localized fields. When exporting, AirOps wraps values in the appropriate locale format for your space's default locale. If you need to export content in multiple locales, set up separate export columns for each locale.

{% hint style="info" %}
**Tip:** HTML content is automatically converted to Contentful's Rich Text format during export. If your content is in Markdown, consider converting it to HTML first using a workflow step before exporting.
{% endhint %}

With this integration, you can create content at scale with AirOps and seamlessly publish it to your Contentful space without manual copying and pasting.
