DA2: n8n in depth

Lesson 2 of 5 · reading 15–25 minutes; practice and project time is on the module page

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 worked example

A first Sharma Textiles workflow, step by step:

  1. Webhook node receives a test order: { "order_id": "ST-1042", "name": "Asha", "phone": "9876543210", "amount": 2400 }.
  2. Pin that data so you can test repeatedly.
  3. 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') }}.
  4. Run the workflow and check the new row.

🌍Where it's used

📝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

🛠️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.

← PreviousCloud or self-hosted
ProLearners Assist