🧾 Post approved Trello bookkeeping drafts to Xero with receipt attachments

⚡ 11 views · 🧾 Invoice Processing

Description

Quick overview

This workflow listens for an “Approved” label on a Trello card, reads the AI draft bookkeeping JSON from card comments, and posts the corresponding transaction to Xero. It then adds a Xero deep link back to Trello, uploads receipt images as Xero attachments, and moves the card to Done.

How it works

  1. Triggers in Trello when a user adds the configured Approved label to a card on the target board.
  2. Fetches the card’s comments, extracts the <!-- AI_DRAFT_JSON --> payload, validates required fields, and skips processing if a <!-- XERO_URL --> sentinel comment already exists.
  3. For SPEND_MONEY and PAY_BILL entries, pulls active Xero bank accounts and resolves the bank account and payment reference from the draft and any reviewer comments, pausing to request confirmation on the Trello card if values are ambiguous.
  4. For PAY_BILL entries, fetches open supplier bills from Xero and either matches the payment to a single ACCPAY invoice or asks the reviewer to confirm the bill in a Trello comment.
  5. Builds and posts the appropriate Xero record (Bank Transaction, Bill, Payment, or Manual Journal) via the Xero API and generates a Xero deep link for the created entity.
  6. Immediately writes the <!-- XERO_URL --> deep link back to Trello, then downloads image attachments from the Trello card and uploads them to the Xero record as receipt attachments.
  7. Posts a success comment on the Trello card, removes the For Review label, and moves the card to the configured Done list, or on failure comments the error details, adds the Xero Failed label, and removes Approved.

Setup

  1. Create Trello API credentials and Xero OAuth2 credentials in n8n, and set your Xero tenant ID (YOUR_XERO_TENANT_ID) in all Xero HTTP requests.
  2. Update the Trello board ID (YOUR_TRELLO_BOARD_ID) and paste your Trello label/list IDs for Approved, For Review, Done, and Xero Failed (YOUR_TRELLO_APPROVED_LABEL_ID, YOUR_TRELLO_FOR_REVIEW_LABEL_ID, YOUR_TRELLO_DONE_LIST_ID, YOUR_TRELLO_XERO_FAILED_LABEL_ID).
  3. Import and activate the upstream workflow that writes the <!-- AI_DRAFT_JSON --> comment to cards (the companion “AI Draft/Commit” workflow), then activate this workflow.
  4. Ensure Trello cards include receipt images as attachments if you want them uploaded to Xero, and optionally set TRELLO_N8N_BOT_MEMBER_ID as an environment variable to ignore bot-added Approved label events.

Requirements

  1. Approved (trigger label) 2) For Review, 3) Xero Failed 4) A Done list for completed cards

Customization

🔗 Nodes Used

HTTP Request, Trello Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup