{
  "name": "Extract email tasks with Gmail, ChatGPT-4o and Supabase",
  "nodes": [
    {
      "id": "60d16e90-4a70-4aca-9643-997141a65cdf",
      "name": "Trigger Workflow",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -580,
        -430
      ]
    },
    {
      "id": "501a117f-93ff-43e9-8a49-5f0c58c4e496",
      "name": "Prepare ChatGPT Prompt",
      "type": "n8n-nodes-base.code",
      "position": [
        520,
        -580
      ]
    },
    {
      "id": "cec2c062-7333-499a-b5c3-5f7831022d34",
      "name": "Extract Task Detail from Email",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        740,
        -580
      ]
    },
    {
      "id": "d708c9c3-d5ec-4b2a-8f8a-b5b123fa44ea",
      "name": "Insert Email Detail to Supabase",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1116,
        -505
      ]
    },
    {
      "id": "5b774acc-8e19-4576-9970-91a060d25d87",
      "name": "Get Unread Emails from Inbox",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -360,
        -430
      ]
    },
    {
      "id": "5d856e76-d335-4a72-8807-556417a35d2d",
      "name": "Get Email from Database",
      "type": "n8n-nodes-base.supabase",
      "position": [
        80,
        -580
      ]
    },
    {
      "id": "4d1d53a4-14c4-4d53-b9cb-1f29d425060b",
      "name": "Check if Email in Database",
      "type": "n8n-nodes-base.if",
      "position": [
        300,
        -580
      ]
    },
    {
      "id": "9ff6b95c-9d19-4925-a718-15ca5774d81d",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -140,
        -430
      ]
    },
    {
      "id": "a46fc69d-9711-4846-b6ff-e77394f518b5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1680,
        -640
      ],
      "parameters": {
        "width": 1000,
        "height": 1840,
        "content": "## 📩 Gmail → GPT → Supabase | Task Extractor\n\nThis n8n workflow automates the extraction of actionable tasks from unread Gmail messages using OpenAI's GPT API, stores the resulting task metadata in Su"
      }
    }
  ],
  "connections": {
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Get Email from Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger Workflow": {
      "main": [
        [
          {
            "node": "Get Unread Emails from Inbox",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare ChatGPT Prompt": {
      "main": [
        [
          {
            "node": "Extract Task Detail from Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Email from Database": {
      "main": [
        [
          {
            "node": "Check if Email in Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Email in Database": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare ChatGPT Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Unread Emails from Inbox": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Task Detail from Email": {
      "main": [
        [
          {
            "node": "Insert Email Detail to Supabase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert Email Detail to Supabase": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}