{
“nodes”: [
{
“parameters”: {
“url”: “https://internal.users.n8n.cloud/webhook/custom-erp”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpHeaderAuth”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “unique_id”,
“value”: “ec645f31e11a9c3db1efe116da3af155”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
256,
48
],
“id”: “f4c00dd4-828e-458e-8851-ac5554701f1a”,
“name”: “HTTP Request1”,
“credentials”: {
“httpHeaderAuth”: {
“id”: “1Ixp8YIEYOdudcLt”,
“name”: “Header Auth account”
}
}
},
{
“parameters”: {},
“type”: “n8n-nodes-base.manualTrigger”,
“typeVersion”: 1,
“position”: [
48,
48
],
“id”: “ab088b06-4a26-4e95-880c-65c26b8e18cd”,
“name”: “When clicking ‘Execute workflow’”
},
{
“parameters”: {
“operation”: “create”,
“base”: {
“__rl”: true,
“value”: “appizDCIuzc79pNax”,
“mode”: “list”,
“cachedResultName”: “beginner course”,
“cachedResultUrl”: “https://airtable.com/appizDCIuzc79pNax”
},
“table”: {
“__rl”: true,
“value”: “tblFKi5whSyom32o6”,
“mode”: “list”,
“cachedResultName”: “orders”,
“cachedResultUrl”: “https://airtable.com/appizDCIuzc79pNax/tblFKi5whSyom32o6”
},
“columns”: {
“mappingMode”: “autoMapInputData”,
“value”: {},
“matchingColumns”: ,
“schema”: [
{
“id”: “orderID”,
“displayName”: “orderID”,
“required”: false,
“defaultMatch”: false,
“canBeUsedToMatch”: true,
“display”: true,
“type”: “number”,
“readOnly”: false,
“removed”: false
},
{
“id”: “customerID”,
“displayName”: “customerID”,
“required”: false,
“defaultMatch”: false,
“canBeUsedToMatch”: true,
“display”: true,
“type”: “number”,
“readOnly”: false,
“removed”: false
},
{
“id”: “employeeName”,
“displayName”: “employeeName”,
“required”: false,
“defaultMatch”: false,
“canBeUsedToMatch”: true,
“display”: true,
“type”: “string”,
“readOnly”: false,
“removed”: false
},
{
“id”: “orderPrice”,
“displayName”: “orderPrice”,
“required”: false,
“defaultMatch”: false,
“canBeUsedToMatch”: true,
“display”: true,
“type”: “number”,
“readOnly”: false,
“removed”: false
},
{
“id”: “orderStatus”,
“displayName”: “orderStatus”,
“required”: false,
“defaultMatch”: false,
“canBeUsedToMatch”: true,
“display”: true,
“type”: “string”,
“readOnly”: false,
“removed”: false
}
],
“attemptToConvertTypes”: false,
“convertFieldsToString”: false
},
“options”: {}
},
“type”: “n8n-nodes-base.airtable”,
“typeVersion”: 2.1,
“position”: [
976,
-144
],
“id”: “77f62126-2bd2-4a29-a1b4-488015e9b1a4”,
“name”: “Airtable1”,
“credentials”: {
“airtableTokenApi”: {
“id”: “62BcR8EtIdW8b2cO”,
“name”: “Airtable Personal Access Token account”
}
}
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“id”: “d369ed20-d310-46ff-a7f3-f45ee5e6e1be”,
“leftValue”: “={{ $json.orderStatus }}”,
“rightValue”: “processing”,
“operator”: {
“type”: “string”,
“operation”: “equals”
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.3,
“position”: [
416,
-160
],
“id”: “a5e8a416-0e23-4b41-ae16-12c4c02a8c5e”,
“name”: “If”
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “d73aa425-ba8d-4431-84f5-0f1c74e1cd70”,
“name”: “orderID”,
“value”: “={{ $json.orderID }}”,
“type”: “number”
},
{
“id”: “e68eedc6-f6bf-473e-a6e0-4b89f495b7ff”,
“name”: “employeeName”,
“value”: “={{ $json.employeeName }}”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
704,
-176
],
“id”: “e91c2fc6-b321-41cb-b70f-ea05e8075459”,
“name”: “Edit Fields”
},
{
“parameters”: {
“jsCode”: “let items = $input.all();\nlet totalBooked = items.length;\nlet bookedSum = 0;\n\nfor (let i=0; i < items.length; i++) {\n bookedSum = bookedSum + items[i].json.orderPrice;\n}\n\nreturn [{ json: {totalBooked, bookedSum} }];”
},
“type”: “n8n-nodes-base.code”,
“typeVersion”: 2,
“position”: [
752,
96
],
“id”: “eb3f15f6-5948-4de5-9f4b-81ccdecf52d5”,
“name”: “Code1”
},
{
“parameters”: {
“authentication”: “webhook”,
“content”: “=This week we’ve {{$json[“totalBooked”]}} booked orders with a total value of {{$json[“bookedSum”]}}. My Unique ID: {{ $(‘HTTP Request1’).params[“headerParameters”][“parameters”][0][“value”] }}”,
“options”: {}
},
“type”: “n8n-nodes-base.discord”,
“typeVersion”: 2,
“position”: [
992,
80
],
“id”: “b5dff434-024b-47da-9b15-3f4b16fb0ed6”,
“name”: “Discord1”,
“webhookId”: “eff0b651-f0be-4cae-8f18-7d831385be3c”,
“credentials”: {
“discordWebhookApi”: {
“id”: “Kq0WQDxajuzSgW4J”,
“name”: “Discord Webhook account”
}
}
}
],
“connections”: {
“HTTP Request1”: {
“main”: [
[
{
“node”: “If”,
“type”: “main”,
“index”: 0
}
]
]
},
“When clicking ‘Execute workflow’”: {
“main”: [
[
{
“node”: “HTTP Request1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Airtable1”: {
“main”: [
]
},
“If”: {
“main”: [
[
{
“node”: “Edit Fields”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “Code1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit Fields”: {
“main”: [
[
{
“node”: “Airtable1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Code1”: {
“main”: [
[
{
“node”: “Discord1”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “5293250b2226f6e3480001c34b312f6c9091ee6501a78364950b8e54ac7d43f6”
}
}