Marketing operations · Vocational training

Ad leads into the database and to the right country team

Every ad-form lead captured in real time, enriched with campaign data, checked for repeats and sent to the right country team.

Swimlane diagram. When someone submits a Meta lead form, Meta calls n8n, which extracts each lead event and fetches the full answers and ad details. It looks up which internal campaign the form belongs to in Airtable and checks whether the same phone number has already been recorded for that form, skipping repeats. New leads are mapped onto database fields through one configuration block, with unexpected questions kept in a notes field, and created in Airtable. A summary goes to the country team's Telegram channel and a general channel. Failures at the fetch, lookup or create stage go to a separate technical alert channel.
How the information moves. Colours show what travels along each line; numbers match the steps below. Select the diagram to open it full size; on a small screen it also scrolls sideways.

The problem

Leads from Facebook and Instagram ad forms had to be downloaded and copied into the database by hand, with delays and duplicates. Each country team needs to see its own leads quickly, while interest is still high, and leads from a form nobody had linked to a campaign were at risk of being lost.

How it works

  1. Receive the event. Meta calls the workflow whenever someone submits a lead form. The same endpoint also answers Meta’s subscription handshake.
  2. Enrich it. Each lead event is extracted and the full answers and ad details are fetched from Meta. The workflow looks up which internal campaign the form belongs to.
  3. Record it once. The database is checked for the same phone number on the same form, and repeats are skipped. New leads are mapped onto the database fields through a single configuration block, with any unexpected questions kept in a notes field rather than lost.
  4. Tell the right people. The lead is created and a summary goes to the country team’s Telegram channel and a general channel. A failure at the fetch, lookup or create stage goes to a separate technical channel instead.

The engineering that matters

All table and field references live in one configuration node, keyed by field ID rather than column name. Switching between a test and a live table is a one-line change, and renaming a column does not break the mapping.

Nothing is silently dropped: unmapped questions are preserved in notes, and leads from forms not yet linked to a campaign are flagged for someone to link rather than discarded.

Have a process like this?

Tell us what it looks like today. We will say whether this approach would work for you.