{
  "name": "🌲 AI agent for sustainability report audit with Gmail and GPT-40",
  "nodes": [
    {
      "id": "a2d54127-d1d1-44d2-859e-b89e2e6c3b4d",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        260,
        260
      ]
    },
    {
      "id": "6a664023-ea8c-4973-b3ac-13a9e0664a58",
      "name": "Check the format",
      "type": "n8n-nodes-base.code",
      "position": [
        960,
        260
      ]
    },
    {
      "id": "a16b613e-a7c2-4079-9ff9-46c485019ca3",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1240,
        260
      ]
    },
    {
      "id": "3dcbaf39-58be-465e-9ec2-0b2a9a8c8fe3",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1200,
        420
      ]
    },
    {
      "id": "6e742627-f315-4ee2-be1b-023b38103978",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1500,
        440
      ]
    },
    {
      "id": "994e5b98-5bda-4a4f-a3eb-cb521de9d88a",
      "name": "Reply",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1620,
        260
      ]
    },
    {
      "id": "8a7fbdcb-2197-437e-b3ba-126c7942ba4d",
      "name": "Extract the HTML",
      "type": "n8n-nodes-base.code",
      "position": [
        800,
        260
      ]
    },
    {
      "id": "90f271b9-4b8b-49ef-90cc-d10d8e22a203",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        -140
      ],
      "parameters": {
        "width": 380,
        "height": 680,
        "content": "### 1. Workflow Trigger with Gmail Trigger\nThe workflow is triggered by a new email received in your Gmail mailbox. \nIf the subject includes the string \"CSRD Reporting\" we proceed, if not we do nothin"
      }
    },
    {
      "id": "803a758c-fba4-4f48-818b-1272c4509e81",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        -140
      ],
      "parameters": {
        "width": 640,
        "height": 680,
        "content": "### 2. Extract and Process the xHTML report\nThis block extract the attachment file from the email, process the xHTML and perform the audit of the content.\n\n#### How to setup?\n- **Gmail Node:** set up "
      }
    },
    {
      "id": "0b72f7d8-23ce-4243-b2e5-e3ff5c7f163e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        -140
      ],
      "parameters": {
        "width": 640,
        "height": 680,
        "content": "### 3. AI Agent write and sends an audit report to the send\nThis summarize the results of the analysis in an email sent as a reply to the sender.\n\n#### How to setup?\n- **Gmail Node:** set up your Gmai"
      }
    },
    {
      "id": "18103fec-6761-4604-872e-dab251211ba0",
      "name": "HTML from binary",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        660,
        260
      ]
    },
    {
      "id": "5c31c49d-2324-4d08-a5b5-309925266517",
      "name": "Email Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        40,
        260
      ]
    },
    {
      "id": "bacbd57d-af9b-49c8-82ae-c74aa2898fc8",
      "name": "Download Attachment",
      "type": "n8n-nodes-base.gmail",
      "position": [
        480,
        260
      ]
    },
    {
      "id": "af087293-0c3c-4c96-9523-ddb9ed238e00",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1780,
        -140
      ],
      "parameters": {
        "width": 780,
        "height": 540,
        "content": "### 4. Do you need more details?\nFind a step-by-step guide in this tutorial\n![Guide](https://www.samirsaci.com/content/images/2025/04/temp-2.png)\n[🎥 Watch My Tutorial](https://www.youtube.com/watch?v="
      }
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Trigger": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check the format": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract the HTML": {
      "main": [
        [
          {
            "node": "Check the format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML from binary": {
      "main": [
        [
          {
            "node": "Extract the HTML",
            "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
          }
        ]
      ]
    }
  }
}