{
  "name": "Automated invoice creation & customer communication with Jotform, Xero, Outlook & Telegram",
  "nodes": [
    {
      "id": "61d97eb7-9e7a-4ec4-a567-c03180ccdd0f",
      "name": "Receive form submission",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -464,
        0
      ]
    },
    {
      "id": "5ec3d9b8-46c4-41bc-98d6-bfb5bdfaf7a8",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -544,
        -112
      ],
      "parameters": {
        "width": 256,
        "height": 320,
        "content": "## Receive Submission\nReceives the product/service form submission from Jotform"
      }
    },
    {
      "id": "afa3abe6-529e-4a78-8272-0fdaa32bbfc4",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1664,
        -400
      ],
      "parameters": {
        "width": 1072,
        "height": 1024,
        "content": "## Automated Invoice Creation & Team Notification with Jotform, Xero, Outlook, and Telegram\nThis workflow automates the entire process of receiving a product/service order, checking or creating a cust"
      }
    },
    {
      "id": "6bcd36c0-d53f-4316-97e4-b39ec65f0f7b",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -112
      ],
      "parameters": {
        "width": 256,
        "height": 320,
        "content": "## Format Data\nFormats the data thus making it easier to be used in other nodes"
      }
    },
    {
      "id": "e5a8345a-0044-443d-86bc-f7053bb8d9a0",
      "name": "Format data",
      "type": "n8n-nodes-base.code",
      "position": [
        -160,
        0
      ]
    },
    {
      "id": "4c1db4b6-d961-4f5d-a691-4ac079848e20",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        80
      ],
      "parameters": {
        "width": 288,
        "height": 320,
        "content": "## Create Contact\nCreates a new contact"
      }
    },
    {
      "id": "02a78f6d-6ca5-43a9-b281-81e5192e0902",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        848,
        -96
      ],
      "parameters": {
        "width": 256,
        "height": 320,
        "content": "## Create The Invoice\nCreates a new invoice for that contact"
      }
    },
    {
      "id": "c9b24758-5f94-49ee-9947-fc4e2b5ef674",
      "name": "Create the invoice",
      "type": "n8n-nodes-base.xero",
      "position": [
        928,
        16
      ]
    },
    {
      "id": "0dc36d70-24f7-4131-bf75-11227c591466",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1280,
        -352
      ]
    },
    {
      "id": "31b485fd-94fa-489f-bb75-041686861752",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1280,
        -144
      ]
    },
    {
      "id": "de5dee60-bf2b-4ec5-aad4-663da044dbef",
      "name": "Sticky Note19",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        -480
      ],
      "parameters": {
        "width": 592,
        "height": 480,
        "content": "## Send The Invoice\nSends the newly created invoice for that customer(via email)"
      }
    },
    {
      "id": "b4abfdca-dd13-4236-ae82-6ad9b9f54cba",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        -112
      ],
      "parameters": {
        "width": 400,
        "height": 320,
        "content": "## Check If Contact exists \nChecks if the contact exists in Xero or not"
      }
    },
    {
      "id": "121a9b5c-577b-464d-a79a-9635d2431a29",
      "name": "Check if the customer exists",
      "type": "n8n-nodes-base.xero",
      "position": [
        128,
        0
      ]
    },
    {
      "id": "5687d623-08ed-48a1-a63a-12fe1d55cccf",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        304,
        0
      ]
    },
    {
      "id": "7048310b-d795-4d73-ae02-ba9532774c82",
      "name": "Create new contact",
      "type": "n8n-nodes-base.xero",
      "position": [
        608,
        192
      ]
    },
    {
      "id": "25318bf6-5212-4700-bb88-8f59e3fb685f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        -304
      ],
      "parameters": {
        "width": 288,
        "height": 320,
        "content": "## Update Contact\nUpdates the contact"
      }
    },
    {
      "id": "021f77f0-f990-4fc9-8bfd-82a2a0fc6fb2",
      "name": "Update contact",
      "type": "n8n-nodes-base.xero",
      "position": [
        608,
        -192
      ]
    },
    {
      "id": "f0631c6e-26fe-40c2-af37-1521f763fd7d",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1264,
        240
      ]
    },
    {
      "id": "4b7e6aa3-fbf5-410f-951e-6c8ed9d95b19",
      "name": "AI Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1376,
        672
      ]
    },
    {
      "id": "59f827be-d826-403c-8713-69bfbe4349e8",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1376,
        864
      ]
    },
    {
      "id": "4664b6f4-d9a4-4056-ae80-bebff70c14c5",
      "name": "Sticky Note20",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        544
      ],
      "parameters": {
        "width": 688,
        "height": 480,
        "content": "## Notify The Team To Act Fast\nNotifies the team (sales team for example) about the invoice since after 30 seconds no change has been done on the invoice and thus the team will be notified to act fast"
      }
    },
    {
      "id": "59351848-8223-47a3-9dfc-27aeedfa8cda",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        112
      ],
      "parameters": {
        "width": 288,
        "height": 320,
        "content": "## Wait For Sometime\nNow we will wait for 30 seconds"
      }
    },
    {
      "id": "2c7f5651-eb52-441b-9475-927ef22c4763",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1504,
        112
      ],
      "parameters": {
        "width": 288,
        "height": 320,
        "content": "## Get The Invoice\nGets the invoice details that has been just created in Xero"
      }
    },
    {
      "id": "9ba91ea8-ab1c-4927-b638-d8cbafaf534b",
      "name": "Get the invoice",
      "type": "n8n-nodes-base.xero",
      "position": [
        1600,
        240
      ]
    },
    {
      "id": "531f53e7-ebec-417b-9e46-cc5e5894af53",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        1216,
        672
      ]
    },
    {
      "id": "78a0a705-1fc4-463f-b889-882b039fa6c8",
      "name": "Notify the team",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1680,
        672
      ]
    },
    {
      "id": "83413816-6a78-475c-8b51-15e2153475bd",
      "name": "Send email",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        1568,
        -352
      ]
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Update contact",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create new contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Get the invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "Notify the team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format data": {
      "main": [
        [
          {
            "node": "Check if the customer exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update contact": {
      "main": [
        [
          {
            "node": "Create the invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the invoice": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create new contact": {
      "main": [
        [
          {
            "node": "Create the invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create the invoice": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Receive form submission": {
      "main": [
        [
          {
            "node": "Format data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if the customer exists": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}