My n8n automation to create, store and send invoices in seconds to clients and freelancers

You will find a detailled explaination of my invoice create program

Tiro

Tiro

Tiro

To further accelerate our processes, I decided to create an n8n Invoice and Estimate automation workflow :

You can see that there are 2 different triggers :

  • The first one is for estimates, created when an entrepreneur creates a project from the platform [ ref My web application ], and it is sent only to entrepreneurs

  • The second one is for invoices, created and sent just before a project launch to students and entrepreneurs (the two invoices are not the same; we basically charge the entrepreneur, take our margin (25%), and then create an invoice for the designer who charges us the rest ).


Let me walk you through the process. I will focus on the estimate creation because it is the same process, but simpler. After all, it is only for entrepreneurs.

So, when a project is added to the projects database table, it triggers a POST webhook, then with the data I retrieve from the webhook, I launch a SQL query that gets all the necessary information from different tables of the database.


Then, using these data, I create an HTML code that creates a complete and beautiful estimate. Then I want to convert this HTML estimate to a PDF estimate. I was shocked at the price of HTML to PDF services, so I built it myself. The process is pretty clear : I convert the HTML code to binary, then make an HTTP request to Gotenberg, a Docker container running on our server [ ref Cloud Computing ], and finally change its name with data from the SQL query.


Last but not least, I add the estimate or invoice into my Notion organization [ ref Notion Project ], and send the estimate to the client with Brevo's API.

Please take a look at the mail and invoice that I created thanks to this technique.



Thank you for reading me.

Contact me

Tiro

Contact me

Tiro

Contact me

Tiro