Nodes, credentials and expressions
🎯You'll be able to
Build a workflow from nodes, store a login as a credential and use expressions to read fields from earlier steps.
🏠The everyday picture
A train route is a line of stations. Each station does one job (load passengers, change crew, check tickets), and the train carries everything from one station to the next. In n8n, nodes are the stations and the data is the train.
📘What it really is
-
A workflow is a chain of nodes. Each node does one job: a trigger (Webhook, Schedule, Gmail), an app action (Google Sheets, Slack, HTTP Request), a logic step (IF, Switch, Merge) or a code step.
-
Data moves as a list of items. Each item is a JSON object, such as
{ "name": "Asha", "amount": 2400 }. Most nodes run once for each item they receive. -
Credentials store logins and API keys separately from the workflow, encrypted. Nodes refer to a credential by name, so you can share a workflow without sharing the secret.
-
Expressions pull values from earlier data, written inside double braces:
{{ $json.email }}: a field from the current item;{{ $('Order webhook').item.json.order_id }}: a field from a named earlier node;-
{{ $now.toFormat('dd LLL yyyy') }}: today's date, formatted. -
Pin data lets you save sample data on a node, so you can build later steps without triggering the real event each time.
📝A worked example
A first Sharma Textiles workflow, step by step:
- Webhook node receives a test order:
{ "order_id": "ST-1042", "name": "Asha", "phone": "9876543210", "amount": 2400 }. - Pin that data so you can test repeatedly.
- Google Sheets node (credential: "Sharma Sheets") appends a row with columns mapped by expression: Order =
{{ $json.order_id }}, Name ={{ $json.name }}, Amount ={{ $json.amount }}, Date ={{ $now.toFormat('yyyy-LL-dd') }}. - Run the workflow and check the new row.
🌍Where it's used
- Order and lead capture: webhooks into sheets and CRMs.
- Notifications: Slack, email or WhatsApp messages built from expressions.
- Reports: scheduled workflows that read a sheet and send a summary.
- Prototyping: pinned data makes it quick to test ideas before connecting live systems.
📝Case scenario
A colleague shares a workflow file with you by email. When you import it, the Google Sheets node shows a warning: the credential is missing. That's expected, because credentials aren't included in exported workflows. You create your own "Sharma Sheets" credential, select it on the node, and the workflow runs. The secret never left your colleague's n8n.
🖱️Try it
Build the four-step workflow above in your n8n. Send a test request to the webhook with a tool such as curl or Postman, pin the data, and add a second sheet column for the phone number using an expression.
⚠️Common mistakes
- Putting keys in node fields or code. Sign: a token is visible in the workflow export. Fix: move it to a credential and rotate the exposed one.
- Referring to the wrong item. Sign: every row gets the first item's value. Fix: check whether the expression reads the current item or a fixed one, using the execution data.
🛠️For your project
All three projects use credentials for the simulator's test tokens. Exporting a workflow and checking no token appears in it is a safety item in every marking guide.
✅Quick check
What is an item in n8n?
Show the answer
One JSON object in the list of data passed between nodes; most nodes run once for each item.
Why keep credentials separate from the workflow?
Show the answer
So secrets stay encrypted in n8n and aren't shared when a workflow is exported or copied.
