{
  "name": "Optimize Amazon ads with GPT-4o for bid, budget & keyword recommendations",
  "nodes": [
    {
      "id": "0286c917-d771-4835-a5f8-71f79a5e59e8",
      "name": "List Files",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -100,
        -800
      ]
    },
    {
      "id": "7d9b0c0a-86ee-4aae-8d73-66f409b0a57f",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1620,
        -540
      ]
    },
    {
      "id": "d3d58b0a-3107-4525-92a8-d54332e9a8a5",
      "name": "is XLSX",
      "type": "n8n-nodes-base.if",
      "position": [
        540,
        -800
      ]
    },
    {
      "id": "884e4a08-3b19-4485-aba7-c69887607b82",
      "name": "Get File",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        100,
        -800
      ]
    },
    {
      "id": "c72fde38-de38-4734-a7e8-aa70e8638cad",
      "name": "Merge XLSX and CSV",
      "type": "n8n-nodes-base.merge",
      "position": [
        1200,
        -800
      ]
    },
    {
      "id": "cd23e23c-9bb7-4b8d-90ab-8917783cf1ab",
      "name": "Format Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1420,
        -800
      ]
    },
    {
      "id": "02172577-d867-45a4-96ea-eb105169deff",
      "name": "Set fileName",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        -800
      ]
    },
    {
      "id": "31db008f-20e4-4fe3-a9d0-1815b3802690",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -140,
        -1040
      ],
      "parameters": {
        "width": 180,
        "height": 200,
        "content": "## Change\nChoose the \"folder\" in the filter options to the folder containing your Ad reports\n"
      }
    },
    {
      "id": "0ba8c273-8369-4009-9b93-b0fb243a3c85",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1640,
        -1000
      ],
      "parameters": {
        "width": 260,
        "height": null,
        "content": "## AI Analysis\nUses GPT-4o to process the bundled reports and generate optimization instructions.\nPasses system instructions and cleaned data as input."
      }
    },
    {
      "id": "451bb016-1766-4688-aafc-75937e0d5c3f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -660,
        -580
      ],
      "parameters": {
        "width": 540,
        "height": 700,
        "content": "## Amazon Ads Report Scheduling Instructions\nTo run this workflow, schedule the following Sponsored Products reports in the Amazon Ads Console:\n\nUse \"Detailed\" for:\n\nSearch Term Report → Sponsored_Pro"
      }
    },
    {
      "id": "a671a4f1-05b0-4d7c-9cc1-8c2838593e34",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -580
      ],
      "parameters": {
        "width": 400,
        "height": 520,
        "content": "## Report Delivery\n\nHow to get reports into Google Drive\n\nUse one of the following:\n\n📥 Manual Upload – Download emailed reports and move them to your Drive folder\n\n🤖 Automation – Use n8n to watch Gmai"
      }
    },
    {
      "id": "63a7f391-2bc7-41f9-a53f-e742950c60bf",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        -580
      ],
      "parameters": {
        "width": 360,
        "height": 520,
        "content": "## Upgrade! 🚀\n\nApply for an Amazon Advertising API developer account to unlock full automation:\n\nGenerate reports programmatically via the Reports API\n\nFetch report files directly into n8n using HTTP "
      }
    },
    {
      "id": "e5a24705-0ad5-4629-b183-d279bdca8b29",
      "name": "Preserve File Name",
      "type": "n8n-nodes-base.set",
      "position": [
        980,
        -900
      ]
    },
    {
      "id": "3c315a0c-a89e-490a-9a82-e3d96d2b94c7",
      "name": "Email Optimizations",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2016,
        -800
      ]
    },
    {
      "id": "f4fc0a70-2df9-4b7b-b60c-856b1b74ead7",
      "name": "Extract XLSX Data",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        760,
        -900
      ]
    },
    {
      "id": "d0618a5b-1995-474d-a969-38e856b1b91a",
      "name": "Extract CSV Data",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        760,
        -700
      ]
    },
    {
      "id": "67f9d0a2-2f34-416a-bc11-ef776e6e4ab3",
      "name": "Preserve CSV File Name",
      "type": "n8n-nodes-base.set",
      "position": [
        980,
        -700
      ]
    },
    {
      "id": "818205c9-0fe9-4fe6-8556-657f087ba7b9",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -500,
        -800
      ]
    },
    {
      "id": "1612753d-0b7f-4ae5-9ec0-8ad39f1003b1",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -580,
        -1040
      ],
      "parameters": {
        "width": 220,
        "height": null,
        "content": "## Trigger\nYou may replace this with a scheduled event or poll the folder for changes."
      }
    },
    {
      "id": "158da856-b682-4f98-afcc-4fa12b978db0",
      "name": "Email Options",
      "type": "n8n-nodes-base.set",
      "position": [
        -300,
        -800
      ]
    },
    {
      "id": "4f1f251e-5cfb-468d-9531-9c2ba2c875f6",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -1040
      ],
      "parameters": {
        "width": 160,
        "height": null,
        "content": "## Change!\nEdit these email options."
      }
    },
    {
      "id": "ca2f4a7c-5aa9-4f6a-bc04-aedce5e0aaed",
      "name": "AI Analyze",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1640,
        -800
      ]
    }
  ],
  "connections": {
    "is XLSX": {
      "main": [
        [
          {
            "node": "Extract XLSX Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract CSV Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get File": {
      "main": [
        [
          {
            "node": "Set fileName",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Analyze": {
      "main": [
        [
          {
            "node": "Email Optimizations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List Files": {
      "main": [
        [
          {
            "node": "Get File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Data": {
      "main": [
        [
          {
            "node": "AI Analyze",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set fileName": {
      "main": [
        [
          {
            "node": "is XLSX",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Options": {
      "main": [
        [
          {
            "node": "List Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract CSV Data": {
      "main": [
        [
          {
            "node": "Preserve CSV File Name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract XLSX Data": {
      "main": [
        [
          {
            "node": "Preserve File Name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Analyze",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Merge XLSX and CSV": {
      "main": [
        [
          {
            "node": "Format Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Preserve File Name": {
      "main": [
        [
          {
            "node": "Merge XLSX and CSV",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Preserve CSV File Name": {
      "main": [
        [
          {
            "node": "Merge XLSX and CSV",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Email Options",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}