Record Transactions & Generate Budget Reports with Gemini AI, Telegram & Firefly III

Go to Workflow
0 views
Built by PTS PTS
Created on June 15, 2026

Description

Who this is for
Anybody using Firefly III, especially home/self-hosted users, who want to add some level of automation to their transaction tracking, either in addition to or because they can't or don't want to use the dataimporter

How it works - posting transactions
User sends a transaction screenshot/image or statement to a Telegram bot
Gemini analyzes it based on the user's requirements (asset account IDs & categories)
The transaction information is parsed to create a suitable POST to a Firefly instance
The transaction(s) are posted to Firefly via its API, using an OAuth2 credential

How it works - requesting budget reports
User sends the word 'Report' via telegram
A 'GET' API request is sent to Firefly for all budgets between the beginning of the month and the request date, including remaining amounts for each
This is converted to a CSV file
The CSV is sent to the user via Telegram

Prerequisites
Telegram, and knowledge of how to set up a bot (search for BotFather in Telegram)
An existing instance of Firefly III with admin access for creating OAuth2 credentials

How to set it up - Credentials
Open Telegram, and search for BotFather
Create a new bot by following the instructions
Save the API key provided
In n8n, create a new Telegram credential using the info for the new bot
Create an OAuth client in Firefly, using the redirect URL found in n8n's OAuth2 API credential creator
Fill the n8n OAuth2 API credential form as Authorization Code, filling in the remaining parameters from the info created in Firefly
Create a Gemini credential following the instructions in n8n

How to set it up - the workflow
Set the credential in each Telegram node
Set the Firefly credential in each http node
Set the correct base URL for the Firefly instance in each http node
Set the desired Gemini credential and model in each AI node
Set the correct Bank IDs (as per Firefly) and preferred categories in the AI node system message

Customization options
The user can specify all types of asset and expense accounts, as well as a specific list of categories and descriptions for Gemini to use. Gemini can also be swapped out for any other AI/LLM.

Additionally, anyone can build on this by reviewing the Firefly API documents to automate almost any other part of the Firefly software.

Nodes Used (7)

AI Agent
@n8n/n8n-nodes-langchain.agent
Code
n8n-nodes-base.code
Google Gemini
@n8n/n8n-nodes-langchain.googleGemini
Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini
HTTP Request
n8n-nodes-base.httpRequest
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured
Telegram
n8n-nodes-base.telegram