Mission: Deliver a Report (Part 1) ๐
Thanks for hanging out, everyone! Time to make it worth the wait. โณ I started a business a little while backโI donโt think thatโs been covered yet. You guys can let me know if we should discuss that! ๐ผ I won't give away intimate details for obvious business reasons, but hereโs what I can tell you: my business partner and I recently created an application that generates a report in JSON. ๐ I built the app in n8n and I'm using a couple of AI agents to generate the report based on the data provided to them. ๐ค The next question is: how do we get the report out of n8n and to the person who needs it? ๐ค The Workflow โ๏ธ First, itโs important to know that a lot of what we do happens within the GoHighLevel (GHL) platform. * We receive data via a form that sends a request to our webhook in n8n. * We receive a binary file that I convert to JSON. * I use that JSON, along with some other data, to generate the final report. The Easy Road ๐ฃ๏ธ The easiest way to deliver the report is via email. GHLโs API makes me feel confident that Iโll be able to send an email using a template we created in the platform and simply attach the report. ๐ง Iโve been getting more into the habit of using AI. The Google Workspace I pay for comes with Gemini, so I use that a lot. I took the JSON report and fed it into Gemini with a prompt to analyze the schema and write JavaScript that converts JSON to HTML. ๐ป Gemini gave me the code, which I dropped into a Code Node in n8n. It took a few tweaks, but it was super easy! I donโt even write JavaScript, yet I was able to get this done in a few minutes. The result was a bunch of HTML that looks AMAZING when rendered. โจ I used another node to convert that HTML into a PDF, so now the report is ready to be attached! Once I finish the email template, Iโll be able to test the delivery. ๐ The Hard Road ๐ง The "hard" road involves delivering reports directly to a user account with a dashboard. Weโre going to cover this in future parts! ๐๏ธ If thereโs anything in this post that you want me to expound on, let me know in the comments! This was just to get everyone engagedโthis is going to lead to some very technical, hands-on project work that I hope everyone joins in on. ๐ ๏ธ