{
  "name": "Process testimonials with GPT-4 & auto-generate social media cards with Google Sheets",
  "nodes": [
    {
      "id": "4665148e-044d-44bc-982e-e253eb60f173",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        -64
      ],
      "parameters": {
        "width": 389,
        "height": 392,
        "content": "## 🚀 WORKFLOW START: TESTIMONIAL COLLECTION\n\n**Purpose:** Entry point for testimonial submissions\n\n**Expected Data:**\n- name or Name\n- designation/Designation/role\n- testimonial_text/testimonial/Testi"
      }
    },
    {
      "id": "0edf9e7e-bd71-42da-b028-2ea8b7c8439b",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -304,
        192
      ]
    },
    {
      "id": "3d5b7bac-6955-4c7b-bfbf-525b4b01416e",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -96
      ],
      "parameters": {
        "width": 357,
        "height": 411,
        "content": "## ✅ DATA VALIDATION & CLEANING\n\n**What it does:**\n- Extracts data from webhook payload\n- Validates required fields (name, testimonial)\n- Sets default values for missing fields\n- Generates fallback av"
      }
    },
    {
      "id": "e2b98cfd-f458-491f-adf9-951daae6c164",
      "name": "Data Validation",
      "type": "n8n-nodes-base.code",
      "position": [
        64,
        192
      ]
    },
    {
      "id": "825f049a-a2d5-47e2-83e7-57b319193a2e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -48
      ],
      "parameters": {
        "width": 295,
        "height": 379,
        "content": "## 🤖 AI ENHANCEMENT SETUP\n\n**AI Instructions:**\n- Fix grammar and spelling\n- Keep natural and conversational\n- Maintain enthusiasm\n- No fake details\n- Similar length to original\n"
      }
    },
    {
      "id": "6f77780d-a9e7-44a3-834b-89f41fa40219",
      "name": "Set AI Prompt",
      "type": "n8n-nodes-base.set",
      "position": [
        368,
        192
      ]
    },
    {
      "id": "b9b9ee52-9122-4c55-90f3-cdfbda8bfcfc",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        608,
        -32
      ],
      "parameters": {
        "width": 327,
        "height": 347,
        "content": "## 🧠 OPENAI PROCESSING\n\n**Model:** GPT-4 Turbo Preview\n\n**What happens:**\n1. Sends prompt + testimonial to OpenAI\n2. AI improves grammar and readability\n3. Preserves original meaning and tone\n4. Retur"
      }
    },
    {
      "id": "5fdf887b-e1aa-4122-8ede-1ef586072a06",
      "name": "OpenAI Enhancement",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        640,
        192
      ]
    },
    {
      "id": "d3b64d7c-c54e-4eeb-bec6-9b56ac3dba07",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        944,
        -16
      ],
      "parameters": {
        "width": 343,
        "height": 331,
        "content": "## 📦 EXTRACT AI RESPONSE\n\n**What it does:**\n- Extracts enhanced text from OpenAI response\n- Handles multiple response formats\n- Merges with original data\n- Tracks enhancement metadata\n"
      }
    },
    {
      "id": "2f0c7201-a5e4-4b3a-be91-0f200f8f249f",
      "name": "Extract AI Response",
      "type": "n8n-nodes-base.code",
      "position": [
        1040,
        192
      ]
    },
    {
      "id": "7ec4da11-b438-4877-be02-f967719aef64",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        -96
      ],
      "parameters": {
        "width": 272,
        "height": 427,
        "content": "## 🎨 HTML TEMPLATE GENERATION\n\n**What it does:**\n- Creates beautiful testimonial card\n- Responsive design with gradient background\n- Professional styling with Inter font\n- 5-star rating display\n- Cust"
      }
    },
    {
      "id": "b57bee88-1bc0-4bd2-b6cc-73ff96b56797",
      "name": "Generate HTML Template",
      "type": "n8n-nodes-base.code",
      "position": [
        1344,
        192
      ]
    },
    {
      "id": "50e726ce-705a-4bc4-a98e-f0653a26ad47",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1584,
        -80
      ],
      "parameters": {
        "width": 256,
        "height": 427,
        "content": "## 📸 HTML TO IMAGE CONVERSION\n\n**Service:**(https://htmlcsstoimg.com)\n\n**What it does:**\n- Converts HTML template to PNG image\n- Renders at 800x600px\n- Returns image URL"
      }
    },
    {
      "id": "abad8276-3b3e-4414-ad1d-7c4105e86d03",
      "name": "HTML/CSS to Image",
      "type": "n8n-nodes-htmlcsstoimage.htmlCssToImage",
      "position": [
        1632,
        192
      ]
    },
    {
      "id": "1c06771d-8cb7-4870-b3a1-a6960ffd0029",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1856,
        -80
      ],
      "parameters": {
        "width": 288,
        "height": 411,
        "content": "## ⬇️ DOWNLOAD IMAGE\n\n**What it does:**\n- Fetches PNG from URL\n- Downloads as binary file\n- Prepares for Google Drive upload\n\n**HTTP Request Settings:**\n- Method: GET\n- URL: From previous node\n- Respo"
      }
    },
    {
      "id": "94929251-c783-4ede-9710-6aff9fc59ea1",
      "name": "Download Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1920,
        192
      ]
    },
    {
      "id": "b79caf76-ec04-4a57-90d7-7ae3ff802e2e",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2160,
        -112
      ],
      "parameters": {
        "width": 288,
        "height": 443,
        "content": "## ☁️ GOOGLE DRIVE UPLOAD\n\n**What it does:**\n- Uploads PNG to Google Drive\n- Saves to \"testimonial data\" folder\n- Uses dynamic filename from HTML node\n- Returns shareable link and Drive ID\n\n**File Nam"
      }
    },
    {
      "id": "e028a171-81b8-4120-b443-414fbd77dc46",
      "name": "Upload to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2208,
        192
      ]
    },
    {
      "id": "7990f760-83ad-483c-adea-2f9eac6020d7",
      "name": "Update Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2544,
        192
      ]
    },
    {
      "id": "496bcc78-6f79-4719-aaf6-14f83c27e13b",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2768,
        -48
      ],
      "parameters": {
        "width": 272,
        "height": 395,
        "content": "## 📢 SLACK NOTIFICATION\n\n**Notification Includes:**\n✓ Customer name, role, email\n✓ Enhanced testimonial\n✓ Original testimonial (comparison)\n✓ Image preview link\n✓ Database status\n✓ Action checklist\n"
      }
    },
    {
      "id": "1baf7d5d-478f-4d8c-9fe1-4b0a1947109e",
      "name": "Send Slack Notification",
      "type": "n8n-nodes-base.slack",
      "position": [
        2832,
        192
      ]
    },
    {
      "id": "f95c7659-6e59-468b-9a53-4047a8e2f337",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1184,
        512
      ],
      "parameters": {
        "width": 368,
        "height": 411,
        "content": "## ⏰ SCHEDULE TRIGGER - APPROVAL CHECKER\n\n**Purpose:** Automated approval monitoring\n\n**Trigger:** Every 5 minutes\n\n**What it does:**\n- Checks Google Sheet for approved testimonials\n- Identifies testi"
      }
    },
    {
      "id": "93107afd-1e32-4f86-928a-baf2e9c5a24c",
      "name": "Every 5 Minutes",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1280,
        784
      ]
    },
    {
      "id": "75ff904f-6a28-459a-999c-f959985088ee",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1568,
        576
      ],
      "parameters": {
        "width": 320,
        "height": 347,
        "content": "## 📖 READ DATABASE\n\n**Data Retrieved:**\n- All testimonial records\n- Status column (Approved/Pending/Rejected)\n- Posted to Social column\n- Drive ID for matching\n"
      }
    },
    {
      "id": "f5180c82-5bc1-4676-9e57-08e65ff741ae",
      "name": "Read Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1616,
        784
      ]
    },
    {
      "id": "2a5196a0-de9c-48cc-8e48-805c2228ddf7",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1904,
        528
      ],
      "parameters": {
        "width": 320,
        "height": 395,
        "content": "## ✔️ CONDITIONAL FILTER\n\n**What it does:**\n- Filters testimonials based on conditions\n- Only passes approved testimonials\n- Excludes already posted ones\n\n**Logic:**\n- TRUE path: Ready to post\n- FALSE"
      }
    },
    {
      "id": "f516c987-5dac-4580-abf1-a29c111e5b5e",
      "name": "IF Approved & Not Posted",
      "type": "n8n-nodes-base.if",
      "position": [
        1984,
        784
      ]
    },
    {
      "id": "96ecfaa0-9c6d-4711-941c-4cdeb8397026",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2240,
        432
      ],
      "parameters": {
        "width": 320,
        "height": 395,
        "content": "## 📱 SOCIAL MEDIA READY NOTIFICATION\n\n**Notification Contains:**\n✓ Customer details\n✓ Enhanced testimonial\n✓ Original testimonial\n✓ Image preview link\n✓ **Ready-to-post social media text**\n✓ Hashtags "
      }
    },
    {
      "id": "9284d544-2cf9-4d67-830e-ef3de1990efb",
      "name": "Notify Ready to Post",
      "type": "n8n-nodes-base.slack",
      "position": [
        2304,
        672
      ]
    },
    {
      "id": "e63a79cc-2313-4d65-a349-b261dd17fecd",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2592,
        512
      ],
      "parameters": {
        "width": 336,
        "height": 315,
        "content": "## 🔄 MARK AS PROCESSED\n\n**What it does:**\n- Updates Google Sheet record\n- Marks testimonial as processed\n- Adds timestamp\n\n\n"
      }
    },
    {
      "id": "6b7e87eb-7958-4bab-bde9-db1df08c3148",
      "name": "Mark as Posted",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2656,
        672
      ]
    },
    {
      "id": "bf68641b-18b6-4fe7-ba2e-bf418f44aef8",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2464,
        -32
      ],
      "parameters": {
        "width": 288,
        "height": 363,
        "content": "## 📊 DATABASE UPDATE\n\n**Data Saved:**\n✓ Timestamp, Name, Designation, Email\n✓ Original + Enhanced testimonial\n✓ Image link (shareable)\n✓ Status: \"Pending Approval\"\n✓ Enhancement metadata\n✓ Source trac"
      }
    },
    {
      "id": "564a5664-46e7-417c-b01c-ffc7f761184b",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -896,
        -128
      ],
      "parameters": {
        "width": 368,
        "height": 560,
        "content": "## 📋 **SETUP CREDENTIALS FIRST**\n\n### **Required API Credentials:**\n\n#### 1. **OpenAI API** 🤖\n- Sign up at: https://platform.openai.com\n- Get API key from dashboard\n\n#### 2. **HTML/CSS to Image API** "
      }
    },
    {
      "id": "4be49892-0a67-4eb2-8cc9-c18b92559a76",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1312,
        -48
      ],
      "parameters": {
        "width": 384,
        "height": 480,
        "content": "## 🧪 **TEST WORKFLOW**\n\n**Set Headers:**\n   - `Content-Type`: `application/json`\n**Paste this in Body (raw JSON):**\n\n```json\n{\n    \"name\": \"Sarah Johnson\",\n    \"designation\": \"Marketing Director\",\n   "
      }
    }
  ],
  "connections": {
    "Set AI Prompt": {
      "main": [
        [
          {
            "node": "OpenAI Enhancement",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image": {
      "main": [
        [
          {
            "node": "Upload to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data Validation": {
      "main": [
        [
          {
            "node": "Set AI Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every 5 Minutes": {
      "main": [
        [
          {
            "node": "Read Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Data Validation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML/CSS to Image": {
      "main": [
        [
          {
            "node": "Download Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Google Sheet": {
      "main": [
        [
          {
            "node": "IF Approved & Not Posted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Enhancement": {
      "main": [
        [
          {
            "node": "Extract AI Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract AI Response": {
      "main": [
        [
          {
            "node": "Generate HTML Template",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Google Sheet": {
      "main": [
        [
          {
            "node": "Send Slack Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Ready to Post": {
      "main": [
        [
          {
            "node": "Mark as Posted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate HTML Template": {
      "main": [
        [
          {
            "node": "HTML/CSS to Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Google Drive": {
      "main": [
        [
          {
            "node": "Update Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Approved & Not Posted": {
      "main": [
        [
          {
            "node": "Notify Ready to Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}