n8n Automated Invoice Creation & Customer Communication: Jotform + Xero + Outlook + Telegram
Form submission → data parsing → Xero customer management → auto-invoicing → AI-generated email → Outlook delivery → delay check → Telegram team alert
- Who
- Freelancers, service providers, consultants, coaches, small businesses, and e-commerce sellers who need automated invoicing
- You get
- After a Jotform submission, automatically create an invoice in Xero, send it via Outlook, and alert the team via Telegram if no status change occurs within 30 seconds
Constraints
Prerequisites: n8n instance; Jotform form and webhook setup; Xero OAuth2 credentials (xeroOAuth2Api) with organizationId; OpenAI API credentials (openAiApi); Outlook email configuration; Telegram Bot and chatId. Key constraints: Jotform product/service values must exactly match your item Code in Xero; template hardcodes unitAmount as "10" and accountCode as "200"—update for your business; Telegram node chatId is blank in the template and must be filled.
What they did
Template author AppUnits AI built a 27-node n8n workflow: receives Jotform submissions via Webhook, parses address and customer info with a Code node, queries Xero contacts to decide whether to update or create a contact, creates an ACCREC invoice, calls gpt-4o-mini to generate HTML email content and sends it via Microsoft Outlook, waits 30 seconds, re-fetches the invoice status, and if unchanged calls gpt-4o-mini again to generate a Telegram alert message for the team.
How it went
Author reports the template automates the full flow from form submission to invoicing, email notification, and team alert (author_report). Template shows 734 views on n8n.io. No specific conversion or error rate data available.
Worth knowing
1. The Telegram node chatId is blank ("=") in the template and must be manually filled or notifications will fail. 2. Create the invoice hardcodes unitAmount as "10" and accountCode as "200"—update for your actual pricing and chart of accounts. 3. Jotform product/service values must exactly match your item Code in Xero or line items won't match. 4. The address parsing regex assumes Jotform uses a specific HTML format with <br> tags; adjust the Code node if your form format differs. 5. The 30-second wait-and-check design is suited for demo/testing; production should use a longer interval or webhook-based status callbacks. 6. Not tested by this site; reproduction=not_tested.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- Create the invoice node: connect xeroOAuth2Api credentials.
- OpenAI Chat Model node: connect OpenAI API credentials.
- Check if the customer exists node: connect xeroOAuth2Api credentials.
- Create new contact node: connect xeroOAuth2Api credentials.
- Update contact node: connect xeroOAuth2Api credentials.
- OpenAI Chat Model1 node: connect OpenAI API credentials.
- Get the invoice node: connect xeroOAuth2Api credentials.
Configuration to replace
- Source template is n8n public workflow #9798 (~27 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-24
Steps
Receive form submission
Configure a Webhook node in n8n (POST method) to receive Jotform submission data. In Jotform, set the Webhook URL to this node's path. Expected: execution logs show body fields including name, email, phone, itemName, and billingAddress.
Parse and format data
Add a Code node using JavaScript to extract structured address fields (line1, line2, city, stateProvince, postalZipCode, country) from the billingAddress string, and organize customer (name, email, phone) and item (name) objects. Code copied directly from template workflow.json. Expected output: JSON object with address, customer, and item.
Execution prompt · Source text。n8n Code node (Format data) JS Code field
function extractAddressData(text) { const regex = /Street Address:\s*([^<]+)<br>Street Address Line 2:\s*([^<]+)<br>City:\s*([^<]+)<br>State \/ Province:\s*([^<]+)<br>Postal \/ Zip Code:\s*([^<]+)<br>Country:\s*([^<]+)<br>/; const matches = text.match(regex); if (matches) { return { line1: matches[1].trim(), line2: matches[2].trim(), city: matches[3].trim(), stateProvince: matches[4].trim(), postalZipCode: matches[5].trim(), country: matches[6].trim() }; } return { line1: null, line2: null, city: null, stateProvince: null, postalZipCode: null, country: null } } return { address: extractAddressData($input.first().json.body.billingAddress), customer: { name: $input.first().json.body.name, email: $input.first().json.body.email, phone: $input.first().json.body.phone }, item: { name: $input.first().json.body.itemName } }Check if customer exists in Xero
Add a Xero node, set resource to Contact, operation to Get All, with where condition EmailAddress equals the parsed customer.email. Set limit to 1. Configure organizationId. Expected output: array with ContactID if found, empty array if not.
Branch: update or create customer
Add an If node with conditions: $json object exists and $json.ContactID exists. True branch connects to Update contact (update name and phone); False branch connects to Create new contact (new contact with address, phone, email). Both branches converge to Create the invoice.
Create the invoice
Add a Xero node, type set to ACCREC, contactId referencing previous ContactID, lineItems with itemCode from Format data item.name, unitAmount and accountCode adjusted for your business. Configure organizationId. Expected output: Xero returns new invoice object with InvoiceID.
AI generates email content
Add an AI Agent node, promptType set to Define, passing the full Xero invoice creation JSON response as input (text = {{ $json }}). Connect an OpenAI Chat Model sub-node with model gpt-4o-mini. Enter the systemMessage in Options. Expected output: AI-generated professional HTML email body.
Execution prompt · Source text。AI Agent node (AI Agent) Options → System Message field
=You are an AI assistant that generates a professional invoice email that you get from an Xero response (newly created invoice), so you will recive an Xero invoice response and thus your job is to create a professional html email content because this html email content will be sent to the customer.
Send email to customer
Add a Microsoft Outlook node, subject set to "New Invoice", bodyContent referencing AI Agent output, toRecipients referencing Create the invoice node's Contact.EmailAddress. Configure Outlook credentials. Expected result: customer receives HTML email with invoice details.
Wait and retrieve invoice status
Add a Wait node with amount set to 30 (seconds). Then connect a Get the invoice node with invoiceId from Create the invoice and operation set to Get. Expected output: after 30 seconds, latest invoice status from Xero.
Check if invoice status changed
Add a Switch node, rule outputKey set to "no change", condition comparing Create the invoice Status with Get the invoice Status for equality. If equal (no change), flow proceeds to AI Agent1.
AI generates Telegram alert
Add an AI Agent1 node, promptType set to Define, passing Get the invoice JSON response as input. Connect OpenAI Chat Model1 sub-node (gpt-4o-mini). Enter systemMessage in Options. Expected output: AI-generated Telegram message text urging team action.
Execution prompt · Source text。AI Agent node (AI Agent1) Options → System Message field
=You are an AI assistant that generates a telegram notification message for an invoice that has been created recently and no action/change has been done on it yet, the input that you will receive is an Xero invoice details response, so you will recive an Xero invoice response and thus your job is to create a telegram message that will notify the team about the invoice that has no actions on it yet so the team can act fast and accordingly.
Telegram team notification
Add a Telegram node, chatId filled with target group or user ID (blank in template, must configure), text referencing AI Agent1 output. Configure Telegram credentials. Expected result: team receives alert about unprocessed invoice.
Prompt you can copy
Setup guidance · Editorial suggestion。Give to setup assistant; confirm inputs and permissions first
This block is the prompt. Ads are never placed here.
You are an n8n workflow setup assistant. The user wants to replicate the Jotform + Xero + Outlook + Telegram automated invoicing flow. First confirm they have: n8n instance, Jotform form with webhook configured, Xero OAuth2 credentials (including organizationId), OpenAI API key, Outlook email account, Telegram Bot and target chatId. Then guide them through importing the template or building nodes manually, with emphasis on: verifying Jotform product values match Xero item Codes; checking the Code node's address regex matches actual form formatting; updating unitAmount and accountCode in Create the invoice for their business; filling in the Telegram node chatId. Do not provide credential contents, only configure in secure environments.
Before building, confirm all credentials and organizationId are configured; if Jotform field names differ from the template, update the $input.first().json.body references in the Code node accordingly.
Source
Automated invoice creation & customer communication with Jotform, Xero, Outlook & Telegram · appunitsai · n8n.io · 2025-10-16
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.