Skip to main content

Convert Markdown content to Contentful rich text with AI formatting

Workflow preview

Workflow preview
100%
Convert Markdown content to Contentful rich text with AI formatting preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Workflow: Publish to Contentful with Rich Text Formatting About the Creators This workflow was created by Varritech Technologies, an innovative agency that leverages AI to engineer, design, and d...

Best for

  • Content Creation automation workflows
  • Multimodal AI automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.httprequest, n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.merge, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Varritech.

Original n8n.io source

1.1 Workflow description

Title
Convert Markdown content to Contentful rich text with AI formatting
Workflow name
Convert Markdown content to Contentful rich text with AI formatting

Workflow: Publish to Contentful with Rich Text Formatting

⚑ About the Creators

This workflow was created by Varritech Technologies, an innovative agency that leverages AI to engineer, design, and deliver software development projects 500% faster than traditional agencies. Based in New York City, we specialize in custom software development, web applications, and digital transformation solutions. If you need assistance implementing this workflow or have questions about content management solutions, please reach out to our team.

πŸ—οΈ Architecture Overview

This workflow takes a JSON article payload, splits its markdown content into logical chunks, converts each chunk into Contentful Rich Text JSON via an AI agent, merges the resulting rich text nodes back into a single document, formats the entire entry according to Contentful's field schema, and finally publishes it to Contentful.

  1. Trigger β†’ Executes when called by another workflow
  2. Split by Headings β†’ Breaks markdown into ##-delimited chunks
  3. Markdown β†’ Rich Text β†’ AI agent converts each chunk to Contentful Rich Text JSON
  4. Combine Rich Text Objects β†’ Aggregates all chunk outputs into one document
  5. Format Entry β†’ Wraps metadata and rich-text content into Contentful schema
  6. Publish Entry β†’ HTTP POST to Contentful API

πŸ“¦ Node-by-Node Breakdown

flowchart LR
  A[When Executed by Another Workflow] --> B[Split by Headings]
  B --> C[Markdown to Contentful format]
  C --> D[Combine Rich Text Objects]
  D --> E[Merge1]
  E --> F[Format1]
  F --> G[Create newly formatted Contentful Entry]

1. When Executed by Another Workflow

Type: Execute Workflow Trigger

Input Example:

  • title, slug, category.id, description, keywords, content, metaTitle, metaDescription, readingTime, difficulty

Purpose: Receives the JSON payload from the upstream workflow.

2. Split by Headings

Type: Code

Logic:

  • Splits input.content into an array of markdown chunks at each second-level heading (##).
  • Emits one item per chunk with index, slug, title, and contentChunk.

3. Markdown to Contentful format

Type: LangChain Agent (+ OpenAI Chat model)

System Prompt:

  • Defines rules for generating valid Contentful Rich Text JSON (must include nodeType, data:{}, content:[], etc.).
  • Provides examples for paragraphs, headings, lists, links, and images.

User Prompt:

Here is the markdown content to convert: {{ $json.contentChunk }}

Purpose: Converts each markdown chunk into an array of rich-text nodes.

4. Combine Rich Text Objects

Type: Code

Logic:

  • Parses and merges all content arrays returned by the AI agent into one combined content array under a document root.

5. Merge1

Type: Merge

Purpose: Joins the original item (with metadata) and the combined rich-text document into a single data stream.

6. Format1

Type: Code

Logic:

  • Maps workflow data into the Contentful entry schema by setting each field (title, slug, category link, description, keywords, rich-text content, metaTitle, metaDescription, readingTime, difficulty) under the appropriate locale and structure required by Contentful.

7. Create newly formatted Contentful Entry

Type: HTTP Request

Method: POST

URL: https://api.contentful.com/spaces

Headers:

  • Authorization: Bearer token for Contentful Management API
  • Content-Type: application/vnd.contentful.management.v1+json
  • X-Contentful-Version: entry version number
  • X-Contentful-Content-Type: content type ID

Body: The formatted fields object produced by the previous node

Purpose: Publishes the new entry with rich-text content to Contentful.

πŸ” Design Rationale & Best Practices

Chunked Conversion

Splitting by headings prevents AI context limits and keeps conversions modular.

Strict Rich Text Schema

Enforcing nodeType, data, and content structure avoids validation errors on Contentful.

Two-Phase Merge

Separating "combine AI outputs" and "format entry" keeps transformations clear and testable.

Idempotent Publish

Uses explicit versioning and content type headers to ensure correct entry creation.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Create newly formatted Contentful Entry

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 2 - When Executed by Another Workflow

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1.1

Block 3 - Merge1

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 4 - Format1

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Markdown to Contentful format

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 6 - Split by Headings

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Combine Rich Text Objects

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - OpenAI Chat Model2

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 9 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Convert Markdown content to Contentful rich text with AI formatting
Complexity intermediate
Nodes 12
Categories Content Creation, Multimodal AI
Author Varritech
Published 15 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4078/4078.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Convert Markdown content to Contentful rich text with AI formatting do?

Workflow: Publish to Contentful with Rich Text Formatting About the Creators This workflow was created by Varritech Technologies, an innovative agency that leverages AI to engineer, design, and d...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, Multimodal AI use case.