{
  "name": "Convert Notion page to WordPress (Gutenberg) HTML",
  "nodes": [
    {
      "id": "863c7ba9-dcbe-4cbb-a451-aff131934ef1",
      "name": "Get a database page",
      "type": "n8n-nodes-base.notion",
      "position": [
        -448,
        208
      ]
    },
    {
      "id": "80ccc7d0-f503-48c3-bf8f-5c98edcbe543",
      "name": "Get many child blocks",
      "type": "n8n-nodes-base.notion",
      "position": [
        -224,
        208
      ]
    },
    {
      "id": "b62bd11d-eafb-49f5-af62-948ea9dea525",
      "name": "decode blocks",
      "type": "n8n-nodes-base.code",
      "position": [
        224,
        208
      ]
    },
    {
      "id": "11fb7b82-a913-4792-a33b-dff0751512af",
      "name": "decode paragraphs",
      "type": "n8n-nodes-base.code",
      "position": [
        0,
        208
      ]
    },
    {
      "id": "bd2edec6-ffc7-4e80-884d-4fbc9ecb30a7",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1344,
        208
      ]
    },
    {
      "id": "1d83b6b5-9bbe-4a8d-8a79-82ad98b7a28a",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -672,
        304
      ]
    },
    {
      "id": "1754c892-4aae-46f2-a90c-40fff5d9c88e",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -896,
        112
      ]
    },
    {
      "id": "03f0e6ad-8a8b-40c0-a392-4441274b61f0",
      "name": "Edit Fields2",
      "type": "n8n-nodes-base.set",
      "position": [
        -672,
        112
      ]
    },
    {
      "id": "ef9e41a2-38b9-4a9e-87f6-bb19aade231f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        -176
      ],
      "parameters": {
        "width": 416,
        "height": 656,
        "content": "## 📥 Extract: Fetch Notion Content\n\nThis stage retrieves all the content from the provided Notion page URL.\n\n**Get a database page:** Fetches the main page object. This is needed to get the page's can"
      }
    },
    {
      "id": "2af6a568-782c-44ed-b04c-5356f67f1139",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -176
      ],
      "parameters": {
        "width": 880,
        "height": 656,
        "content": "## ⚙️ Transform: Convert Notion to Gutenberg HTML\n\nThis is the core logic of the workflow. It iterates over every block (in multiple passes) to build the final HTML.\n\n1. **decode paragraphs (Code):** "
      }
    },
    {
      "id": "18124fd4-c9f7-4ebc-9353-d5fde739cca3",
      "name": "drop unnecessary fields",
      "type": "n8n-nodes-base.set",
      "position": [
        448,
        208
      ]
    },
    {
      "id": "fd03cfb2-3fc1-4dff-ba44-d40d64cb5f5c",
      "name": "nested blocks",
      "type": "n8n-nodes-base.code",
      "position": [
        672,
        208
      ]
    },
    {
      "id": "774f0093-478f-4eb9-979d-0068dba63ff3",
      "name": "choose content field",
      "type": "n8n-nodes-base.set",
      "position": [
        1120,
        208
      ]
    },
    {
      "id": "bbdfd21e-df44-4ad8-b57a-08f6691c8536",
      "name": "only top level blocks",
      "type": "n8n-nodes-base.filter",
      "position": [
        896,
        208
      ]
    },
    {
      "id": "43a66246-0dfb-445d-b55f-da2c6d8be17a",
      "name": "join lines",
      "type": "n8n-nodes-base.set",
      "position": [
        1568,
        208
      ]
    },
    {
      "id": "8c7a766d-5499-47d5-abbf-451488ea24be",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        -176
      ],
      "parameters": {
        "width": 928,
        "height": 656,
        "content": "## 🧩 Finalize: Assemble the Post Body\n\nThis stage takes all the individual HTML block strings and assembles them into a single, complete HTML document ready for WordPress.\n\n**only top level blocks (Fi"
      }
    },
    {
      "id": "31568ee0-614f-4563-b831-f389e0dc0cef",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        80
      ],
      "parameters": {
        "width": 1040,
        "height": 400,
        "content": "## 🚀 Triggers (How to Run)\n\nThis workflow is designed as a sub-workflow.\n\n### Manual Test:\n\nClick \"Execute workflow\".\n\nYou must paste a valid Notion page URL into the Edit Fields2 node first.\n\n### Pro"
      }
    }
  ],
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "join lines",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields2": {
      "main": [
        [
          {
            "node": "Get a database page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "decode blocks": {
      "main": [
        [
          {
            "node": "drop unnecessary fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "nested blocks": {
      "main": [
        [
          {
            "node": "only top level blocks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "decode paragraphs": {
      "main": [
        [
          {
            "node": "decode blocks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a database page": {
      "main": [
        [
          {
            "node": "Get many child blocks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "choose content field": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many child blocks": {
      "main": [
        [
          {
            "node": "decode paragraphs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "only top level blocks": {
      "main": [
        [
          {
            "node": "choose content field",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "drop unnecessary fields": {
      "main": [
        [
          {
            "node": "nested blocks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Get a database page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Edit Fields2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}