{
  "name": "Automate invoice generation & email delivery with Jotform, Xero & GPT-4o-mini",
  "nodes": [
    {
      "id": "5153a36b-decc-4145-bfb5-903123d3ed32",
      "name": "Receive form submission",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -464,
        0
      ]
    },
    {
      "id": "a4e41795-f814-4f53-ae06-c004d9f2fe61",
      "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": "5d0f264c-57ab-4aa8-93a9-4a45a2ffe060",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        80
      ],
      "parameters": {
        "width": 288,
        "height": 320,
        "content": "## Create Contact\nCreates a new contact"
      }
    },
    {
      "id": "601c08b9-547d-4883-bdc0-c0e2725fb5c9",
      "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": "87296102-7ff7-4a22-a451-40749a219450",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        -480
      ],
      "parameters": {
        "width": 736,
        "height": 992,
        "content": "## Generate Invoices for Customers with Jotform, Xero and Slack\nThis workflow automates the entire process of receiving a product/service order, checking or creating a customer in **Xero**, generating"
      }
    },
    {
      "id": "bea06527-f4fb-4c06-acec-80e540753990",
      "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": "6f8c1525-ee7e-4d10-a0c0-641abe512e47",
      "name": "Format data",
      "type": "n8n-nodes-base.code",
      "position": [
        -160,
        0
      ]
    },
    {
      "id": "57002967-0cc2-416a-9b2d-5e0d7425e173",
      "name": "Create the invoice",
      "type": "n8n-nodes-base.xero",
      "position": [
        928,
        16
      ]
    },
    {
      "id": "606e45ad-d5b6-4a96-ac41-d2fd73bad8d3",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1280,
        -352
      ]
    },
    {
      "id": "486a7fee-acd9-46ad-bf2b-1bc815bfb2a4",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1280,
        -144
      ]
    },
    {
      "id": "da747ce1-ddcf-4c40-a78d-452d68cac37b",
      "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": "0873e856-7c8a-46cf-b7d1-c7a75afb0c6a",
      "name": "Send email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1552,
        -352
      ]
    },
    {
      "id": "1af9a24d-7ac1-47b4-a17a-2774f01c860c",
      "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": "994373c3-4f87-48cc-a30e-d34b0b345f12",
      "name": "Check if the customer exists",
      "type": "n8n-nodes-base.xero",
      "position": [
        128,
        0
      ]
    },
    {
      "id": "14c4b4df-ce15-4e52-a89e-5a92db87b86b",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        304,
        0
      ]
    },
    {
      "id": "b6eb0744-cb7e-4676-91d5-6272ceb21924",
      "name": "Create new contact",
      "type": "n8n-nodes-base.xero",
      "position": [
        608,
        192
      ]
    },
    {
      "id": "c035f5c2-0822-4b73-b553-4a06c39bc867",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        -304
      ],
      "parameters": {
        "width": 288,
        "height": 320,
        "content": "## Update Contact\nUpdates the contact"
      }
    },
    {
      "id": "bc245137-a2fa-4817-bf79-e6bd0bcd4688",
      "name": "Update contact",
      "type": "n8n-nodes-base.xero",
      "position": [
        608,
        -192
      ]
    },
    {
      "id": "ecf29c2f-7e91-41d1-a99b-8a2de86b7ce0",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        112
      ],
      "parameters": {
        "width": 288,
        "height": 320,
        "content": "## Notify The Team\nNotifies the team (sales team for example) about the new invoice"
      }
    },
    {
      "id": "09ccbef2-8aa7-4b19-8e8b-86d6aa647298",
      "name": "Notify the team",
      "type": "n8n-nodes-base.slack",
      "position": [
        1264,
        240
      ]
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Update contact",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create new contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send email",
            "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
          }
        ]
      ]
    },
    "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": "AI Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Notify the team",
            "type": "main",
            "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
          }
        ]
      ]
    }
  }
}