{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "dd806b2a-6e77-4383-a495-71b1401f7d47",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        1072
      ],
      "parameters": {
        "width": 464,
        "height": 608,
        "content": "## Product Description Generator\n\n### How it works\n1. Fill in a form with product name, features, target audience, and tone\n2. Google Gemini generates an SEO-optimized product description with keywords\n3. A second AI call creates translations if needed (EN, JA, etc.)\n4. A Code node formats everything into a clean, ready-to-use structure\n5. Descriptions are saved to Google Sheets as your product copy database\n6. The final copy is emailed to you or your client via Gmail\n\n### Setup steps\n1. Connect Google Gemini API credentials (free tier works)\n2. Create a Google Sheet called \"Product Descriptions\" and connect it\n3. Connect Gmail for delivery emails\n4. Activate and share the form URL\n\n### Customization\n- Edit the AI prompt to match your brand voice or specific e-commerce platform (Shopify, Amazon, etc.)\n- Add or remove target languages in the translation node\n- Adjust the SEO keyword density instructions in the prompt"
      },
      "typeVersion": 1
    },
    {
      "id": "2c7e9c64-50d4-44e6-8e1e-5d562973d241",
      "name": "Note - Input",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        688,
        1072
      ],
      "parameters": {
        "color": 7,
        "width": 280,
        "height": 500,
        "content": "## Product input\nCollects product details through a simple web form."
      },
      "typeVersion": 1
    },
    {
      "id": "d145ac43-40f7-47c3-8761-77b92a24d21e",
      "name": "Note - AI Generation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        1072
      ],
      "parameters": {
        "color": 7,
        "width": 536,
        "height": 700,
        "content": "## AI description generation\nGemini creates SEO-optimized copy and optional translations."
      },
      "typeVersion": 1
    },
    {
      "id": "b5e24f47-d2a1-4353-b032-2163a20a2468",
      "name": "Note - Delivery",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        1072
      ],
      "parameters": {
        "color": 7,
        "width": 780,
        "height": 500,
        "content": "## Format and deliver\nStructures the output, saves to Sheets, and emails the final copy."
      },
      "typeVersion": 1
    },
    {
      "id": "aed04457-721c-4deb-9dfb-ad2c46a74936",
      "name": "Product Details Form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        784,
        1280
      ],
      "parameters": {
        "path": "7d9be93f-ad2f-4834-a2c8-2925f0b1df04",
        "options": {},
        "formTitle": "Product Description Request",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Product Name",
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Key Features",
              "placeholder": "List 3-5 key features, one per line",
              "requiredField": true
            },
            {
              "fieldLabel": "Target Audience",
              "placeholder": "e.g., busy professionals aged 25-40",
              "requiredField": true
            },
            {
              "fieldLabel": "Price Range",
              "placeholder": "e.g., $29-49"
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Tone",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Professional"
                  },
                  {
                    "option": "Casual & Fun"
                  },
                  {
                    "option": "Luxury"
                  },
                  {
                    "option": "Technical"
                  },
                  {
                    "option": "Minimalist"
                  }
                ]
              }
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Languages",
              "fieldOptions": {
                "values": [
                  {
                    "option": "English only"
                  },
                  {
                    "option": "English + Japanese"
                  },
                  {
                    "option": "English + Spanish"
                  },
                  {
                    "option": "English + French"
                  },
                  {
                    "option": "All (EN, JA, ES, FR)"
                  }
                ]
              }
            },
            {
              "fieldType": "email",
              "fieldLabel": "Delivery Email",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Enter your product details to generate AI-powered descriptions"
      },
      "typeVersion": 2.1
    },
    {
      "id": "56b5d5a9-f38d-4c85-be83-94bfdc290013",
      "name": "Generate Description",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        992,
        1280
      ],
      "parameters": {
        "text": "=You are an e-commerce copywriter and SEO specialist. Write compelling product descriptions.\n\n**Product Name:** {{ $json['Product Name'] }}\n**Key Features:** {{ $json['Key Features'] }}\n**Target Audience:** {{ $json['Target Audience'] }}\n**Price Range:** {{ $json['Price Range'] || 'Not specified' }}\n**Tone:** {{ $json['Tone'] || 'Professional yet friendly' }}\n\nReturn ONLY valid JSON:\n{\n  \"short_description\": \"50-80 word punchy description for product cards\",\n  \"long_description\": \"150-250 word detailed description with benefits and features\",\n  \"seo_title\": \"60 char max SEO-optimized title\",\n  \"meta_description\": \"155 char max meta description\",\n  \"bullet_points\": [\"5 key selling points as bullet points\"],\n  \"suggested_tags\": [\"8-10 relevant product tags for search\"]\n}\n\nWrite for humans first, search engines second. Focus on benefits over features. Use power words that drive conversions.",
        "promptType": "define"
      },
      "typeVersion": 1.4
    },
    {
      "id": "ec2bf155-e632-4ed6-9c77-442ae5123718",
      "name": "Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        992,
        1440
      ],
      "parameters": {
        "options": {
          "temperature": 0.7
        },
        "modelName": "models/gemini-1.5-flash"
      },
      "typeVersion": 1
    },
    {
      "id": "bf676cfc-7ad6-405a-b04d-a3c678000d28",
      "name": "Translate Descriptions",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1264,
        1280
      ],
      "parameters": {
        "text": "=Translate the following product descriptions into Japanese, Spanish, and French. Keep the marketing tone and SEO value intact.\n\n**Short Description:** {{ $json.short_description }}\n**Long Description:** {{ $json.long_description }}\n**SEO Title:** {{ $json.seo_title }}\n\nReturn ONLY valid JSON:\n{\n  \"ja\": {\n    \"short_description\": \"Japanese short description\",\n    \"long_description\": \"Japanese long description\",\n    \"seo_title\": \"Japanese SEO title\"\n  },\n  \"es\": {\n    \"short_description\": \"Spanish short description\",\n    \"long_description\": \"Spanish long description\",\n    \"seo_title\": \"Spanish SEO title\"\n  },\n  \"fr\": {\n    \"short_description\": \"French short description\",\n    \"long_description\": \"French long description\",\n    \"seo_title\": \"French SEO title\"\n  }\n}",
        "promptType": "define"
      },
      "typeVersion": 1.4
    },
    {
      "id": "f1324784-4ccc-44ff-a963-5ec1b2d5ad64",
      "name": "Gemini Translate Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1264,
        1440
      ],
      "parameters": {
        "options": {
          "temperature": 0.5
        },
        "modelName": "models/gemini-1.5-flash"
      },
      "typeVersion": 1
    },
    {
      "id": "1b497116-ec9b-4a47-84cd-794670e3e7d7",
      "name": "Format Output",
      "type": "n8n-nodes-base.code",
      "position": [
        1584,
        1280
      ],
      "parameters": {
        "jsCode": "// Format the AI-generated descriptions into a clean structure\nconst items = $input.all();\nconst formData = $('Product Details Form').first().json;\nconst englishRaw = $('Generate Description').first().json.text || '';\nconst translationRaw = items[0].json.text || '';\n\nlet english = {};\nlet translations = {};\n\ntry {\n  const enMatch = englishRaw.match(/\\{[\\s\\S]*\\}/);\n  if (enMatch) english = JSON.parse(enMatch[0]);\n} catch (e) {\n  english = { title: formData['Product Name'], fullDescription: englishRaw };\n}\n\ntry {\n  const trMatch = translationRaw.match(/\\{[\\s\\S]*\\}/);\n  if (trMatch) translations = JSON.parse(trMatch[0]);\n} catch (e) {\n  translations = {};\n}\n\nconst output = {\n  productName: formData['Product Name'],\n  targetAudience: formData['Target Audience'],\n  tone: formData['Tone'] || 'Professional',\n  deliveryEmail: formData['Delivery Email'],\n  english,\n  translations,\n  generatedAt: new Date().toISOString()\n};\n\nreturn [{ json: output }];"
      },
      "typeVersion": 2
    },
    {
      "id": "f1f31bc6-c50c-4c0f-a23f-f8ec35efb93f",
      "name": "Save to Description DB",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1776,
        1280
      ],
      "parameters": {
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "7be75de9-8e02-44d9-aad3-1e49be2f1df1",
      "name": "Email Description",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1952,
        1280
      ],
      "parameters": {
        "sendTo": "={{ $json.deliveryEmail }}",
        "message": "=Hi there,\n\nYour AI-generated product description for \"{{ $json.productName }}\" is ready!\n\n\ud83d\udcdd Title: {{ $json.english.title }}\n\n\ud83d\udccb Meta Description:\n{{ $json.english.metaDescription }}\n\n\ud83d\udcc4 Full Description:\n{{ $json.english.fullDescription }}\n\n\ud83d\udd11 SEO Keywords: {{ $json.english.seoKeywords }}\n\n\u2705 Bullet Points:\n{{ $json.english.bulletPoints ? $json.english.bulletPoints.join('\\n\u2022 ') : 'N/A' }}\n\nThis copy has been saved to your Product Descriptions spreadsheet.\n\nBest,\nYour Product Copy AI",
        "options": {},
        "subject": "=Product Description Ready: {{ $json.productName }}"
      },
      "typeVersion": 2.1
    }
  ],
  "connections": {
    "Format Output": {
      "main": [
        [
          {
            "node": "Save to Description DB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Description",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Generate Description": {
      "main": [
        [
          {
            "node": "Translate Descriptions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Product Details Form": {
      "main": [
        [
          {
            "node": "Generate Description",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini Translate Model": {
      "ai_languageModel": [
        [
          {
            "node": "Translate Descriptions",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Save to Description DB": {
      "main": [
        [
          {
            "node": "Email Description",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Translate Descriptions": {
      "main": [
        [
          {
            "node": "Format Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}