{
  "name": "🎓 How to transform unstructured email data into structured format with AI agent",
  "nodes": [
    {
      "id": "97cce9f4-cb8e-4ea7-872b-e1f8054afc3a",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -480,
        -224
      ]
    },
    {
      "id": "13fffb5b-724c-4adf-8c99-5e16f10a5324",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -112,
        160
      ]
    },
    {
      "id": "90d9983b-b4a6-427f-970c-388bae72fb1f",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        128,
        160
      ]
    },
    {
      "id": "1165ea37-01f5-4835-b04d-c91395519e04",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        80,
        336
      ]
    },
    {
      "id": "481c0914-84c3-4c5f-9247-ec709bf18e53",
      "name": "Insert row",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        288,
        -64
      ]
    },
    {
      "id": "ca682a7e-9630-4c8b-b8eb-17f557354eb8",
      "name": "Email Trigger (IMAP)",
      "type": "n8n-nodes-base.emailReadImap",
      "position": [
        -480,
        -64
      ]
    },
    {
      "id": "15c2dbd5-6e23-4920-843a-7ce7a43fdcf5",
      "name": "Microsoft Outlook Trigger",
      "type": "n8n-nodes-base.microsoftOutlookTrigger",
      "position": [
        -480,
        80
      ]
    },
    {
      "id": "04dc1bd7-6ecb-457f-835b-e67b910e30ad",
      "name": "Parsing Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -64,
        -64
      ]
    },
    {
      "id": "b0d03646-57f1-4eb0-8f1c-3c27c3900466",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -512,
        -928
      ],
      "parameters": {
        "width": 976,
        "height": 400,
        "content": "## How to Transform Unstructured Email Data into Structured Format Using an AI Agent\n\nThis workflow leverages artificial intelligence to automatically transform **unstructured email data** from multip"
      }
    },
    {
      "id": "17751b90-4db6-45d7-b426-db157e1199db",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -512,
        -512
      ],
      "parameters": {
        "width": 480,
        "height": 176,
        "content": "## STEP 1\nCreata a n8n table with the following fields:\n- From\n- To\n- Subject\n- Summary"
      }
    },
    {
      "id": "fc864e0b-f04e-4996-a012-fbe7ad52dc6b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -512
      ],
      "parameters": {
        "width": 480,
        "height": 176,
        "content": "## STEP 2\nConnect triggers from different sources:\n- Gmail\n- Outlook\n- Imap"
      }
    },
    {
      "id": "ebabb739-ecb9-450b-abb5-1d27d6a95832",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        96
      ],
      "parameters": {
        "width": 272,
        "height": 176,
        "content": "Set the structured data from json"
      }
    },
    {
      "id": "84b10b19-a1a2-4fac-b791-8ef5aa1160c6",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        576,
        -64
      ]
    },
    {
      "id": "e846ffd6-7ee5-4486-9f6d-a73f349814b9",
      "name": "Email Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        880,
        -64
      ]
    },
    {
      "id": "c833e8c1-68d5-421c-9f71-0d928b14ad19",
      "name": "Emails",
      "type": "n8n-nodes-base.dataTableTool",
      "position": [
        1056,
        160
      ]
    },
    {
      "id": "16feafab-fa9e-4acb-85b5-cd04e6b621d0",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        800,
        144
      ]
    }
  ],
  "connections": {
    "Emails": {
      "ai_tool": [
        [
          {
            "node": "Email Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Parsing Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parsing Agent": {
      "main": [
        [
          {
            "node": "Insert row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Parsing Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Structured Output Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Email Trigger (IMAP)": {
      "main": [
        [
          {
            "node": "Parsing Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Email Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Parsing Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Microsoft Outlook Trigger": {
      "main": [
        [
          {
            "node": "Parsing Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Email Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}