This is workflow diagram in n8n
Hello everyone, I studied n8n for four days and then took its certification exam (Part 1), and I passed. I wouldn’t have known otherwise that it’s very easy to get started with and can handle many different types of projects. One example I’ve seen is a workflow for scheduling YouTube video uploads. You can really see how much potential it has! But no matter how complex things get, you should always start simple. Now I’d like to share a simple workflow with everyone.
Step-by-step: Understanding this n8n workflow
This workflow runs on a schedule, fetches order data via an API, checks a condition, then splits into two paths:
- Path A: store/update orders and generate a detailed CSV for processing orders
- Path B: calculate the total blocked orders and display a completion message
1) Schedule Trigger (start automatically)
Node: Schedule Trigger
Purpose: Starts the workflow at a defined interval (for example, every hour or every day).
Setup:
- Choose a schedule type (interval or Cron)
- Set time zone (optional)
2) HTTP Request (fetch orders from an API)
Node: HTTP Request
Purpose: Calls an external endpoint and returns order data (usually JSON).
Setup:
- Method:
GET(common) - URL: your orders endpoint
- Authentication: API key/Bearer token (if required)
- Response format: JSON
Expected output: order items/records to be processed downstream.
3) IF (branch based on a condition)
Node: IF
Purpose: Routes the execution depending on a rule (for example, whether orders exist, or whether status matches a value).
Setup ideas:
- “Do we have any orders?”
- “Is order status = processing?”
- “Is blocked count > 0?”
Result: Two branches: true and false.
Path A — Processing orders → Upsert → CSV export
4) Upsert row(s) (insert or update records)
Node: Upsert row(s)
Purpose: Writes orders into a destination (database/spreadsheet) and updates existing rows based on a unique key.
Setup:
- Select the destination (e.g., DB table / sheet)
- Choose a unique match key (e.g.,
order_id) - Map incoming fields to columns (status, amount, timestamps, etc.)
5) Convert to CSV — Processing Orders
Node: Convert to CSV — Processing Orders
Purpose: Converts the processing-orders dataset into CSV.
Setup:
- Choose included fields/columns
- Enable headers (recommended)
- Ensure only processing orders reach this step (via IF/filter)
Output: CSV content (text/binary depending on node).
6) Detailed Processing Orders CSV (save/send the CSV)
Node: Detailed Processing Orders CSV
Purpose: Final action for the CSV, such as:
- upload to cloud storage (Drive/S3)
- email attachment
- save file for reporting
Tip: Use a timestamped filename, e.g. processing_orders_YYYY-MM-DD.csv.
Path B — Blocked orders → totals → message
7) Total Blocked Orders (aggregate or summarize)
Node: Total Blocked Orders
Purpose: Computes metrics such as:
- number of blocked orders
- total blocked amount
Setup:
- Make sure only blocked orders reach this node
- Use an aggregate/function step to compute totals
Code:
const items = $input.all();
let totalRecord=items.length;
let bookedSum = 0;
for (const item of items) {
const v = Number(item.json.orderPrice ?? 0);
if (!Number.isNaN(v)) bookedSum += v;
}
return [{ json: { totalRecord, bookedSum } }];
8) Show Message for Completed Orders (notify/log)
Node: Show Message for Completed Orders
Purpose: Provides a completion notice (execution log, Slack, email, etc.).
Example message:
- “Workflow completed. Blocked orders: X. Processing orders CSV generated.”
{{ $json.count }} orders are booked
Now, you can click Executive Workflow to check how does it go.
How to verify it in the Execution Window
In the execution view, confirm:
- the HTTP request returns items successfully
- the IF node routes to the correct branch
- the CSV step produces the expected row/column set
- totals and notifications match the data
I am preparing for Part 2 and hope I can pass next week. When the time comes, I will share my exam tips and strategies.
Connect with Me
GitHub: https://github.com/timleunghk
LinkedIn: https://www.linkedin.com/in/timothy-leung-48261b8b



Top comments (0)