Agency report automation

Slack alert

How this demo works

A marketing report for two made-up agency clients, a skin clinic and a home-goods store, built as live n8n workflows: a run saves the last 7 days of leads in GoHighLevel, sends conversions to Meta and checks the data; Gemini writes a summary of any period on request.

Full details

What’s real and what’s made up

Live: n8n workflows on a free server. Each run makes the leads of the last 7 days, up to the moment you press Run (Meta takes conversions up to 7 days old), saves them and their deals in a GoHighLevel sandbox (two sub-accounts), reads them back, sends the conversions to Meta’s Conversions API (a demo dataset that runs no ads) and runs the data checks. Generate AI summary asks the server for a summary of the period on screen: it works the figures out itself from the latest run, so the page sends no numbers or text, and Gemini writes with placeholders that code fills in with the real values. If its answer breaks a rule, a template writes the summary instead; tick “Simulate a broken AI answer” to see that happen.

Made up: the two clients, their leads, the ad spend, impressions and clicks, and the mistakes you choose. The demo data can contain mistakes on purpose: that is what the checks are for.

Made up on purpose: all leads are made up so the demo can be run and broken freely without any real patient’s details ever entering GoHighLevel, Meta or the AI. For a real clinic I’d keep testing on made-up data the same way.

Day, week, month and year

Each period opens on the one running now: today, this week, this month or this year so far. These refresh every 30 seconds and stay provisional until the period ends; they are compared with the same stretch before, up to the same time of day. ‹ › step back to whole earlier periods.

Day is compared with the same day a week before, since weekends are quieter than weekdays (a switch compares it with the day before instead); Week with the week before; Month and Year with the same days of last month or last year.

Everything is added up from daily totals; costs and rates are worked out again from the sums, never averaged. The run’s 7 days come from the CRM; on the day of a run, today stops at the moment of the run, since nothing more comes in on its own, until Send a test lead adds a customer (one every few seconds, up to 30 a run). Days outside the run are made-up history, generated the same way every time and with the same rates as a run, so the periods compare fairly.

Data health runs the run’s own checks on whatever period is on screen. The made-up history has the odd problem planted, like a real account: a lead with no source, someone enquiring twice, a huge order, an account total that’s off, a conversion Meta never got.

Every view shows spend against a made-up budget (a monthly budget, shared out by day for Day and Week), with a line where spend should be by now.

Every view shows the campaigns, the charts and the list of leads behind its numbers, and Download CSV saves its numbers day by day (hour by hour for today). The address keeps the client, the period and how far back you stepped, so a link opens the same view.

The workflow, step by step
    The mistakes you can put in the data
      What the AI receives for the view on screen (totals only, never names, phones or emails)
      Run the report, or wait for the latest one to load.
      What Meta receives: one example event (personal fields SHA-256 hashed)
      Limits

      The free server sleeps when nobody uses it, so if nobody has used it for a while, it can take up to 4 minutes to start. One run at a time, at most one a minute. AI summaries are kept and reused (a period still under way for an hour); after 40 new ones in a day, the template writes them.

      ← Ibrahim Jaafar · portfolio