{
  "name": "Brand Finder and Contacter",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "brand-finder",
        "responseMode": "lastNode",
        "options": {}
      },
      "name": "Webhook Brand Finder",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        300
      ],
      "id": "4ed61596-cb99-4277-afd2-42b3ce7f89b0"
    },
    {
      "parameters": {
        "model": "gpt-3.5-turbo",
        "messages": [
          {
            "role": "system",
            "content": "You are a brand researcher. Provide a short note explaining why the brand is reseller-friendly (known distributor partnerships, reseller policies, etc.)."
          },
          {
            "role": "user",
            "content": "Brand: {{$json[\"brand\"]}}"
          }
        ],
        "additionalFields": {}
      },
      "name": "OpenAI Brand Finder",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        450,
        300
      ],
      "credentials": {
        "openAiApi": "<your credential>"
      },
      "id": "21d53e35-9be7-4838-b805-8f1bd560d2d4"
    },
    {
      "parameters": {
        "responseData": "={{ { brand: $json[\"brand\"], note: $json[\"choices\"][0].message.content } }}",
        "responseContentType": "application/json",
        "options": {}
      },
      "name": "Respond Brand Finder",
      "type": "n8n-nodes-base.respond",
      "typeVersion": 1,
      "position": [
        650,
        300
      ],
      "id": "97061828-8d39-4447-b157-8778b1cfe08e"
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "contacter",
        "responseMode": "lastNode",
        "options": {}
      },
      "name": "Webhook Contacter",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        200
      ],
      "id": "da4040ba-8a96-4109-96c8-182da9a314ee"
    },
    {
      "parameters": {
        "model": "gpt-3.5-turbo",
        "messages": [
          {
            "role": "system",
            "content": "You are a helpful assistant that drafts professional outreach emails."
          },
          {
            "role": "user",
            "content": "Write a personalized email to {{$json[\"email\"]}} at {{$json[\"brand\"]}} inquiring about joining their wholesale program. Use the following details: {{$json[\"details\"]}}."
          }
        ],
        "additionalFields": {
          "temperature": 0.7
        }
      },
      "name": "OpenAI Contacter",
      "type": "n8n-nodes-base.openAi",
      "typeVersion": 1,
      "position": [
        450,
        200
      ],
      "credentials": {
        "openAiApi": "<your credential>"
      },
      "id": "175caf96-0344-47e4-9247-d36310b266c8"
    },
    {
      "parameters": {
        "resource": "message",
        "operation": "send",
        "toEmail": "={{$json[\"email\"]}}",
        "subject": "Inquiry: Wholesale Partnership with {{$json[\"brand\"]}}",
        "text": "={{$node[\"OpenAI Contacter\"].json[\"choices\"][0].message.content]}}",
        "options": {}
      },
      "name": "Send Email",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 1,
      "position": [
        650,
        200
      ],
      "credentials": {
        "gmailOAuth2Api": "<your credential>"
      },
      "id": "a374956d-356c-4b60-9f46-cac3ccd1024b"
    },
    {
      "parameters": {
        "responseData": "={{ { status: 'Email sent', details: $json } }}",
        "responseContentType": "application/json",
        "options": {}
      },
      "name": "Respond Contacter",
      "type": "n8n-nodes-base.respond",
      "typeVersion": 1,
      "position": [
        850,
        200
      ],
      "id": "609f9c4f-7c5b-4e27-8114-538a2023d038"
    }
  ],
  "connections": {
    "Webhook Brand Finder": {
      "main": [
        [
          {
            "node": "OpenAI Brand Finder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Brand Finder": {
      "main": [
        [
          {
            "node": "Respond Brand Finder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Contacter": {
      "main": [
        [
          {
            "node": "OpenAI Contacter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Contacter": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email": {
      "main": [
        [
          {
            "node": "Respond Contacter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "tags": []
}