{
  "name": "Qualify new leads in Google Sheets via OpenAI's GPT-4",
  "nodes": [
    {
      "id": "1f179325-0bec-4e5c-8ebd-0a2bb3ebefaa",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1440,
        340
      ]
    },
    {
      "id": "7b548661-2b32-451f-ba52-91ca86728f1e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        358,
        136.3642172523962
      ],
      "parameters": {
        "width": 442,
        "height": 360.6357827476038,
        "content": "### 1. Create a Google Sheet document\n* This template uses Google Sheet document connected to Google Forms, but a standalone Sheet document will work too\n* Adapt initial trigger to your needs: check f"
      }
    },
    {
      "id": "308b4dce-4656-47bd-b217-69565b1c34f6",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        820,
        420
      ],
      "parameters": {
        "width": 471,
        "height": 322,
        "content": "### 2. Provide lead qualification instructions\n* Create a __system message__ with overall instructions\n* Add a __user message__ with the JSON variables\n* Set node parses the resulting JSON object, but"
      }
    },
    {
      "id": "c00442ca-98cf-4296-b084-f0881ce4fd39",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1320,
        222.18785942492013
      ],
      "parameters": {
        "width": 355,
        "height": 269.81214057507987,
        "content": "### 3. Combine the initial data with GPT response\n* This Merge node puts together original records from the google sheet and responses from the OpenAI"
      }
    },
    {
      "id": "62643a4c-a69c-4351-9960-20413285ff33",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1700,
        220
      ],
      "parameters": {
        "width": 398,
        "height": 265,
        "content": "### 4. Update the Google Sheet document\n* Provide __Column to Match On__ (usually a timestamp in case of Google Forms)\n* Enter the result from GPT into a separate column"
      }
    },
    {
      "id": "4cd58340-81c4-46c7-b346-25a9b6ef2910",
      "name": "Update lead status",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1860,
        340
      ]
    },
    {
      "id": "fea0acee-13b6-441a-8cf9-c8fedbc4617d",
      "name": "Extract JSON reply",
      "type": "n8n-nodes-base.set",
      "position": [
        1120,
        580
      ]
    },
    {
      "id": "0a0608fe-894f-4eb5-b690-233c6dfc0428",
      "name": "Qualify leads with GPT",
      "type": "n8n-nodes-base.openAi",
      "position": [
        900,
        580
      ]
    },
    {
      "id": "22fdec69-a4a9-430d-9950-79195799ae7a",
      "name": "Check for new entries",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        520,
        340
      ]
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Update lead status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract JSON reply": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Check for new entries": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          },
          {
            "node": "Qualify leads with GPT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Qualify leads with GPT": {
      "main": [
        [
          {
            "node": "Extract JSON reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}