{
  "name": "Automate Gmail email categorization with GPT-4o AI and reasoning",
  "nodes": [
    {
      "id": "0e71a8c5-ba96-473d-9e7e-ccfce68dc949",
      "name": "Get Label Id's",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -640,
        112
      ]
    },
    {
      "id": "c2466e9e-48fe-4aee-83af-dd8776229bae",
      "name": "Watch Incoming Emails",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -272,
        -112
      ]
    },
    {
      "id": "61e42b53-6c7c-4f8b-9faa-469431d4e5bd",
      "name": "Mark Email As Read",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -32,
        -112
      ]
    },
    {
      "id": "9f5a4ef6-c8de-48c2-88d5-8347a53a7284",
      "name": "Justify/Reason the Label AI has chosen",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        256,
        32
      ]
    },
    {
      "id": "eba6b8a0-90e9-480b-a7d3-8492f3399e45",
      "name": "Select most appropriate Label",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        192,
        -112
      ]
    },
    {
      "id": "d2ec935e-c6da-4f1c-9646-bb45d51e2d8f",
      "name": "Add Label",
      "type": "n8n-nodes-base.gmail",
      "position": [
        608,
        -112
      ]
    },
    {
      "id": "f0192bba-e57f-414d-81a6-1565e172e446",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        -320
      ],
      "parameters": {
        "width": 356,
        "height": 256,
        "content": "## Important Info\n\n### Replace the Labels that are in the Chatgpt prompt with the labels that are in your gmail account. \n\n### Along with the label names you will need to find the Label Id's for each "
      }
    },
    {
      "id": "5de2cb7f-4338-45e7-b213-f065ee392297",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -256
      ],
      "parameters": {
        "width": 180,
        "height": 400,
        "content": "## Marks Email As Read In your Account"
      }
    },
    {
      "id": "ae40c679-a388-467e-8a2c-2ddf242892dd",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        -256
      ],
      "parameters": {
        "width": 380,
        "height": 400,
        "content": "## Selects Label to put email under and justify's / reasons as to why it has chosen the label it has. "
      }
    },
    {
      "id": "fc0f114b-f149-403e-af13-6a749bb2fc89",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        -256
      ],
      "parameters": {
        "width": 260,
        "height": 400,
        "content": "## Finally, a label is added to the email"
      }
    },
    {
      "id": "f180f376-184d-48e9-a220-c07f475d74f2",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        -32
      ],
      "parameters": {
        "width": 356,
        "height": 300,
        "content": "### Used to find label id's in your email account to put in the prompt of the ChatGPT (OpenAI) Node in the flow"
      }
    },
    {
      "id": "a9d7eaf6-f902-4f9b-a19f-bea0a89b8764",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        -256
      ],
      "parameters": {
        "width": 260,
        "height": 400,
        "content": "## Watches Incoming Emails"
      }
    },
    {
      "id": "0a289e3f-1ed7-43b3-9449-8f5bd3f38478",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1808,
        -608
      ],
      "parameters": {
        "width": 912,
        "height": 1152,
        "content": "AI inbox labelling manager that has reasoning attached to the ChatGPT inbox manager within n8n. Super simple yet highly effective automation.\n\n## How it works: \n\n• Monitors Gmail inbox → triggers work"
      }
    }
  ],
  "connections": {
    "Mark Email As Read": {
      "main": [
        [
          {
            "node": "Select most appropriate Label",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Watch Incoming Emails": {
      "main": [
        [
          {
            "node": "Mark Email As Read",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select most appropriate Label": {
      "main": [
        [
          {
            "node": "Add Label",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Justify/Reason the Label AI has chosen": {
      "ai_tool": [
        [
          {
            "node": "Select most appropriate Label",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}