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. 🛠️