AI Automation with n8n, Make and ZapierAutomation foundations · Lesson 2 of 17
Triggers, actions and data mapping
Video lecture
Triggers, actions and data mapping
The narrated lecture is in production
Every chapter is scripted and ready. Browse the chapters and read the full transcript now — the video will appear here when it’s published.
Chapters
Transcript of the narration, chapter by chapter.
0:00 Universal building blocks
Every automation platform, n8n, Make or Zapier, is built from the same few ideas: something starts the workflow, steps do things, and data flows between them. Once you understand triggers, actions, JSON data and mapping, switching platforms is mostly learning new button names. In this lesson you'll learn the universal building blocks, the three kinds of triggers, how to read JSON, how to map and transform data, and why arrays cause most bugs.
0:32 Why the basics matter
Why does this lesson matter? Because almost every automation bug comes from three places: the wrong trigger, a field mapped from the wrong step, or data in an unexpected format. Master triggers, JSON and mapping, and you'll build faster on every platform, debug in minutes instead of hours, and avoid the duplicate records and broken messages that make people distrust automation.
0:59 Same ideas, different names
Here's the translation table. A workflow in n8n is a scenario in Make and a Zap in Zapier. A node in n8n is a module in Make and a step in Zapier. n8n passes items of JSON, Make passes bundles, and Zapier passes step output fields. Branching is IF and Switch in n8n, routers and filters in Make, and paths and filters in Zapier. Each has a code step, and each can call raw APIs: the HTTP Request node, the HTTP module, and Webhooks by Zapier.
1:36 Analogy: filling in a bank form
An analogy for data mapping: think of filling in a form at a bank using information from your passport and a utility bill. You copy your name from the passport, your address from the bill, and you format your date of birth the way the form wants it. Mapping is exactly that: taking the right value from the right document, and transforming it into the format the next system expects.
2:06 Trigger types
There are three main kinds of trigger. Instant triggers, or webhooks, fire the moment something happens, like a form submission or a payment. They're fast and efficient. Polling triggers check an app every few minutes for new records. They're simpler for apps without webhooks, but slower. Scheduled triggers run on a timetable, like every Monday at eight. And one tip that saves embarrassment: always set the time zone. A nine a m report configured in UTC lands at two p m in Karachi and one p m in Dubai.
2:45 JSON and mapping
Nearly all automation data is JSON: objects with keys and values, arrays of objects, and nested structures. Mapping means taking a value from one step's output and putting it into another step's input, usually with a transformation. For example: trim and lowercase an email, use Unknown if the company is empty, format a timestamp for Dubai time, or join an array of interests into one line. Each platform has its own syntax: expressions in n8n, formulas in Make, Formatter steps in Zapier. The lesson text shows all three side by side.
3:25 Arrays: the bug factory
Arrays cause most automation bugs. In n8n, each node processes every item it receives, so fifty items means fifty operations. Make splits arrays into separate bundles with an iterator, and joins them back with an aggregator. Zapier handles line items in some apps and has Looping by Zapier for others. Before you connect two steps, ask: does this step output one record or many? And does the next step expect one or many? That one question prevents hours of debugging.
4:00 Normalize early
Normalize data at the entrance of your workflow. Trim and lowercase emails. Convert phone numbers to international E dot one six four format, like plus nine two three zero zero for Pakistan or plus nine seven one five zero for the UAE. Trim names, but don't force capitalization, because naming conventions differ across cultures. Store dates in UTC ISO format and convert only for display. And use ISO codes for countries and currencies. Clean data at the door prevents duplicates in your CRM later.
4:37 Worked example: one form, three platforms
Here's the same workflow on three platforms. A Dubai fitness studio's trial-class form sends name, email, phone, preferred time and goals. In n8n: a webhook trigger, an edit fields node to normalize, a CRM create-or-update node, and a WhatsApp template message. In Make: a custom webhook, set variables, a CRM create-or-update module, and a WhatsApp template module. In Zapier: a catch hook or form trigger, Formatter steps, a CRM create-or-update action and a WhatsApp action. Same design, different clicks. The lesson text includes an n8n Code node that normalizes phones and emails.
5:17 Example 2: webinar registrations
A simple example. A webinar platform sends registrations with names in capitals and phone numbers with spaces and dashes. Before adding them to the email tool, one normalization step lowercases the email, formats the phone number internationally, and converts the registration time to UTC. That tiny step prevents duplicate contacts when the same person registers twice with slightly different formatting.
5:43 Common mistakes
Common mistakes. Mapping a value from the wrong item after a branch or loop, so one customer gets another's details. Forgetting time zones on schedules and date formatting. Assuming a step outputs one record when it outputs many, or the reverse. And skipping normalization, which silently creates duplicates in the CRM that someone has to clean up by hand later.
6:09 Watch me do it: the data contract
Watch me do it. I take the blueprint's first steps and build the data contract. I write a sample payload exactly as our website form sends it: name, email with capital letters and a trailing space, phone as zero three hundred dash one two three four five six seven, country P K, message text, and a submitted at timestamp. Then I define the clean target: email lowercased and trimmed, phone in E dot one six four format, name trimmed, submitted at in UTC ISO format, and source set to website. Now I open n8n and add a webhook trigger, send the sample with curl, and pin the result so I don't need to resend it. I add a Code node and paste the normalization function from the lesson text. I run it and compare the output with my target: the phone came out as plus nine two three zero zero one two three four five six seven, correct. Then I test edge cases: a UAE number starting with double zero nine seven one, a missing phone, and an email with spaces inside. The missing phone breaks nothing, but I decide to set it to empty rather than a bare plus sign, so I adjust the function. Finally, I note the same transformations in Make formula and Zapier Formatter terms, so the three builds stay identical.
7:47 Recap and next step
Recap. Learn the concepts once: triggers, steps, JSON data, mapping, branching, loops, code and raw API calls. Choose instant triggers where possible, set time zones on schedules, always ask one or many, and normalize data at the entrance. Your next step: take the normalization Code node from the lesson text, paste it into a test n8n workflow, or rebuild it with Make formulas or Zapier Formatter, and run it on ten messy test records from your own data.
The universal building blocks
Every automation platform uses the same core concepts under different names:
| Concept | n8n | Make | Zapier |
|---|---|---|---|
| Workflow | Workflow | Scenario | Zap |
| Step | Node | Module | Step (trigger/action) |
| Start | Trigger node | Trigger module (instant or polling) | Trigger |
| Unit of data | Item (JSON) | Bundle | Step output fields |
| Branching | IF, Switch | Router + filters | Paths, Filter |
| Loops | Built-in item processing, Loop Over Items | Iterator + Aggregator | Looping by Zapier |
| Custom code | Code node (JavaScript/Python) | Custom functions / code apps (plan-dependent) | Code by Zapier (JavaScript/Python) |
| Raw API | HTTP Request node | HTTP module | Webhooks by Zapier / API Request actions |
Learn the concepts once and you can move between platforms.
Triggers: instant vs polling vs scheduled
- Instant (webhook) triggers: the source app pushes an event the moment it happens (form submitted, payment succeeded). Fast and efficient.
- Polling triggers: the platform checks the app every few minutes for new records. Simpler for apps without webhooks, but slower and can consume runs even when nothing is new, depending on platform.
- Scheduled triggers: run on a timetable (every Monday 8:00 in Asia/Karachi) for reports and batch jobs.
- Manual/chat/form triggers: start from a button, a chat message or a hosted form.
Always set the time zone explicitly for schedules. A "9 am" report configured in UTC arrives at 2 pm in Karachi and 1 pm in Dubai.
Data is JSON
Nearly all automation data is JSON: objects with keys and values, arrays of objects, nested structures.
{
"lead": {
"email": "Sara.Khan@Example.com ",
"phone": "+92 300 1234567",
"company": "Crescent Foods",
"interests": ["SEO", "Paid social"],
"submitted_at": "2026-09-21T10:15:00Z"
}
}Mapping is the act of taking a value from one step's output and putting it into another step's input, often with a transformation:
| Need | n8n expression | Make formula | Zapier | ||
|---|---|---|---|---|---|
| Lowercase + trim email | {{ $json.lead.email.trim().toLowerCase() }} | {{lower(trim(1.lead.email))}} | Formatter > Text > Lowercase (+ Trim whitespace) | ||
| Default if empty | `{{ $json.lead.company | "Unknown" }}` | {{ifempty(1.lead.company; "Unknown")}} | Formatter or Code step | |
| Format a date for Dubai | {{ DateTime.fromISO($json.lead.submitted_at).setZone("Asia/Dubai").toFormat("yyyy-LL-dd HH:mm") }} | {{formatDate(1.lead.submitted_at; "YYYY-MM-DD HH:mm"; "Asia/Dubai")}} | Formatter > Date/Time > Format | ||
| Join array | {{ $json.lead.interests.join(", ") }} | {{join(1.lead.interests; ", ")}} | Line-item/Formatter utilities |
(Exact function names and options can change; check each platform's docs.)
Arrays: the most common source of bugs
- n8n processes each item through each node automatically: a node receiving 50 items runs its operation for each (unless configured otherwise).
- Make splits arrays into bundles with an Iterator, and combines them back with an Aggregator (array, text or numeric).
- Zapier handles line items in some apps, and Looping by Zapier runs actions for each value.
Know whether a step outputs one record or many, and whether the next step expects one or many.
Normalizing data early
Clean data at the entrance of the workflow:
- Emails: trim, lowercase.
- Phones: convert to E.164 (for example
+923001234567,+971501234567). - Names: trim; do not force capitalization of names from cultures with different conventions.
- Dates: store in UTC ISO 8601; convert for display.
- Countries and currencies: ISO codes (PK, AE, SA, GB, US; PKR, AED, SAR, GBP, USD).
Worked example: one form, three platforms
A Dubai fitness studio's trial-class form sends name, email, phone, preferred time and goals. The workflow must normalize, create or update a CRM contact, and send a WhatsApp confirmation template.
- n8n: Webhook trigger -> Edit Fields (normalize with expressions) -> CRM node "create or update" by email -> WhatsApp Business Cloud node (template message) -> Respond to Webhook.
- Make: Webhooks "Custom webhook" -> Set multiple variables -> CRM "Create/Update a Contact" -> WhatsApp Business Cloud "Send a Template Message".
- Zapier: Webhooks by Zapier "Catch Hook" (or the form app trigger) -> Formatter steps -> CRM "Create or Update Contact" -> WhatsApp action.
Same design, different clicks.
Hands-on: a normalization Code node (n8n, JavaScript)
// n8n Code node, mode: "Run Once for All Items"
const toE164 = (raw, defaultCountry = "AE") => {
let d = String(raw || "").replace(/[^\d+]/g, "");
if (d.startsWith("00")) d = "+" + d.slice(2);
if (!d.startsWith("+")) {
const cc = { AE: "971", PK: "92", SA: "966", GB: "44", US: "1" }[defaultCountry];
d = "+" + cc + d.replace(/^0+/, "");
}
return d;
};
return $input.all().map(item => {
const l = item.json;
return {
json: {
email: String(l.email || "").trim().toLowerCase(),
phone: toE164(l.phone, l.country || "AE"),
name: String(l.name || "").trim(),
submitted_at: new Date(l.submitted_at || Date.now()).toISOString(),
source: l.source || "website",
},
};
});Test with messy inputs ("0300-1234567", "00971 50 123 4567", " SARA@X.COM ") and edge cases (missing phone).
Pitfalls
- Mapping the wrong item after a branch or loop.
- Forgetting time zones on schedules and date formatting.
- Skipping normalization, which causes duplicates in the CRM.
Key takeaways
- Workflows, steps, data units, branching, loops, code and raw API calls exist on every platform under different names.
- Prefer instant (webhook) triggers; use polling when needed; always set time zones on schedules.
- Automation data is JSON; mapping moves and transforms values; arrays (one vs many) cause most bugs.
- Normalize at the entrance: lowercase emails, E.164 phones, UTC ISO dates and ISO codes.
Check your understanding
Quick questions to lock in the lesson. They don’t count towards your certificate.
Put it into practice
Paste the normalization Code node into a test n8n workflow (or rebuild it with Make formulas or Zapier Formatter) and run it on ten messy records from your own data. Fix any edge cases.
Enrol for free to save your progress
Reading is always free. Enrol to keep your place, take the final assessment and earn a verifiable certificate.