Chapter 01
How automation works
The ideas every automation tool is built on: triggers and actions, JSON, data mapping, HTTP, REST APIs, webhooks, authentication and rate limits.
Trigger
Also called instant trigger, polling trigger, event
- What
- The event that starts a workflow: a form submitted, an email received, a record created or a schedule reached. Instant triggers are pushed to the tool; polling triggers check for new data on an interval.
- Why
- The trigger decides how fast a workflow reacts and how much it costs, because polling triggers can run often even when nothing is new.
Watch out
Polling every minute for data that changes once a day, which wastes runs and credits.
Action
Also called step, module, node
- What
- A step that does something after the trigger: create a CRM contact, send a message, add a row, call an API. Tools call them nodes (n8n), modules (Make) or action steps (Zapier).
- Why
- Actions are where a workflow changes things in the real world, so they are what you test, retry carefully and usually pay for.
Watch out
Using a plain create action where an update-or-create would stop duplicates.
JSON
Also called JavaScript Object Notation, payload
- What
- The text format apps use to exchange data: objects in curly braces with named fields, arrays in square brackets, and values that are strings, numbers, booleans or null.
- Why
- Every step input and output in an automation tool is JSON underneath. Reading it lets you map the right field and spot a number stored as text.
{
"orderId": "A-1042",
"total": "12.50",
"customer": { "email": "sara@example.com" },
"items": [
{ "sku": "TEE-M", "qty": 2 },
{ "sku": "CAP", "qty": 1 }
]
}Watch out
Treating "12.50" as a number: it is a string until you convert it.
Data mapping
Also called field mapping, expressions
- What
- Choosing which output of an earlier step fills each input of a later step, often with a small transformation such as trimming, lowercasing or a fallback value.
- Why
- Most workflow bugs are mapping bugs. Clean mapping keeps CRMs tidy and stops blank or malformed values reaching customers.
Formatter > Text > Trim Whitespace: (1) Email
Formatter > Text > Lowercase: (2) Output
Formatter > Text > Default Value: (1) First Name, "there"Watch out
Testing mappings only with a tidy sample where every field is filled.
HTTP request
Also called HTTP method, status code, GET, POST
- What
- A call to an API with a method (GET reads, POST creates, PUT or PATCH updates, DELETE removes), a URL, headers and often a JSON body. The response carries a status code: 2xx success, 4xx your mistake, 5xx server trouble.
- Why
- When an app has no ready connector, an HTTP step is how you reach it, and the status code tells you whether to fix, retry or give up.
POST /v3/contacts HTTP/1.1
Host: api.example-crm.com
Authorization: Bearer <token from credentials>
Content-Type: application/json
{ "email": "sara@example.com", "source": "web-form" }Watch out
Retrying 400 or 401 errors, which will fail every time until the request or credential is fixed.
REST API
Also called API, endpoint, API documentation
- What
- An API that exposes data as resources at URLs, such as /contacts/123, and uses HTTP methods to act on them. Its documentation lists endpoints, required fields, auth, pagination and limits.
- Why
- Reading API docs lets you connect the apps a client relies on that have no official connector, which is often the valuable part of a job.
Watch out
Building from a blog example instead of the official docs, then hitting a retired API version.
Webhook
Also called callback URL, catch hook, instant trigger
- What
- An HTTP request an app sends to your URL when an event happens, carrying the event data as JSON. It powers instant triggers.
- Why
- Webhooks are faster and cheaper than polling, but your workflow must reply quickly, expect duplicates and check the sender.
POST /webhook/new-order HTTP/1.1
Content-Type: application/json
X-Signature: 5d41402abc4b2a76b9719d911017c592
{ "event": "order.paid", "id": "evt_981", "orderId": "A-1042" }Watch out
Sharing a production webhook URL publicly, so anyone can send fake events into it.
API key
Also called token, bearer token, secret
- What
- A long secret string that identifies the caller to an API, usually sent in a header. Whoever holds it can act as that account.
- Why
- Keys are the keys to a client business. Stored in the tool credential store, they stay out of exports, screenshots and shared docs.
Watch out
Pasting a key into a node field or code step, where it is exported with the workflow.
OAuth 2.0
Also called OAuth, scopes, Sign in with Google
- What
- A flow where the account owner approves limited permissions, called scopes, and the tool receives a token that can be refreshed or revoked without sharing a password.
- Why
- Most built-in connections use OAuth. Choosing narrow scopes and the right account owner decides who controls the data later.
Watch out
Approving every scope offered when the workflow needs read access to one sheet.
Rate limit
Also called 429, quota, throttling, Retry-After, too many requests
- What
- A cap on how many requests an API accepts in a time window, such as 100 per minute. Going over returns 429 Too Many Requests, often with a Retry-After header.
- Why
- Loops over large lists hit limits fast. Batching, waits and respecting Retry-After keep big syncs from failing halfway.
HTTP/1.1 429 Too Many Requests
Retry-After: 30
Content-Type: application/json
{ "error": "rate_limited", "limit": "100 per minute" }Watch out
Testing with five records and going live with five thousand.