{
  "name": "Extract invoice data from Gmail with GPT-4o and send Slack notifications",
  "nodes": [
    {
      "id": "df47f544-18a9-4eea-a02f-6e8618bdc903",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1488,
        -16
      ]
    },
    {
      "id": "fb69e703-7747-4862-8208-0d0803f5ce8f",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1040,
        -16
      ]
    },
    {
      "id": "ff1adb6a-43d6-4b36-9c91-0046b0146565",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1024,
        208
      ]
    },
    {
      "id": "acc58349-b51f-4623-9a23-f740791483fb",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -896,
        208
      ]
    },
    {
      "id": "436dccba-2b62-4ee9-b2c3-0581bc836ed7",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -464,
        80
      ]
    },
    {
      "id": "4c1eb726-1666-4f5c-b4e0-8f938f3ef791",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1552,
        208
      ],
      "parameters": {
        "width": 304,
        "height": 224,
        "content": "### ⚠️ Setup Required  \n- Connect your Gmail account using OAuth2  \n- Connect your Slack account using OAuth 2\n- Add your OpenAI API Key under **API Credentials**  "
      }
    },
    {
      "id": "17c6acfe-6074-43f9-af78-8a2f7104df5b",
      "name": "Get Unread Emails",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -1264,
        -16
      ]
    },
    {
      "id": "51725993-99b5-4d9e-a562-4e762ca6a0a2",
      "name": "Check If Email is Invoice",
      "type": "n8n-nodes-base.if",
      "position": [
        -688,
        -16
      ]
    },
    {
      "id": "ec14d8de-cfab-4b53-a3b5-9aae1c3b808d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        -128
      ],
      "parameters": {
        "width": 320,
        "height": 272,
        "content": "### 💡 Schedule Trigger  \nThis runs every hour.  \nYou can change the interval here depending on how often you want Gmail to be checked."
      }
    },
    {
      "id": "3f7e75ec-5a03-4664-b1ff-91f57bee2d9d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        -336
      ],
      "parameters": {
        "width": 272,
        "height": 400,
        "content": "### 💡 Customize Notification Format  \nYou can change the title in this node.  For example: `Pay invoice from {{sender}} by {{due_date}}`  \nInclude more invoice details in the notes field if needed.\n"
      }
    },
    {
      "id": "db70ae0c-794b-452e-b8cd-26574ff006a2",
      "name": "Notify Slack User",
      "type": "n8n-nodes-base.slack",
      "position": [
        -464,
        -112
      ]
    },
    {
      "id": "d9bc11f7-edb5-4521-9702-725c8fa736fc",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        -256
      ],
      "parameters": {
        "width": 400,
        "height": 640,
        "content": "### 🤖 AI Agent\n\n• This node uses an AI prompt to detect whether an email is invoice-related.\n• You can customize the prompt to detect other types of emails (e.g., receipts, contracts).\n"
      }
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Check If Email is Invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Unread Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Unread Emails": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Check If Email is Invoice": {
      "main": [
        [
          {
            "node": "Notify Slack User",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}