AI Automation with n8n, Make and ZapierAutomation foundations · Lesson 2 of 17

Triggers, actions and data mapping

Article · 15 min · 8 min lecture

Video lecture

Triggers, actions and data mapping

13 chapters · about 8 min · full transcript

Coming soon

Chapter 1 of 13

Universal building blocks

  • Triggers, steps, data
  • JSON and mapping
  • Arrays and normalization

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

The universal building blocks

Every automation platform uses the same core concepts under different names:

Conceptn8nMakeZapier
WorkflowWorkflowScenarioZap
StepNodeModuleStep (trigger/action)
StartTrigger nodeTrigger module (instant or polling)Trigger
Unit of dataItem (JSON)BundleStep output fields
BranchingIF, SwitchRouter + filtersPaths, Filter
LoopsBuilt-in item processing, Loop Over ItemsIterator + AggregatorLooping by Zapier
Custom codeCode node (JavaScript/Python)Custom functions / code apps (plan-dependent)Code by Zapier (JavaScript/Python)
Raw APIHTTP Request nodeHTTP moduleWebhooks 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:

Needn8n expressionMake formulaZapier
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.

  1. A weekly report scheduled for 9:00 UTC arrives at 2 pm for the Karachi team. What was missed?
  2. In Make, which modules split an array into bundles and combine them back?
  3. Why normalize phone numbers to E.164 at the start of a workflow?

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.