Integrate SimpleFIN and Firefly With N8N
By using N8N we can create a workflow ton integrate firefly with SimpleFIN to automate the adding of transactions to firefly . This workflow can also categorize two transaction as transfers based upon a defined criteria

I came across Firefly in 2020 as a way to manage my finances to get a hollistic view of all my account in place. At that time I wanted an automated way to pull transaction data from all my account with little manual work. At that time I came across the firefly-plaid connector but was having issues with connectivity so I gave up on the entire project.
I recently came back to firefly to once again manage my finances, but this time instead of going through the all complicated approach setting up plaid, I came about SimpleFIN. SimpleFIN provides a read-only API to connected bank accounts. The data is provided by MX.
I tried searching if there is an integrator of SimpleFIN in Firefly but I came across an open issue where the integration is still on the to-do list.
At this same time I recently setup N8N, which a workflow automation tool. So I came with a mind breaking idea of integrating the API's from Firefly iii and SimpleFIN together :).
SimpleFIN
Lets get started with SimpleFIN. Create an account on https://beta-bridge.simplefin.org/ add a credit card and start connecting our bank accounts.
Once we have connected our bank accounts, we create a new app connection

After creating the connection, a setup token will be shown.

Copy the setup token, and run the following curl
command on the terminal to get our username and password which will allow us to authenticate with SimpleFIN when using the API
SETUP_TOKEN=<SETUP TOKEN CREATED>
curl -X POST $( echo $SETUP_TOKEN | base64 -d)
The resulting response will be a url with the username and password
https://0000000000C988EB545BE1489D5CF8E97C5A825FF3D8B21C1C41581111111111:00000000000BD4508F54EC7E1445BEF2BED3E8B07C4BBFE1CC0CCC2222222222@beta-bridge.simplefin.org/simplefin
In this case 0000000000C988EB545BE1489D5CF8E97C5A825FF3D8B21C1C41581111111111
is the username and 00000000000BD450854EC7E1445BEF2BED3E8B07C4BBFE1CC0CCC2222222222
is the password.
We will store this in N8N for authentication. Our work with SimpleFIN concludes.
You can find the documentation on SimpleFIN here
Firefly iii
From firefly we want to grab a couple of items. First we want to generate a Personal Access Token from Options > Profile > OAuth
.
Next we want to make a note of the asset id for each asset that is connected to the SimpleFIN.
N8N
This is an overview of the workflow in N8N, which is used to integrate Firefly III and SimpleFIN

First we have store two credentials: One for Firefly and one for SimpleFIN
Firefly Header Auth
In N8N, we navigate to the credentials tab and create Header Auth and we can give it a name, in my case Firefly Header Auth
NAME=Authorization
VALUE=Bearer <Personal Access Token>
SimpleFIN Basic Auth
Next, create the Basic Auth for SimpleFIN and we give it a name, in my case SimpleFIN Basic Auth
User=<USERNAME from curl>
Password=<PASSWORD from curl>
Workflow
SimpleFIN http node
This is our entry point, we want to send a GET request to https://beta-bridge.simplefin.org/simplefin/accounts
and we will use the basic auth. Additionally, we will send the start-date
query parameter to restrict the start of the transactions and the value will be of type expression
with the following value
{{Math.floor(new Date("2024-05-01").getTime() / 1000) }}
Transaction code node
We link the http node to this node. The function of this node is to perform data transformation and adding the bank id. One particular feature we are interested in the id of the org and the bank id.
We get the id of the org after executing the http node.

We will now associate this org id, with the bank id.
const orgIds = [
{ id:"ACT-1234567-1234-123b-0987-12w345r67t", bank:"11"}, // Amex HYSA
{ id:"ACT-1234567-1234-123b-0987-12w345r67t", bank:"13"} // Additional accounts
]
...
..
.
Transfer code node (python)
One thing that I really wanted is to automatically categorize my transfers if moved money from bank A to bank B.
Lets get the config out of the way
# We have added keywords, because there maybe some transactions that have different 'banks', made on the same day and
# match the amount. Hence, we only want transactions that contain these keywords
keywords = [ 'transfer', 'zelle']
# Amount in days to consider for an item transfer
timeDeltaDays=3
Two transactions are categorized as a transactions if:
- The amount is the same
- The transactions are from two different banks
- The time difference between the two transaction falls in the
timeDeltaDays
- The description contains the
keywords
The first two points do not need much explanation, so lets start with the third point. If there is a transfer from bank A to bank B, the two bank might process the transaction different days.
As for point four, I came across a two transaction that matched all the three criteria listed above, however it those transactions should not have been classified as a transfer (one of the assets was not connected to SimpleFIN). I had transferred $8.76 from one asset to another asset and on the same day I filled up my gas, coincidentally, for the same amount from Pilot. Hence these two transaction were classified as transfer. Hence, I only went through all my transaction to look for similarities and found that my most of my transfer contained specific keywords to indicate a transfer
So if transaction A description contains Bank A - 011
and transaction B contains Investment Transfer #0001
then the keyword list would be "Bank A - 011", "transfer"
, the keywords are case-insensitive.
The inspiration for this node came from firefly-plaid-connector-2