See llms.txt for all machine-readable content.

Back to Templates

Draft bookkeeping entries from Trello cards with OpenRouter and Xero

Created by

Created by: Kristian || kristian
Kristian

Last update

Last update 20 hours ago

Categories

Share


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

  1. Triggers from Trello when a card is moved to the Ready list or when the Retry AI label is added.
  2. Fetches the current Xero chart of accounts, bank accounts, and tax rates to use as live reference data.
  3. Loads the Trello card details, recent comments, and attachment metadata and stops with an error note if the text lacks enough detail for extraction.
  4. 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.
  5. 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.
  6. 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.
  7. Deletes stale AI draft comments on retry, then posts a human-readable draft summary plus a hidden <!-- AI_DRAFT_JSON --> comment to Trello and applies the For Review label, or comments an error and applies the AI Failed label on failure.

Setup

  1. Create and connect credentials for Trello API, OpenRouter API, and Xero OAuth2.
  2. Update the Trello board ID, Ready list ID, and label IDs for Retry AI, For Review, and AI Failed in the workflow parameters.
  3. 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.
  4. Confirm or change the OpenRouter model in the OpenRouter request payload builder code if you do not want to use the free models.
  5. 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.