Draft bookkeeping entries from Trello cards with OpenRouter and Xero
Go to WorkflowDescription
Quick overview
This workflow triggers from Trello card activity to draft bookkeeping entries by extracting transaction details with OpenRouter and enriching them with live Xero chart-of-accounts, tax rates, contacts, and bill context, then posts a review-ready summary and embedded JSON back to the Trello card.
How it works
Triggers from Trello when a card is moved to the Ready list or when the Retry AI label is added.
Fetches the current Xero chart of accounts, bank accounts, and tax rates to use as live reference data.
Loads the Trello card details, recent comments, and attachment metadata and stops with an error note if the text lacks enough detail for extraction.
Sends the card title/description/comments to OpenRouter to extract a structured bookkeeping draft and normalizes key fields like dates, line items, and payment reference.
Uses Xero Contacts (and, for bill payments, Xero Invoices) to resolve the vendor and refine PAY_BILL vs SPEND_MONEY before optionally asking OpenRouter to classify expense line items to Xero account codes.
Validates and maps any suggested account codes against the live Xero chart of accounts, embeds Xero configuration needed for posting later, and records receipt attachment metadata.
Deletes stale AI draft comments on retry, then posts a human-readable draft summary plus a hidden comment to Trello and applies the For Review label, or comments an error and applies the AI Failed label on failure.
Setup
Create and connect credentials for Trello API, OpenRouter API, and Xero OAuth2.
Update the Trello board ID, Ready list ID, and label IDs for Retry AI, For Review, and AI Failed in the workflow parameters.
Set your Xero tenant ID in the Xero-Tenant-Id header used by all Xero HTTP requests and ensure the Xero connection has access to Accounts, TaxRates, Contacts, and Invoices.
Confirm or change the OpenRouter model in the OpenRouter request payload builder code if you do not want to use the free models.
Configure your Trello process so reviewers add an Approved label only after verifying the draft, since posting to Xero is handled in the companion workflow.
Requirements
Trello API Key, OpenRouter API Key, Xero App, Xero OAuth2 Credentials (via the Xero Developers Platform)
Customization
You can adjust the AI prompts and validation rules to support different bookkeeping policies, currencies, chart-of-account conventions, or Trello board processes. The label IDs, tax-code selection, suspense account fallback, and entry-type refinement logic are the main workflow-specific customization points.