YNAB icon

YNAB

Node for automating YNAB budget

Overview

This node integrates with the YNAB (You Need A Budget) API to create financial transactions within a specified budget. It allows users to add detailed transaction records including amounts, accounts, dates, payees, categories, memos, and subtransactions (for split transactions). This is useful for automating personal or business budgeting workflows, syncing external financial data into YNAB, or programmatically managing budgets.

Practical examples:

  • Automatically logging expenses from an e-commerce platform into YNAB.
  • Creating split transactions where one payment covers multiple categories.
  • Adding scheduled or recurring transactions with detailed metadata.

Properties

Name Meaning
Amount The total amount of the transaction. Must be a number with up to two decimal places.
Account ID Identifier of the account used for this transaction.
Date The date of the transaction in ISO format. Cannot be a future date.
Additional Fields Optional extra fields to provide more details about the transaction:
- Payee ID Identifier of the payee associated with the transaction.
- Payee Name Name of the payee. If Payee ID is not provided, this name will be used to find or create a payee.
- Category ID Identifier of the category for the transaction. Leave empty if creating a split transaction with subtransactions.
- Cleared Status of the transaction. Options are: "Cleared", "Uncleared", or "Reconciled". Default is "Cleared".
- Memo Optional text note attached to the transaction.
- Sub Transactions Collection of subtransactions for split transactions. Each subtransaction includes:
- Amount Amount for the subtransaction (must sum to the main Amount).
- Payee ID Payee identifier for the subtransaction.
- Payee Name Payee name for the subtransaction, used if Payee ID is missing.
- Category ID Category identifier for the subtransaction. Note that credit card payment categories are ignored if supplied.
- Memo Optional memo for the subtransaction.

Output

The node outputs a JSON object representing the created transaction as returned by the YNAB API. This includes all transaction details such as:

  • id: Unique transaction identifier.
  • date: Transaction date.
  • amount: Amount in milliunits (amount * 1000).
  • account_id: Associated account.
  • payee_id / payee_name: Payee information.
  • category_id: Category assigned.
  • memo: Any notes.
  • cleared: Status of the transaction.
  • subtransactions: Array of subtransaction objects if applicable.

No binary data output is produced by this node.

Dependencies

  • Requires an active connection to the YNAB API via an API key credential configured in n8n.
  • The node dynamically constructs API URLs using the budget ID obtained from credentials or configuration.
  • Uses the Luxon library internally for date formatting.
  • Requires proper permissions on the YNAB API to create transactions.

Troubleshooting

  • Error: Invalid date or date in the future
    Ensure the Date property is correctly formatted and not set to a future date, as the API rejects future-dated transactions.

  • Error: Amount mismatch in subtransactions
    When providing subtransactions, the sum of their amounts must exactly equal the main transaction amount. Otherwise, the API ignores the subtransactions.

  • Error: Unauthorized or invalid API key
    Verify that the API key credential is valid and has access to the specified budget.

  • Error: Missing required fields
    Make sure Amount, Account ID, and Date are provided as they are mandatory.

  • Error: Category or Payee not found
    If you specify a Category ID or Payee ID that does not exist, the API may return an error. Use Payee Name to auto-resolve or create payees if needed.

Links and References

Discussion