{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "f8ecb7bb-88d1-445b-b33d-d35fe3151234",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        -480
      ],
      "parameters": {
        "width": 1728,
        "height": 416,
        "content": "# Shopify Product-to-Blog Automation with AI & Google Sheets\n## This workflow automates the process of turning Shopify product data into SEO-optimized blog posts. It:\n\n- Fetches product details from Shopify.\n- Cleans and formats descriptions & images.\n- Stores raw and refined data in Google Sheets.\n- Uses an AI agent (Google Gemini) to generate blog \n  content (title, intro, features, reviews, SEO fields).\n- Publishes the blog post to the Shopify Blog automatically.\n- Updates Google Sheets with blog status and article ID for tracking.\n\n## It\u2019s a hands-free system for content marketing:\n### Where every new product can become a polished, SEO-ready blog post \n### without manual writing."
      },
      "typeVersion": 1
    },
    {
      "id": "a660e92e-f367-4187-98b4-754c14c008b8",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        -32
      ],
      "parameters": {
        "width": 1728,
        "height": 480,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "83e6e157-fb98-4bad-a9e9-c043d6f7db16",
      "name": "Start Creation",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1088,
        -240
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "701f86cb-5169-4b09-9d74-2f1d7ac445af",
      "name": "Get All Product Details",
      "type": "n8n-nodes-base.shopify",
      "position": [
        -864,
        -240
      ],
      "parameters": {
        "resource": "product",
        "operation": "getAll",
        "returnAll": true,
        "authentication": "accessToken",
        "additionalFields": {}
      },
      "credentials": {
        "shopifyAccessTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "db453c4b-34ac-4a59-91be-51fde818984f",
      "name": "Product Details to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -640,
        -240
      ],
      "parameters": {
        "columns": {
          "value": {
            "title": "={{ $('Get All Product Details').item.json.title }}",
            "Images": "={{ $('Get All Product Details').item.json.images }}",
            "handle": "={{ $('Get All Product Details').item.json.handle }}",
            "product_id": "={{ $('Get All Product Details').item.json.id }}",
            "description": "={{ $('Get All Product Details').item.json.body_html }}"
          },
          "schema": [
            {
              "id": "product_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "product_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "handle",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "handle",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Images",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Images",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "product_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8/edit#gid=0",
          "cachedResultName": "row_data"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8/edit?usp=drivesdk",
          "cachedResultName": "shopify_blog_n8n"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "c9653b2e-3560-4986-8459-8632aecd557b",
      "name": "Fix the input format",
      "type": "n8n-nodes-base.code",
      "position": [
        -416,
        -240
      ],
      "parameters": {
        "jsCode": "// Function to process ALL input items (multiple products)\nconst allItems = $input.all();\nconst processedItems = [];\n\n// Function to process a single product\nfunction processProductData(inputData) {\n  try {\n    const result = {\n      product_id: null,\n      title: null,\n      handle: null,\n      description: '',        // keep original HTML\n      cleanDescription: '',   // plain text\n      imageSources: [],       // Always an array\n      totalImages: 0,\n      error: null\n    };\n\n    // Add fields as is\n    if (inputData.product_id !== undefined && inputData.product_id !== null) {\n      result.product_id = inputData.product_id;\n    }\n    if (inputData.title !== undefined && inputData.title !== null) {\n      result.title = inputData.title;\n    }\n    if (inputData.handle !== undefined && inputData.handle !== null) {\n      result.handle = inputData.handle;\n    }\n\n    // Process description\n    if (inputData.description) {\n      // 1. Keep original HTML (Shopify supports this)\n      result.description = inputData.description;\n\n      // 2. Generate plain text version\n      let cleanDescription = inputData.description\n        .replace(/<[^>]*>/g, '') // strip tags\n        .replace(/&amp;/g, '&')\n        .replace(/&lt;/g, '<')\n        .replace(/&gt;/g, '>')\n        .replace(/&quot;/g, '\"')\n        .replace(/&#39;/g, \"'\")\n        .replace(/&nbsp;/g, ' ')\n        .replace(/\\n+/g, '\\n')\n        .replace(/[ \\t]+/g, ' ')\n        .replace(/\\n /g, '\\n')\n        .trim();\n\n      // escape for JSON safety\n      cleanDescription = cleanDescription\n        .replace(/\\\\/g, '\\\\\\\\')\n        .replace(/\"/g, '\\\\\"')\n        .replace(/\\n/g, '\\\\n');\n\n      result.cleanDescription = cleanDescription;\n    }\n\n    // Process images - ENSURE IT'S AN ARRAY\n    if (inputData.Images && Array.isArray(inputData.Images)) {\n      result.imageSources = inputData.Images\n        .filter(image => image && image.src && image.src.trim() !== '')\n        .map(image => image.src.trim())\n        .filter((src, index, array) => array.indexOf(src) === index);\n\n      result.totalImages = result.imageSources.length;\n    }\n    // Handle case where Images might be a string\n    else if (inputData.Images && typeof inputData.Images === 'string') {\n      try {\n        const parsedImages = JSON.parse(inputData.Images);\n        if (Array.isArray(parsedImages)) {\n          result.imageSources = parsedImages\n            .filter(image => image && image.src && image.src.trim() !== '')\n            .map(image => image.src.trim())\n            .filter((src, index, array) => array.indexOf(src) === index);\n\n          result.totalImages = result.imageSources.length;\n        }\n      } catch (parseError) {\n        console.log('Error parsing Images string:', parseError);\n        result.imageSources = [];\n        result.totalImages = 0;\n      }\n    }\n\n    return result;\n\n  } catch (error) {\n    return {\n      product_id: inputData.product_id || null,\n      title: inputData.title || null,\n      handle: inputData.handle || null,\n      description: '',\n      cleanDescription: '',\n      imageSources: [],\n      totalImages: 0,\n      error: error.message\n    };\n  }\n}\n\n// Process each item\nfor (let i = 0; i < allItems.length; i++) {\n  const processedItem = processProductData(allItems[i].json);\n  processedItems.push({ json: processedItem });\n}\n\n// Return all processed items\nreturn processedItems;\n"
      },
      "typeVersion": 2
    },
    {
      "id": "da3c0cba-80d7-4ebb-a9fc-91d1dc900fcd",
      "name": "Update the sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -192,
        -240
      ],
      "parameters": {
        "columns": {
          "value": {
            "title": "={{ $json.title }}",
            "handle": "={{ $json.handle }}",
            "Image_1": "={{ $json.imageSources[0] }}",
            "Image_2": "={{ $json.imageSources[1] }}",
            "Image_3": "={{ $json.imageSources[2] }}",
            "Image_4": "={{ $json.imageSources[3] }}",
            "blog_id": "118631235877",
            "product_id": "={{ $json.product_id }}",
            "blog_status": "unused",
            "description": "={{ $json.cleanDescription }}"
          },
          "schema": [
            {
              "id": "product_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "product_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "blog_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "blog_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "blog_status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "blog_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "handle",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "handle",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image_1",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Image_1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image_2",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Image_2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image_3",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Image_3",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image_4",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Image_4",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "product_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 25757113,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8/edit#gid=25757113",
          "cachedResultName": "refined_input"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8/edit?usp=drivesdk",
          "cachedResultName": "shopify_blog_n8n"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "a9a6b7b7-2948-4827-ac71-6abd55da8b5a",
      "name": "Filter Duplicates",
      "type": "n8n-nodes-base.if",
      "position": [
        -1664,
        32
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "9e037f0f-ed95-41e5-b229-80befb372ff7",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.blog_status }}",
              "rightValue": "=unused"
            },
            {
              "id": "55aa4e25-b574-4c48-97f8-80ff6b402724",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.blog_status }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "3f421a55-3e62-44ff-8f75-822691bb0a03",
      "name": "Magic Room",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1216,
        16
      ],
      "parameters": {
        "text": "=Input fields provided:  \n- Title: {{ $json.title }}\n- Description: {{ $json.description }}",
        "options": {
          "systemMessage": "=You are an expert content writer who creates concise, high-converting product blog posts for Shopify stores. \n\nYour output must follow this exact structure, using HTML tags for formatting, and adhering to ideal word/character counts for readability and engagement.\n\nWrite a blog post using the following structure:\n\n1. **Title** (within <h1> tags)  \n- Make it catchy and relevant to the product title, approximately 8\u201312 words and 50\u201370 characters.  \n\n2. **Introduction** (within <p> tags)  \n- Write 40\u201360 words (250\u2013350 characters) that hook the reader by highlighting a relatable problem, followed by a quick product benefit summary.\n\n3. **Key Features** (within <ul> and <li> tags)  \n- List the top 4\u20136 features in short, scannable bullet points totaling 50\u2013100 words (300\u2013600 characters).\n\n4. **Customer Reviews / Experience** (within <blockquote> or <div> tags)  \n- Include 2\u20133 short, authentic-sounding customer testimonials or experiences, total 80\u2013120 words (450\u2013700 characters).\n\n5. **Use Case Callout** (within <p> tags, optionally with <strong>)  \n- Briefly define who the product is ideal for, in 40\u201360 words (250\u2013350 characters).\n\n6. **Call to Action** (within <p> tags)  \n- Close with a clear invitation to buy or learn more, about 20\u201340 words (120\u2013250 characters).\n\nAdditionally, at the end of the output provide:  \n- An excerpt summary (max 160 characters) without tags  \n- A page title suitable for SEO (under 60 characters)  \n- A meta description (140\u2013160 characters) summarizing the blog content for search engines  \n\n---\n\nOutput the content with proper HTML markup and all requested fields exactly like this JSON:  \n\n{\n  \\\"blog_title\\\": \\\"[Your formatted <h1> title here without tags]\\\",\n  \\\"content\\\": \\\"[Full HTML content as a string with tags as per the structure above]\\\",\n  \\\"excerpt\\\": \\\"[SEO-friendly excerpt summary]\\\",\n  \\\"page_title\\\": \\\"[SEO page title]\\\",\n  \\\"meta_description\\\": \\\"[SEO meta description]\\\"  \n}\n\nWrite the response ONLY as this JSON object without any additional commentary or text.\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "a22f016d-fc40-4b8f-8d63-55c888175601",
      "name": "Gemini",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1456,
        304
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4d2eacd5-3f48-4c63-898b-3246c7a118d3",
      "name": "Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1344,
        304
      ],
      "parameters": {
        "autoFix": true,
        "jsonSchemaExample": "{\n  \"blog_title\": \"blog_title\",\n  \"content\": \"content_html\",\n  \"excerpt\": \"excerpt\",\n  \"page_title\": \"page_title\",\n  \"meta_description\": \"meta_description\"\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "41194322-ba19-45b8-acb8-b5b9cb9dbebd",
      "name": "Gemini1",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -1072,
        304
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c7623b7a-0575-4ab9-b4cb-6647374aa87d",
      "name": "Limit = 1",
      "type": "n8n-nodes-base.limit",
      "position": [
        -1440,
        16
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a615f9c7-7adf-4b9c-8188-f26f4d5407e9",
      "name": "Update Blog Content",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -832,
        16
      ],
      "parameters": {
        "columns": {
          "value": {
            "content": "={{ $json.output.content }}",
            "excerpt": "={{ $json.output.excerpt }}",
            "blog_title": "={{ $json.output.blog_title }}",
            "page_title": "={{ $json.output.page_title }}",
            "product_id": "={{ $('Limit = 1').item.json.product_id }}",
            "URL _handle": "={{ $('Limit = 1').item.json.handle }}",
            "blog_status": "generated",
            "meta_description": "={{ $json.output.meta_description }}"
          },
          "schema": [
            {
              "id": "product_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "product_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "blog_title",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "blog_title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "excerpt",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "excerpt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_title",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "page_title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "meta_description",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "meta_description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "URL _handle",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "URL _handle",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "blog_status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "blog_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "article_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "article_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "product_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1548183235,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8/edit#gid=1548183235",
          "cachedResultName": "blog_post"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8/edit?usp=drivesdk",
          "cachedResultName": "shopify_blog_n8n"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "c4f97660-c407-4b82-80e9-1fb3a5057bfe",
      "name": "Fix Content Format",
      "type": "n8n-nodes-base.code",
      "position": [
        -640,
        16
      ],
      "parameters": {
        "jsCode": "// Get input JSON\nlet input = $input.first().json;\n\n// Function to convert raw HTML into Shopify-safe JSON string\nfunction makeJsonSafe(html) {\n  return html\n    .replace(/\\\\/g, \"\\\\\\\\\")    // escape backslashes\n    .replace(/\"/g, '\\\\\"')      // escape quotes\n    .replace(/\\n/g, \"\\\\n\")     // escape line breaks\n    .replace(/\\r/g, \"\");       // remove carriage returns (Windows line breaks)\n}\n\n// Process body_html\nlet safeContent = makeJsonSafe(input.content);\n\n// Return all fields in correct JSON structure\nreturn {\n  json: {\n    blog_title: input.blog_title,\n    excerpt: input.excerpt,\n    page_title: input.page_title,\n    meta_description: input.meta_description,\n    \"URL _handle\": input[\"URL _handle\"],\n    blog_status: input.blog_status,\n    body_html: safeContent\n  }\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "29e2dedd-1eae-414e-a6b7-ea5824547e58",
      "name": "Blog Creation",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -416,
        16
      ],
      "parameters": {
        "url": "https://p7wqck-r7.myshopify.com/admin/api/2025-07/blogs/118631235877/articles.json",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"article\": {\n    \"title\": \"{{ $json.blog_title }}\",\n    \"author\": \"Manish Kumar\",\n    \"tags\": \"Electronics\",\n    \"body_html\": \"{{ $json.body_html }}\",\n    \"published_at\": \"{{$now}}\"\n  }\n}\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "shopifyAccessTokenApi"
      },
      "credentials": {
        "shopifyAccessTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5cc50b49-1adb-4598-8fd4-9e9e2d710912",
      "name": "Status Update",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -192,
        16
      ],
      "parameters": {
        "columns": {
          "value": {
            "article_id": "={{ $json.article.id }}",
            "product_id": "={{ $('Update Blog Content').item.json.product_id }}",
            "blog_status": "posted"
          },
          "schema": [
            {
              "id": "product_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "product_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "blog_title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "blog_title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "content",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "excerpt",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "excerpt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "page_title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "page_title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "meta_description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "meta_description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "URL _handle",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "URL _handle",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "blog_status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "blog_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "article_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "article_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "product_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1548183235,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8/edit#gid=1548183235",
          "cachedResultName": "blog_post"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8/edit?usp=drivesdk",
          "cachedResultName": "shopify_blog_n8n"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "a976c2f9-2ad3-4d9c-8eaf-8d4be4887a16",
      "name": "Nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -1664,
        304
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "759af36b-3460-4a4e-8ca6-c3ee970babbd",
      "name": "Nothing1",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -400,
        288
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0753ecfb-4571-4bb8-9f30-c8c9f7689462",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2288,
        -480
      ],
      "parameters": {
        "color": 6,
        "width": 480,
        "height": 928,
        "content": "# User Instruction for Workflow\n\n## Setup Credentials\n- Connect your Shopify store (Admin API Access Token).\n- Connect your Google Sheets account (with access to the provided spreadsheet).\n- Ensure Google Gemini API key is added for AI blog generation.\n\n## Configure Spreadsheet\n- The workflow writes to three sheets:\n- Raw Input \u2192 Stores Shopify product data.\n- Refined Input \u2192 Stores cleaned description, plain text, and images.\n- Blog Post \u2192 Stores AI-generated blog drafts and publishing status.\n\n## Execution\n- Start the workflow using the Manual Trigger or schedule it with a Cron Trigger.\n- The workflow will fetch all Shopify products, generate blog content, and post articles automatically.\n\n## Monitoring\n- Check Google Sheets to track product \u2192 blog mapping.\n- Column blog_status will show:\n- unused \u2192 Product not yet blogged.\n- generated \u2192 Blog draft created but not yet posted.\n- posted \u2192 Blog published successfully.\n- Customization\n\n### Update AI prompt in the AI Agent Node if you want different blog styles.\n### Change Shopify blog ID or tags inside the HTTP Request Node if you want posts to go to a different blog category."
      },
      "typeVersion": 1
    },
    {
      "id": "ebd6d255-ffef-457f-b568-39a1f3bb3641",
      "name": "Update Input table",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -816,
        288
      ],
      "parameters": {
        "columns": {
          "value": {
            "product_id": "={{ $('Limit = 1').item.json.product_id }}",
            "blog_status": "used"
          },
          "schema": [
            {
              "id": "product_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "product_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "blog_id",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "blog_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "blog_status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "blog_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "description",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "handle",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "handle",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image_1",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Image_1",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image_2",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Image_2",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image_3",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Image_3",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image_4",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Image_4",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "product_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 25757113,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8/edit#gid=25757113",
          "cachedResultName": "refined_input"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/110yQOPnce7Sx4My18yaG5gye9x5qAB_oZZaKXF0bBh8/edit?usp=drivesdk",
          "cachedResultName": "shopify_blog_n8n"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "17dbeb60-6a41-4b44-9a20-1ae4d185f4f9",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2800,
        -480
      ],
      "parameters": {
        "color": 6,
        "width": 480,
        "height": 928,
        "content": "# Author Details\n\n![Manish Kumar](https://scontent.fixr3-4.fna.fbcdn.net/v/t1.6435-9/123542841_3445643652217456_8290902936669467422_n.jpg?_nc_cat=106&ccb=1-7&_nc_sid=6ee11a&_nc_ohc=NyTSSbh_JUQQ7kNvwGv2E33&_nc_oc=AdnSbeTxdN-An4wFvKbNoPe9jVwC1m6krNn5rzMrUfOs7tIH8UvqXGhPjaB79gdwiAfhI4jyYNLhFEffKAXHmKPg&_nc_zt=23&_nc_ht=scontent.fixr3-4.fna&_nc_gid=_mUXMYwqF04yK6N-XfUOHw&oh=00_AfbyxGux-ay7V2wOe08boD99Nz6M7Q2D7cwOodouEhWHMA&oe=68EE0148)\n\n## Manish Kumar\n### Expert Designer & Automation Engineer for Custom Shopify Apps\n\nI specialize in designing seamless customer experiences and automating workflows for Shopify, web, and business platforms. From custom apps integration to process optimization, my solutions empower teams to work smarter and scale faster.\n\n## Contact:\n### \ud83d\udce7 [manipritraj@gmail.com](mailto:manipritraj@gmail.com)\n### \ud83d\udcde +91-9334888899\n\n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Gemini": {
      "ai_languageModel": [
        [
          {
            "node": "Magic Room",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Gemini1": {
      "ai_languageModel": [
        [
          {
            "node": "Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Limit = 1": {
      "main": [
        [
          {
            "node": "Magic Room",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Magic Room": {
      "main": [
        [
          {
            "node": "Update Input table",
            "type": "main",
            "index": 0
          },
          {
            "node": "Update Blog Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Blog Creation": {
      "main": [
        [
          {
            "node": "Status Update",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Magic Room",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Status Update": {
      "main": [
        [
          {
            "node": "Nothing1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Creation": {
      "main": [
        [
          {
            "node": "Get All Product Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update the sheet": {
      "main": [
        [
          {
            "node": "Filter Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Duplicates": {
      "main": [
        [
          {
            "node": "Limit = 1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fix Content Format": {
      "main": [
        [
          {
            "node": "Blog Creation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Blog Content": {
      "main": [
        [
          {
            "node": "Fix Content Format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fix the input format": {
      "main": [
        [
          {
            "node": "Update the sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Product Details": {
      "main": [
        [
          {
            "node": "Product Details to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Product Details to Sheet": {
      "main": [
        [
          {
            "node": "Fix the input format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}