Hi everyone!
I just finished Section 2 of the n8n Foundation course and built my Sales Data Pipeline workflow to put everything into practice!
What it does
- Data Ingestion: Captures incoming sales leads/orders from external sources (e.g., Webhook, Google Sheets, or CRM).
- Transformation & Filtering: Cleans incoming lead data, formats key attributes, and filters out incomplete entries.
- Automated Routing: Routes valid sales leads directly to the appropriate team channels or updates records in real time.
Key Takeaways
- Mastered data transformation using n8n core nodes.
- Learned how to handle logic routing for live data pipelines.
- Understood best practices for structuring clean, maintainable workflows.
Workflow JSON
{
“nodes”: [
{
“parameters”: {},
“id”: “0e84a080-bc04-4530-8f68-1b4dbb1428bd”,
“name”: “TriggerManual”,
“type”: “n8n-nodes-base.manualTrigger”,
“typeVersion”: 1,
“position”: [
0,
0
]
},
{
“parameters”: {
“url”: “https://learn.app.n8n.cloud/webhook/course/n8n101/sales-data”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpHeaderAuth”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “X-Assessment-ID”,
“value”: “72884ff6f18c238d63a3ce92cfc90f14”
}
]
},
“options”: {}
},
“id”: “f6392a25-8197-493a-a2ed-1cee5f300181”,
“name”: “GetSalesData”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.5,
“position”: [
224,
0
],
“credentials”: {
“httpHeaderAuth”: {
“id”: “gm3CtltWCS7Hf9QA”,
“name”: “Header Auth account 2”
}
}
},
{
“parameters”: {
“fieldToSplitOut”: “orders”,
“options”: {}
},
“id”: “b6aecaf9-5db3-4c43-b6bf-33ce410d11c0”,
“name”: “SplitOrders”,
“type”: “n8n-nodes-base.splitOut”,
“typeVersion”: 1.1,
“position”: [
448,
0
]
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “60603433-938d-4960-bfa1-9d2202ab4e02”,
“name”: “order_id”,
“value”: “={{$json.order_id }}”,
“type”: “string”
},
{
“id”: “7e41b597-bee8-448c-9013-49234a3688db”,
“name”: “customer_name”,
“value”: “={{ $json.customer_name }}”,
“type”: “string”
},
{
“id”: “350ac9e7-504e-4c94-b03b-765043c0eccf”,
“name”: “region”,
“value”: “={{ $json.region }}”,
“type”: “string”
},
{
“id”: “eac35d11-a0e8-4360-a77f-d689570831e0”,
“name”: “status”,
“value”: “={{ $json.status }}”,
“type”: “string”
},
{
“id”: “a15165a4-1cfb-4df3-a7c6-731df58ca2fc”,
“name”: “order_total”,
“value”: “={{ $json.quantity * $json.unit_price }}”,
“type”: “number”
}
]
},
“options”: {}
},
“id”: “9cd033f6-1aad-4a44-bc53-ecd584b7c875”,
“name”: “SetOrderTotals”,
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.5,
“position”: [
672,
0
]
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 4
},
“conditions”: [
{
“id”: “46b9e76e-4f4b-49a9-a829-863a78c14640”,
“leftValue”: “={{ $json.status }}”,
“rightValue”: “delivered”,
“operator”: {
“type”: “string”,
“operation”: “equals”,
“name”: “filter.operator.equals”
}
}
],
“combinator”: “and”
},
“options”: {}
},
“id”: “b3b122ce-8046-4dae-a828-ec6d0534c841”,
“name”: “FilterDelivered”,
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.4,
“position”: [
896,
96
]
},
{
“parameters”: {
“fieldsToSummarize”: {
“values”: [
{
“aggregation”: “sum”,
“field”: “order_total”
},
{
“field”: “order_total”
},
{
“aggregation”: “average”,
“field”: “order_total”
}
]
},
“fieldsToSplitBy”: “region”,
“options”: {}
},
“id”: “11a82a1b-ea66-4105-9ff4-07b102c7dba0”,
“name”: “SummarizeByRegion”,
“type”: “n8n-nodes-base.summarize”,
“typeVersion”: 1.1,
“position”: [
1120,
0
]
},
{
“parameters”: {
“keys”: {
“key”: [
{
“currentKey”: “sum_order_total”,
“newKey”: “order_totals”
},
{
“currentKey”: “count_order_total”,
“newKey”: “order_count”
}
]
},
“additionalOptions”: {}
},
“id”: “f3736fd4-47cb-4a97-860a-235ae6be8c55”,
“name”: “UpdateFieldNames”,
“type”: “n8n-nodes-base.renameKeys”,
“typeVersion”: 1,
“position”: [
1344,
0
]
},
{
“parameters”: {
“aggregate”: “aggregateAllItemData”,
“destinationFieldName”: “regions”,
“options”: {}
},
“id”: “d82faccf-2439-41d2-a2cc-65438410218a”,
“name”: “AggregateRegion”,
“type”: “n8n-nodes-base.aggregate”,
“typeVersion”: 1,
“position”: [
1568,
-96
]
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://learn.app.n8n.cloud/webhook/course/n8n101/validate-analysis”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpHeaderAuth”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “X-Assessment-ID”,
“value”: “72884ff6f18c238d63a3ce92cfc90f14”
}
]
},
“sendBody”: true,
“bodyParameters”: {
“parameters”: [
{
“name”: “regions”,
“value”: “={{ $json.regions }}”
}
]
},
“options”: {}
},
“id”: “507b2331-c3eb-406a-b827-8ef34f1ffac9”,
“name”: “SendAnalysis”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.5,
“position”: [
1792,
-96
],
“credentials”: {
“httpHeaderAuth”: {
“id”: “gm3CtltWCS7Hf9QA”,
“name”: “Header Auth account 2”
}
}
},
{
“parameters”: {
“aggregate”: “aggregateAllItemData”,
“destinationFieldName”: “orders”,
“options”: {}
},
“id”: “7f1fb032-fdd7-4fd4-be37-5d8f3040916f”,
“name”: “AggregateOrders”,
“type”: “n8n-nodes-base.aggregate”,
“typeVersion”: 1,
“position”: [
896,
-192
]
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://learn.app.n8n.cloud/webhook/course/n8n101/process-orders”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpHeaderAuth”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “X-Assessment-ID”,
“value”: “72884ff6f18c238d63a3ce92cfc90f14”
}
]
},
“sendBody”: true,
“bodyParameters”: {
“parameters”: [
{
“name”: “orders”,
“value”: “={{ $json.orders }}”
}
]
},
“options”: {}
},
“id”: “74fce350-c6c0-4404-8bb3-575f42617d39”,
“name”: “SendOrders”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.5,
“position”: [
1120,
-192
],
“credentials”: {
“httpHeaderAuth”: {
“id”: “gm3CtltWCS7Hf9QA”,
“name”: “Header Auth account 2”
}
}
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “174cca09-f6b7-463a-9203-4cadb4ea011f”,
“name”: “report_generated”,
“value”: “={{ $now.format(‘yyyy-MM-dd HH:mm:ss’) }}”,
“type”: “string”
},
{
“id”: “dff3548e-ef30-49ef-afa7-1cf7dc67f294”,
“name”: “assessment_id”,
“value”: “72884ff6f18c238d63a3ce92cfc90f14”,
“type”: “string”
}
]
},
“includeOtherFields”: true,
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.5,
“position”: [
1568,
96
],
“id”: “f2d7aadb-1417-41c0-96b4-1ca9c3c096db”,
“name”: “SetReportMetadata”
},
{
“parameters”: {
“binaryPropertyName”: “report”,
“options”: {}
},
“type”: “n8n-nodes-base.convertToFile”,
“typeVersion”: 1.2,
“position”: [
1792,
96
],
“id”: “6787dbdf-501c-42de-9585-8591d1ef4ea3”,
“name”: “ConvertToCSV”
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://learn.app.n8n.cloud/webhook/course/n8n101/send-report”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpHeaderAuth”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “X-Assessment-ID”,
“value”: “72884ff6f18c238d63a3ce92cfc90f14”
}
]
},
“sendBody”: true,
“contentType”: “binaryData”,
“inputDataFieldName”: “report”,
“options”: {}
},
“id”: “5edd4649-a760-47d4-b7da-72ebc9a48e47”,
“name”: “SendReport”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.5,
“position”: [
2016,
96
],
“credentials”: {
“httpHeaderAuth”: {
“id”: “gm3CtltWCS7Hf9QA”,
“name”: “Header Auth account 2”
}
}
},
{
“parameters”: {},
“type”: “n8n-nodes-base.noOp”,
“typeVersion”: 1,
“position”: [
1120,
192
],
“id”: “4a425553-b2d0-43ff-b932-f20d9d3d8b08”,
“name”: “IgnoreNonDelivered”
},
{
“parameters”: {
“content”: “Pending and cancelled orders are intentionally excluded from the sales report. Only completed/delivered orders are processed for reporting and aggregation.”
},
“type”: “n8n-nodes-base.stickyNote”,
“typeVersion”: 1,
“position”: [
1104,
304
],
“id”: “8b1147ba-803c-4ffc-8b77-b06eb800cf73”,
“name”: “Sticky Note”
},
{
“parameters”: {
“content”: “Academy Section 2 – Sales Data Pipeline\n\nCreated by: Mujtaba Majid Baig\nDate: November 3, 2026\n\nPurpose:\nThis workflow retrieves sales orders, transforms and calculates order totals, filters completed orders, aggregates sales by region, and generates a CSV report.\n\nMain workflow capabilities:\n- API data retrieval and authentication\n- Order transformation and calculations\n- Filtering completed orders\n- Regional sales aggregation\n- Report generation in CSV format\n- HTTP report submission\n\nCourse: n8n Foundations – Section 2\n\nFuture improvements:\n- Add Slack notifications.\n- Email CSV reports to management.\n- Add alerts for unusual regional sales performance.”,
“height”: 464,
“width”: 400,
“color”: 6
},
“type”: “n8n-nodes-base.stickyNote”,
“typeVersion”: 1,
“position”: [
-448,
-320
],
“id”: “5259f1d9-1eb7-4b0f-b9ce-0855f84d212b”,
“name”: “Sticky Note1”
}
],
“connections”: {
“TriggerManual”: {
“main”: [
[
{
“node”: “GetSalesData”,
“type”: “main”,
“index”: 0
}
]
]
},
“GetSalesData”: {
“main”: [
[
{
“node”: “SplitOrders”,
“type”: “main”,
“index”: 0
}
]
]
},
“SplitOrders”: {
“main”: [
[
{
“node”: “SetOrderTotals”,
“type”: “main”,
“index”: 0
}
]
]
},
“SetOrderTotals”: {
“main”: [
[
{
“node”: “FilterDelivered”,
“type”: “main”,
“index”: 0
},
{
“node”: “AggregateOrders”,
“type”: “main”,
“index”: 0
}
]
]
},
“FilterDelivered”: {
“main”: [
[
{
“node”: “SummarizeByRegion”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “IgnoreNonDelivered”,
“type”: “main”,
“index”: 0
}
]
]
},
“SummarizeByRegion”: {
“main”: [
[
{
“node”: “UpdateFieldNames”,
“type”: “main”,
“index”: 0
}
]
]
},
“UpdateFieldNames”: {
“main”: [
[
{
“node”: “AggregateRegion”,
“type”: “main”,
“index”: 0
},
{
“node”: “SetReportMetadata”,
“type”: “main”,
“index”: 0
}
]
]
},
“AggregateRegion”: {
“main”: [
[
{
“node”: “SendAnalysis”,
“type”: “main”,
“index”: 0
}
]
]
},
“AggregateOrders”: {
“main”: [
[
{
“node”: “SendOrders”,
“type”: “main”,
“index”: 0
}
]
]
},
“SetReportMetadata”: {
“main”: [
[
{
“node”: “ConvertToCSV”,
“type”: “main”,
“index”: 0
}
]
]
},
“ConvertToCSV”: {
“main”: [
[
{
“node”: “SendReport”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “90f5e8d19b6a65bf0175bda9abd265288d2dbb0790f5653dc9440e0ce69cfb7a”
}
}