{
  "name": "🤖🚚 AI agent for transportation orders management with GPT-4o and Open Route API",
  "nodes": [
    {
      "id": "f24429ab-1276-4655-a3ef-1fbbb6d80602",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        20,
        400
      ]
    },
    {
      "id": "62ced604-4de3-4a6d-bbfe-b1c2f985117f",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        560,
        560
      ]
    },
    {
      "id": "767ee78a-d0ff-4399-bea1-4310aff116f7",
      "name": "AI Agent Parser",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        320,
        400
      ]
    },
    {
      "id": "8a0c7eb8-322b-47c1-8547-2afe0370f3fc",
      "name": "Record Email Content",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        820,
        440
      ]
    },
    {
      "id": "b2c5c252-c464-4094-93c0-9c94ccd82b14",
      "name": "Collect Addresses",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        820,
        640
      ]
    },
    {
      "id": "840698a1-2f87-43d1-a6d3-27a107d4038b",
      "name": "5 sec",
      "type": "n8n-nodes-base.wait",
      "position": [
        1700,
        540
      ]
    },
    {
      "id": "82cc284e-14a4-45de-a463-511e2a70e182",
      "name": "Query Open Route API Pickup",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1040,
        540
      ]
    },
    {
      "id": "ba4f843c-f922-486d-944c-d9ea6655ccda",
      "name": "Save Pickup GPS",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1480,
        540
      ]
    },
    {
      "id": "e87c8abb-34b4-41c2-8c4a-139248d41a20",
      "name": "GPS Pickup",
      "type": "n8n-nodes-base.set",
      "position": [
        1260,
        540
      ]
    },
    {
      "id": "556c1a60-e086-47a2-bafe-2aa3646c7846",
      "name": "Query Open Route API Delivery",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1040,
        740
      ]
    },
    {
      "id": "dd81a2cb-fe60-4e3c-95c7-08b89b111ad8",
      "name": "GPS Delivery",
      "type": "n8n-nodes-base.set",
      "position": [
        1260,
        740
      ]
    },
    {
      "id": "652c3a8f-9e47-4386-a932-be99a94e72bd",
      "name": "Save Delivery GPS",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1480,
        740
      ]
    },
    {
      "id": "0d31ad24-c3b3-42bb-b98a-ad443005341a",
      "name": "Collect Coordinates",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        820,
        940
      ]
    },
    {
      "id": "f813ecde-ea6e-4780-9bae-2be7e171419d",
      "name": "Request Open Route API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1040,
        940
      ]
    },
    {
      "id": "f9fb4321-398f-439e-832a-531245cad968",
      "name": "Save Results",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1480,
        940
      ]
    },
    {
      "id": "ac878430-fe68-42ee-9b0b-20ad9a245d9b",
      "name": "Collect Shipment Information",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        800,
        1520
      ]
    },
    {
      "id": "21631974-c8a7-4b0c-a19b-3edcf2682200",
      "name": "Driving Time & Distance",
      "type": "n8n-nodes-base.set",
      "position": [
        1260,
        940
      ]
    },
    {
      "id": "aad7e5f3-5eae-4be1-beb5-e57f7723086f",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        940,
        1660
      ]
    },
    {
      "id": "a73dfa1c-4f4e-4cab-950d-91021fc28c5d",
      "name": "AI Agent Reply",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1000,
        1520
      ]
    },
    {
      "id": "4d83c51c-b124-4732-9757-6b5490002425",
      "name": "Reply",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1340,
        1520
      ]
    },
    {
      "id": "958e7446-0078-4823-a696-eca00fa6c3fb",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        0
      ],
      "parameters": {
        "width": 1040,
        "height": 1100,
        "content": "### 3. Record Shipment Request Information and fetch distance and driving time using Open Route API\nThis starts by recording all the information parsed by the AI node. Then, we use the **Open Route AP"
      }
    },
    {
      "id": "1ef6e4fd-67a2-4d07-a6a8-294456fc3fad",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 180,
        "height": 700,
        "content": "### 1. Workflow Trigger with Gmail Trigger\nThe workflow is triggered by a new email received in your Gmail mailbox dedicated to process **shipment request**.\n\n#### How to setup?\n- **Gmail Trigger Node"
      }
    },
    {
      "id": "c470fc5f-b74b-4b3f-b9bd-6e52220f9159",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        0
      ],
      "parameters": {
        "width": 560,
        "height": 700,
        "content": "### 2. AI Agent to parse shipment information from email\nThis node will analyze the content of the email to extract information about the **sender** *(name, company)* and the **shipment** *(departure,"
      }
    },
    {
      "id": "80ed9218-8c59-4b1b-b3a6-f97f2ece11c8",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        240,
        560
      ]
    },
    {
      "id": "30592283-3d1e-4f41-b18f-55e4dd87457e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        1120
      ],
      "parameters": {
        "width": 680,
        "height": 720,
        "content": "### 4. Reply with a confirmation of shipment allocation\nWe first collect all the information from the **Google Sheets** that will be used by the AI Agent to generate a reply by email.\n#### How to setu"
      }
    },
    {
      "id": "7cce6421-6771-4cdf-a8aa-6454c6a4e27f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        720
      ],
      "parameters": {
        "width": 580,
        "height": 380,
        "content": "### [Check the Tutorial](https://youtu.be/0InkUBOUMQQ)\n![Thumbnail](https://www.samirsaci.com/content/images/2025/06/temp.png)"
      }
    }
  ],
  "connections": {
    "GPS Pickup": {
      "main": [
        [
          {
            "node": "Save Pickup GPS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GPS Delivery": {
      "main": [
        [
          {
            "node": "Save Delivery GPS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "AI Agent Parser",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent Reply": {
      "main": [
        [
          {
            "node": "Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent Parser": {
      "main": [
        [
          {
            "node": "Collect Coordinates",
            "type": "main",
            "index": 0
          },
          {
            "node": "Record Email Content",
            "type": "main",
            "index": 0
          },
          {
            "node": "Collect Addresses",
            "type": "main",
            "index": 0
          },
          {
            "node": "Collect Shipment Information",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Pickup GPS": {
      "main": [
        [
          {
            "node": "5 sec",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Collect Addresses": {
      "main": [
        [
          {
            "node": "Query Open Route API Pickup",
            "type": "main",
            "index": 0
          },
          {
            "node": "Query Open Route API Delivery",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent Reply",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent Parser",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Collect Coordinates": {
      "main": [
        [
          {
            "node": "Request Open Route API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request Open Route API": {
      "main": [
        [
          {
            "node": "Driving Time & Distance",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Driving Time & Distance": {
      "main": [
        [
          {
            "node": "Save Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent Parser",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Query Open Route API Pickup": {
      "main": [
        [
          {
            "node": "GPS Pickup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Collect Shipment Information": {
      "main": [
        [
          {
            "node": "AI Agent Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query Open Route API Delivery": {
      "main": [
        [
          {
            "node": "GPS Delivery",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}