Compare commits

..

No commits in common. "beb8292c96e76ff897be7cd10c9798c75ea05efb" and "406975d0bea03610bfd40a7679bc52ed23f11648" have entirely different histories.

5 changed files with 224 additions and 635 deletions

View File

@ -157,8 +157,8 @@
] ]
} }
}, },
"createdAt": "2023-08-25T09:49:59.525Z", "createdAt": "2023-01-17T13:26:26.485Z",
"id": "5", "id": "1",
"name": "MT - Aufträge", "name": "MT - Aufträge",
"nodes": [ "nodes": [
{ {
@ -167,13 +167,13 @@
"operation": "list", "operation": "list",
"path": "/out" "path": "/out"
}, },
"id": "ba2e889a-bb18-4892-8d24-5a55c2fbd6c7", "id": "77792d6c-723a-4021-a25b-866c87195fea",
"name": "FTP", "name": "FTP",
"type": "n8n-nodes-base.ftp", "type": "n8n-nodes-base.ftp",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-600, 660,
400 460
], ],
"credentials": { "credentials": {
"sftp": { "sftp": {
@ -198,10 +198,10 @@
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
1140, 2400,
440 500
], ],
"id": "00be2cc0-8c39-48ab-90d8-ca331c38d08e", "id": "c81d1331-8653-4693-ada1-6697dc9ee038",
"credentials": { "credentials": {
"httpBasicAuth": { "httpBasicAuth": {
"id": "2", "id": "2",
@ -218,13 +218,13 @@
"headerRow": true "headerRow": true
} }
}, },
"id": "2c9c4207-9f54-4241-968e-bfb40b773746", "id": "8ad49263-f0f0-4be8-84e3-7cee543e356b",
"name": "Rückmeldung CSV erzeugen", "name": "Rückmeldung CSV erzeugen",
"type": "n8n-nodes-base.spreadsheetFile", "type": "n8n-nodes-base.spreadsheetFile",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-360, 900,
680 740
] ]
}, },
{ {
@ -234,13 +234,13 @@
"headerRow": true "headerRow": true
} }
}, },
"id": "44087b14-bb6a-40c6-8774-960d8146f57c", "id": "5de70737-ab1b-48e7-8fd7-3a722fbc00a9",
"name": "Auftragsdaten CSV einlesen", "name": "Auftragsdaten CSV einlesen",
"type": "n8n-nodes-base.spreadsheetFile", "type": "n8n-nodes-base.spreadsheetFile",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
180, 1440,
420 480
] ]
}, },
{ {
@ -255,13 +255,13 @@
] ]
} }
}, },
"id": "8e5876bb-5c18-4e23-a9cc-b1de8dca44cd", "id": "d54af494-70dc-46ac-ad19-91c90fa53f69",
"name": "PDF", "name": "PDF",
"type": "n8n-nodes-base.if", "type": "n8n-nodes-base.if",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-140, 1120,
400 460
] ]
}, },
{ {
@ -269,13 +269,13 @@
"protocol": "sftp", "protocol": "sftp",
"path": "=/out/{{$json[\"name\"]}}" "path": "=/out/{{$json[\"name\"]}}"
}, },
"id": "483244e0-0e2b-4ddf-b9b4-e281553b44e4", "id": "ee40a4c2-d570-4a61-8373-e4e4c46536fd",
"name": "FTP1", "name": "FTP1",
"type": "n8n-nodes-base.ftp", "type": "n8n-nodes-base.ftp",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-360, 900,
400 460
], ],
"credentials": { "credentials": {
"sftp": { "sftp": {
@ -292,13 +292,13 @@
"newPath": "=/archiv/{{$node[\"PDF\"].binary.data.fileName}}", "newPath": "=/archiv/{{$node[\"PDF\"].binary.data.fileName}}",
"options": {} "options": {}
}, },
"id": "773eb234-4f45-4ce5-bb54-aa5bb92edd22", "id": "8e265faa-72f6-4d78-92f2-d946aa866f2f",
"name": "Ins Archiv verschieben", "name": "Ins Archiv verschieben",
"type": "n8n-nodes-base.ftp", "type": "n8n-nodes-base.ftp",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
1340, 2600,
440 500
], ],
"credentials": { "credentials": {
"sftp": { "sftp": {
@ -313,13 +313,13 @@
"operation": "upload", "operation": "upload",
"path": "=/in/{{$binary.data.fileName}}" "path": "=/in/{{$binary.data.fileName}}"
}, },
"id": "acb8aa11-0841-4f51-9a4f-cfed549b018c", "id": "cd13302a-3bcf-4fdf-88a5-1ef5a40a725f",
"name": "FTP2", "name": "FTP2",
"type": "n8n-nodes-base.ftp", "type": "n8n-nodes-base.ftp",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-120, 1140,
680 740
], ],
"credentials": { "credentials": {
"sftp": { "sftp": {
@ -332,13 +332,13 @@
"parameters": { "parameters": {
"jsCode": "let lines = [];\n\nfor (const item of $input.all()) {\n let parcel_type;\n switch(item.json.query.id) {\n case \"Eurocourier\":\n parcel_type = \"EC_STD_NATIONAL\";\n break;\n case \"GLS\":\n parcel_type = \"GLS_STD_NATIONAL\";\n break;\n default:\n parcel_type = \"DPD_STD_NATIONAL\";\n}\n let line = {\n \"TB_ORDER_ID\": item.json.query.id,\n \"ORDER_PAID\" : 0,\n \"TYPE\" : item.json.query.type,\n \"PARCEL_TYPE\": parcel_type,\n \"SHIP_CODE\" : item.json.query.shipment,\n \"COMMENT_INTERN\" : \"\",\n \"COMMENT\" : \"\",\n }; \n lines.push(line);\n}\n\nreturn lines;" "jsCode": "let lines = [];\n\nfor (const item of $input.all()) {\n let parcel_type;\n switch(item.json.query.id) {\n case \"Eurocourier\":\n parcel_type = \"EC_STD_NATIONAL\";\n break;\n case \"GLS\":\n parcel_type = \"GLS_STD_NATIONAL\";\n break;\n default:\n parcel_type = \"DPD_STD_NATIONAL\";\n}\n let line = {\n \"TB_ORDER_ID\": item.json.query.id,\n \"ORDER_PAID\" : 0,\n \"TYPE\" : item.json.query.type,\n \"PARCEL_TYPE\": parcel_type,\n \"SHIP_CODE\" : item.json.query.shipment,\n \"COMMENT_INTERN\" : \"\",\n \"COMMENT\" : \"\",\n }; \n lines.push(line);\n}\n\nreturn lines;"
}, },
"id": "8cad55fd-7cf8-4264-b733-8c0887009c89", "id": "3f76d0dd-3525-4cdb-baab-e2205621ec39",
"name": "In Ausgabeformat umwandeln", "name": "In Ausgabeformat umwandeln",
"type": "n8n-nodes-base.code", "type": "n8n-nodes-base.code",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-600, 660,
680 740
] ]
}, },
{ {
@ -346,13 +346,13 @@
"path": "1730d70c-f532-4b6f-a20e-e2fc7edb2d45", "path": "1730d70c-f532-4b6f-a20e-e2fc7edb2d45",
"options": {} "options": {}
}, },
"id": "5661688b-d65b-4703-a422-67387bfd37c3", "id": "5a16780d-19a1-4967-8710-9225ddc59ddf",
"name": "Webhook für Billbee", "name": "Webhook für Billbee",
"type": "n8n-nodes-base.webhook", "type": "n8n-nodes-base.webhook",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-840, 420,
680 740
], ],
"webhookId": "1730d70c-f532-4b6f-a20e-e2fc7edb2d45" "webhookId": "1730d70c-f532-4b6f-a20e-e2fc7edb2d45"
}, },
@ -366,13 +366,13 @@
] ]
} }
}, },
"id": "37ae4d6d-fc48-475f-9ed2-8837774daab1", "id": "47aa99b1-e403-47c1-a8d9-f6d10c2ec553",
"name": "Schedule Trigger", "name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger", "type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-840, 420,
400 460
] ]
}, },
{ {
@ -512,13 +512,13 @@
"dotNotation": true "dotNotation": true
} }
}, },
"id": "2b43b12b-ab1e-4f74-b859-15969e180160", "id": "50b02a14-bac8-4748-be52-d2e789633254",
"name": "In Billbee Format umwandeln", "name": "In Billbee Format umwandeln",
"type": "n8n-nodes-base.set", "type": "n8n-nodes-base.set",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
460, 1720,
420 480
] ]
}, },
{ {
@ -529,13 +529,13 @@
"newPath": "=/archiv/{{$json[\"name\"]}}", "newPath": "=/archiv/{{$json[\"name\"]}}",
"options": {} "options": {}
}, },
"id": "1c973d28-8bbe-4cb8-9af3-3153107afac0", "id": "e3fe469c-7ee9-4435-8cff-7ad964fe3b02",
"name": "Ins Archiv verschieben1", "name": "Ins Archiv verschieben1",
"type": "n8n-nodes-base.ftp", "type": "n8n-nodes-base.ftp",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
460, 1720,
160 220
], ],
"credentials": { "credentials": {
"sftp": { "sftp": {
@ -553,13 +553,13 @@
], ],
"options": {} "options": {}
}, },
"id": "6aadcdef-1bee-4584-85b3-1bc4e56900a8", "id": "101e2897-0ec5-4401-90d4-1ee5e4b96e14",
"name": "Dokumente hochladen", "name": "Dokumente hochladen",
"type": "n8n-nodes-base.googleDrive", "type": "n8n-nodes-base.googleDrive",
"typeVersion": 2, "typeVersion": 2,
"position": [ "position": [
180, 1440,
160 220
], ],
"credentials": { "credentials": {
"googleDriveOAuth2Api": { "googleDriveOAuth2Api": {
@ -572,32 +572,36 @@
"parameters": { "parameters": {
"command": "echo \"$BILBEE_API_KEY\"" "command": "echo \"$BILBEE_API_KEY\""
}, },
"id": "f05bbf61-9fdf-4a34-b7cc-8abcfd70c346", "id": "105c3214-b5e7-43b3-b3f1-95a4de48bdd6",
"name": "Api-Key", "name": "Api-Key",
"type": "n8n-nodes-base.executeCommand", "type": "n8n-nodes-base.executeCommand",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
700, 1960,
580 640
] ]
}, },
{ {
"parameters": {}, "parameters": {},
"id": "7d776c8e-801b-461e-8576-03c45fb60d4c", "id": "612b2d47-ff4e-495f-9857-6df986e8b45b",
"name": "Merge", "name": "Merge",
"type": "n8n-nodes-base.merge", "type": "n8n-nodes-base.merge",
"typeVersion": 2, "typeVersion": 2,
"position": [ "position": [
900, 2160,
440 500
] ]
} }
], ],
"pinData": {}, "pinData": {},
"settings": {}, "settings": {},
"staticData": null, "staticData": {
"node:Schedule Trigger": {
"recurrencyRules": []
}
},
"tags": [], "tags": [],
"triggerCount": 0, "triggerCount": 2,
"updatedAt": "2023-08-25T09:49:59.525Z", "updatedAt": "2023-06-13T07:13:38.000Z",
"versionId": "c4fed224-596d-4265-ad0d-3f68e9b3656c" "versionId": "565027a2-4087-4d05-88db-23b521331d38"
} }

View File

@ -85,6 +85,17 @@
] ]
] ]
}, },
"AWS Textract": {
"main": [
[
{
"node": "Code1",
"type": "main",
"index": 0
}
]
]
},
"Merge": { "Merge": {
"main": [ "main": [
[ [
@ -124,8 +135,8 @@
] ]
} }
}, },
"createdAt": "2023-08-25T09:10:33.270Z", "createdAt": "2023-03-27T11:07:01.918Z",
"id": "1", "id": "7",
"name": "Rechnungen -> DATEV", "name": "Rechnungen -> DATEV",
"nodes": [ "nodes": [
{ {
@ -143,17 +154,17 @@
] ]
} }
}, },
"id": "08aeeb55-7ea6-4e23-a9c4-2838a5249f2d", "id": "b4421482-9533-4a70-a010-bc37198173de",
"name": "Gmail Trigger", "name": "Gmail Trigger",
"type": "n8n-nodes-base.gmailTrigger", "type": "n8n-nodes-base.gmailTrigger",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-860, 280,
740 -200
], ],
"credentials": { "credentials": {
"gmailOAuth2": { "gmailOAuth2": {
"id": "1", "id": "16",
"name": "Gmail - buchhaltung@lanakk.com" "name": "Gmail - buchhaltung@lanakk.com"
} }
} }
@ -168,17 +179,17 @@
"downloadAttachments": true "downloadAttachments": true
} }
}, },
"id": "a194d44b-9610-4e7d-b8db-a4a09d2b8a30", "id": "92850b56-b38e-49a1-8fd7-253b022a3fa2",
"name": "Gmail", "name": "Gmail",
"type": "n8n-nodes-base.gmail", "type": "n8n-nodes-base.gmail",
"typeVersion": 2, "typeVersion": 2,
"position": [ "position": [
-640, 500,
740 -200
], ],
"credentials": { "credentials": {
"gmailOAuth2": { "gmailOAuth2": {
"id": "1", "id": "16",
"name": "Gmail - buchhaltung@lanakk.com" "name": "Gmail - buchhaltung@lanakk.com"
} }
} }
@ -200,13 +211,13 @@
] ]
} }
}, },
"id": "554ad5d4-6891-47ec-a5a5-79cc01bedbcb", "id": "d7bbeaa9-8961-4f71-a21c-11009aad9712",
"name": "IF", "name": "IF",
"type": "n8n-nodes-base.if", "type": "n8n-nodes-base.if",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-420, 720,
740 -200
] ]
}, },
{ {
@ -224,17 +235,17 @@
} }
} }
}, },
"id": "05a0a406-d2b2-4043-accb-25d611f415c6", "id": "92b1ec51-291e-43bb-9f62-96ab3acb1f6c",
"name": "An Datev weiterleiten", "name": "An Datev weiterleiten",
"type": "n8n-nodes-base.gmail", "type": "n8n-nodes-base.gmail",
"typeVersion": 2, "typeVersion": 2,
"position": [ "position": [
640, 1780,
840 -100
], ],
"credentials": { "credentials": {
"gmailOAuth2": { "gmailOAuth2": {
"id": "1", "id": "16",
"name": "Gmail - buchhaltung@lanakk.com" "name": "Gmail - buchhaltung@lanakk.com"
} }
} }
@ -247,43 +258,43 @@
"Label_5013070903895930344" "Label_5013070903895930344"
] ]
}, },
"id": "e4ca31e0-3ffe-4d2e-8250-2145e7dda8a6", "id": "94d4e183-8b86-48ea-9a7d-c620ce431b5e",
"name": "Datev Label anhängen", "name": "Datev Label anhängen",
"type": "n8n-nodes-base.gmail", "type": "n8n-nodes-base.gmail",
"typeVersion": 2, "typeVersion": 2,
"position": [ "position": [
840, 1980,
840 -100
], ],
"credentials": { "credentials": {
"gmailOAuth2": { "gmailOAuth2": {
"id": "1", "id": "16",
"name": "Gmail - buchhaltung@lanakk.com" "name": "Gmail - buchhaltung@lanakk.com"
} }
} }
}, },
{ {
"parameters": {}, "parameters": {},
"id": "0b60c6c7-bbe1-45be-8674-266fde0d9ea6", "id": "a38e57c7-1953-45bd-87cc-c4bd9aaf4e57",
"name": "NoOp", "name": "NoOp",
"type": "n8n-nodes-base.noOp", "type": "n8n-nodes-base.noOp",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-140, 1000,
840 -100
] ]
}, },
{ {
"parameters": { "parameters": {
"jsCode": "\nitems = [];\n\nfor (const item of $input.all()) {\n for (let i = 0; i < Object.keys(item.binary).length; i++) {\n let newItem = {\n \"json\": {},\n \"binary\": {}\n };\n if (item.binary[\"attachment_\" +i].fileExtension != \"pdf\"){\n continue;\n }\n newItem.json = item.json;\n newItem.binary.attachment_0 = item.binary[\"attachment_\" +i];\n items.push(newItem);\n }\n}\n\nreturn items;" "jsCode": "\nitems = [];\n\nfor (const item of $input.all()) {\n for (let i = 0; i < Object.keys(item.binary).length; i++) {\n let newItem = {\n \"json\": {},\n \"binary\": {}\n };\n if (item.binary[\"attachment_\" +i].fileExtension != \"pdf\"){\n continue;\n }\n newItem.json = item.json;\n newItem.binary.attachment_0 = item.binary[\"attachment_\" +i];\n items.push(newItem);\n }\n}\n\nreturn items;"
}, },
"id": "1772cb30-9bb7-48b3-b990-e9fa05e82a64", "id": "9265ff9e-648b-4c83-90be-ae9cf3d96d9b",
"name": "Code", "name": "Code",
"type": "n8n-nodes-base.code", "type": "n8n-nodes-base.code",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-140, 1000,
640 -300
] ]
}, },
{ {
@ -294,13 +305,13 @@
"keepSource": true "keepSource": true
} }
}, },
"id": "646f92c1-2af7-46fe-9b3f-51bb17ba303f", "id": "d403f312-afc3-4b99-9344-38764a94d3b1",
"name": "Binärdaten zu JSON", "name": "Binärdaten zu JSON",
"type": "n8n-nodes-base.moveBinaryData", "type": "n8n-nodes-base.moveBinaryData",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
80, 1220,
640 -300
] ]
}, },
{ {
@ -308,13 +319,13 @@
"value": "={{$json.data}}", "value": "={{$json.data}}",
"dataPropertyName": "hash" "dataPropertyName": "hash"
}, },
"id": "cf623347-4b7e-4d61-a877-ee7aab89c28f", "id": "a743c51c-d13b-4c7b-a6c6-7dfbc60c0904",
"name": "Hash erzeugen", "name": "Hash erzeugen",
"type": "n8n-nodes-base.crypto", "type": "n8n-nodes-base.crypto",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
300, 1440,
640 -300
] ]
}, },
{ {
@ -345,60 +356,80 @@
] ]
} }
}, },
"id": "706ea9d9-acdc-4670-a47c-f32cec6d0a60", "id": "6b746f53-17e9-49eb-804b-e5e2a8091589",
"name": "Dateien ablegen", "name": "Dateien ablegen",
"type": "n8n-nodes-base.s3", "type": "n8n-nodes-base.s3",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
1580, 2720,
620 -320
], ],
"credentials": { "credentials": {
"s3": { "s3": {
"id": "2", "id": "17",
"name": "S3 account" "name": "S3 account"
} }
} }
}, },
{
"parameters": {
"binaryPropertyName": "attachment_0"
},
"id": "46f3136d-a228-4ce5-9725-88882e967a4c",
"name": "AWS Textract",
"type": "n8n-nodes-base.awsTextract",
"typeVersion": 1,
"position": [
1780,
-520
],
"credentials": {
"aws": {
"id": "15",
"name": "AWS account"
}
},
"continueOnFail": true
},
{ {
"parameters": { "parameters": {
"mode": "combine", "mode": "combine",
"combinationMode": "mergeByPosition", "combinationMode": "mergeByPosition",
"options": {} "options": {}
}, },
"id": "563526af-cb42-4857-b593-64ff7558515d", "id": "ed97437a-6dca-42ca-86b3-de5ac52b5892",
"name": "Merge", "name": "Merge",
"type": "n8n-nodes-base.merge", "type": "n8n-nodes-base.merge",
"typeVersion": 2, "typeVersion": 2,
"position": [ "position": [
1160, 2300,
620 -320
] ]
}, },
{ {
"parameters": { "parameters": {
"jsCode": "function getMonthAndYear(dateString) {\n const dateArray = dateString.split('.');\n const monthAbbreviations = ['JAN', 'FEB', 'MAR', 'APR', 'MAI', 'JUN', 'JUL', 'AUG', 'SEP', 'OKT', 'NOV', 'DEZ'];\n const monthIndex = parseInt(dateArray[1]) - 1;\n const month = monthAbbreviations[monthIndex];\n let year = dateArray[2];\n \n if (year.length === 2) {\n year = '20' + year;\n }\n\n return { month: month, year: year };\n}\n\nfor (const item of $input.all()) {\n let period = getMonthAndYear(item.json.INVOICE_RECEIPT_DATE);\n item.json.month = period.month;\n item.json.year = period.year;\n\n if (!item.json.INVOICE_RECEIPT_ID) {\n item.json.INVOICE_RECEIPT_ID = \"UNBEKANNT\";\n item.json.docType = \"UNBEKANNT\";\n continue;\n }\n\n if (!item.json.TAX) {\n item.json.TAX = 0; \n }\n \n item.json.docType = \"RECHNUNG\";\n}\n\nreturn $input.all();" "jsCode": "function getMonthAndYear(dateString) {\n const dateArray = dateString.split('.');\n const monthAbbreviations = ['JAN', 'FEB', 'MAR', 'APR', 'MAI', 'JUN', 'JUL', 'AUG', 'SEP', 'OKT', 'NOV', 'DEZ'];\n const monthIndex = parseInt(dateArray[1]) - 1;\n const month = monthAbbreviations[monthIndex];\n let year = dateArray[2];\n \n if (year.length === 2) {\n year = '20' + year;\n }\n\n return { month: month, year: year };\n}\n\nfor (const item of $input.all()) {\n let period = getMonthAndYear(item.json.INVOICE_RECEIPT_DATE);\n item.json.month = period.month;\n item.json.year = period.year;\n\n if (!item.json.INVOICE_RECEIPT_ID) {\n item.json.INVOICE_RECEIPT_ID = \"UNBEKANNT\";\n item.json.docType = \"UNBEKANNT\";\n continue;\n }\n\n if (!item.json.TAX) {\n item.json.TAX = 0; \n }\n \n item.json.docType = \"RECHNUNG\";\n}\n\nreturn $input.all();"
}, },
"id": "74ec1239-4f1a-4d2c-a724-0dd229d85168", "id": "a62d461f-f487-4caf-aa38-8a1f2914c412",
"name": "Code1", "name": "Code1",
"type": "n8n-nodes-base.code", "type": "n8n-nodes-base.code",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
820, 1960,
420 -520
] ]
}, },
{ {
"parameters": { "parameters": {
"jsCode": "const monthId = {\n 'JAN': 3852,\n 'FEB': 3853,\n 'MAR': 3854,\n 'APR': 3855,\n 'MAI': 3856,\n 'JUN': 3857,\n 'JUL': 3858,\n 'AUG': 3859,\n 'SEP': 3860,\n 'OKT': 3861,\n 'NOV': 3862,\n 'DEZ': 3863\n};\n\nconst yearId = {\n '2015': 3864,\n '2016': 3865,\n '2017': 3866,\n '2018': 3867,\n '2019': 3868,\n '2020': 3869,\n '2021': 3870,\n '2022': 3871,\n '2023': 3872,\n '2024': 3873\n};\nfor (const item of $input.all()) {\n item.json.month = monthId[item.json.month];\n item.json.year = yearId[item.json.year];\n item.json.SUBTOTAL = item.json.SUBTOTAL.replace(',','.');\n item.json.TAX = item.json.TAX.replace(',','.');\n dateParts = item.json.INVOICE_RECEIPT_DATE.split('.');\n item.json.INVOICE_RECEIPT_DATE = `${dateParts[2]}-${dateParts[1].padStart(2, '0')}-${dateParts[0].padStart(2, '0')}`;\n}\n\nreturn $input.all();" "jsCode": "const monthId = {\n 'JAN': 3852,\n 'FEB': 3853,\n 'MAR': 3854,\n 'APR': 3855,\n 'MAI': 3856,\n 'JUN': 3857,\n 'JUL': 3858,\n 'AUG': 3859,\n 'SEP': 3860,\n 'OKT': 3861,\n 'NOV': 3862,\n 'DEZ': 3863\n};\n\nconst yearId = {\n '2015': 3864,\n '2016': 3865,\n '2017': 3866,\n '2018': 3867,\n '2019': 3868,\n '2020': 3869,\n '2021': 3870,\n '2022': 3871,\n '2023': 3872,\n '2024': 3873\n};\nfor (const item of $input.all()) {\n item.json.month = monthId[item.json.month];\n item.json.year = yearId[item.json.year];\n item.json.SUBTOTAL = item.json.SUBTOTAL.replace(',','.');\n item.json.TAX = item.json.TAX.replace(',','.');\n dateParts = item.json.INVOICE_RECEIPT_DATE.split('.');\n item.json.INVOICE_RECEIPT_DATE = `${dateParts[2]}-${dateParts[1].padStart(2, '0')}-${dateParts[0].padStart(2, '0')}`;\n}\n\nreturn $input.all();"
}, },
"id": "cad2d889-f42a-4a45-a662-360aeedd1526", "id": "17ebb256-c137-4fed-8dbc-4c3163b09dd7",
"name": "Code2", "name": "Code2",
"type": "n8n-nodes-base.code", "type": "n8n-nodes-base.code",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
1380, 2520,
420 -520
], ],
"continueOnFail": true "continueOnFail": true
}, },
@ -452,13 +483,13 @@
}, },
"options": {} "options": {}
}, },
"id": "7b86214e-4545-43eb-a49d-b5e9fb595f41", "id": "cd342347-419f-462f-b93f-6eaea901be99",
"name": "HTTP Request", "name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 3, "typeVersion": 3,
"position": [ "position": [
1580, 2720,
420 -520
], ],
"credentials": { "credentials": {
"httpHeaderAuth": { "httpHeaderAuth": {
@ -472,12 +503,14 @@
"settings": {}, "settings": {},
"staticData": { "staticData": {
"node:Gmail Trigger": { "node:Gmail Trigger": {
"possibleDuplicates": [], "lastTimeChecked": 1692776896,
"lastTimeChecked": 1692955266 "possibleDuplicates": [
"18a215d9b70829e8"
]
} }
}, },
"tags": [], "tags": [],
"triggerCount": 1, "triggerCount": 1,
"updatedAt": "2023-08-25T09:21:06.000Z", "updatedAt": "2023-08-23T07:49:13.000Z",
"versionId": "d5336b9a-260a-4f88-862e-edbbb760acb2" "versionId": "a491b066-7560-4adf-8a1b-66848a1c51de"
} }

View File

@ -169,8 +169,8 @@
] ]
} }
}, },
"createdAt": "2023-08-25T09:30:15.825Z", "createdAt": "2023-04-30T12:45:41.935Z",
"id": "4", "id": "11",
"name": "Shopify <--> Mautic", "name": "Shopify <--> Mautic",
"nodes": [ "nodes": [
{ {
@ -182,18 +182,18 @@
"search": "={{ $json.email }}" "search": "={{ $json.email }}"
} }
}, },
"id": "2ab62e7d-70aa-444e-a4a3-d5b6f4db23e4", "id": "34c7436f-21b8-400a-b754-baacf1f38ec9",
"name": "Email suchen", "name": "Email suchen",
"type": "n8n-nodes-base.mautic", "type": "n8n-nodes-base.mautic",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-360, 240,
300 0
], ],
"alwaysOutputData": true, "alwaysOutputData": true,
"credentials": { "credentials": {
"mauticOAuth2Api": { "mauticOAuth2Api": {
"id": "6", "id": "20",
"name": "Mautic account" "name": "Mautic account"
} }
} }
@ -206,17 +206,17 @@
"contactId": "={{ $json.id }}", "contactId": "={{ $json.id }}",
"segmentId": 1 "segmentId": 1
}, },
"id": "830fd450-d149-47b1-afd0-5999ecdcdf54", "id": "0b888d2a-3790-4182-bf62-73d99a1614a6",
"name": "Aus Segment entfernen", "name": "Aus Segment entfernen",
"type": "n8n-nodes-base.mautic", "type": "n8n-nodes-base.mautic",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
780, 1380,
400 100
], ],
"credentials": { "credentials": {
"mauticOAuth2Api": { "mauticOAuth2Api": {
"id": "6", "id": "20",
"name": "Mautic account" "name": "Mautic account"
} }
} }
@ -228,17 +228,17 @@
"contactId": "={{ $json.id }}", "contactId": "={{ $json.id }}",
"segmentId": 1 "segmentId": 1
}, },
"id": "a1f319db-2e89-42d7-a018-a5f008e918dc", "id": "4db83f86-9ec7-41fa-8faf-7886eb539195",
"name": "Segment hinzufügen", "name": "Segment hinzufügen",
"type": "n8n-nodes-base.mautic", "type": "n8n-nodes-base.mautic",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
780, 1380,
160 -140
], ],
"credentials": { "credentials": {
"mauticOAuth2Api": { "mauticOAuth2Api": {
"id": "6", "id": "20",
"name": "Mautic account" "name": "Mautic account"
} }
} }
@ -251,13 +251,13 @@
"rawBody": true "rawBody": true
} }
}, },
"id": "98653876-b909-4416-a8ee-aa5857078b48", "id": "4a01eed5-9378-47f3-98ab-e00848ba0093",
"name": "Webhook1", "name": "Webhook1",
"type": "n8n-nodes-base.webhook", "type": "n8n-nodes-base.webhook",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-560, 40,
1140 840
], ],
"webhookId": "c83eb6ce-40dd-418c-952a-ed62a051a00b" "webhookId": "c83eb6ce-40dd-418c-952a-ed62a051a00b"
}, },
@ -267,17 +267,17 @@
"endpoint": "https://lana-kk.myshopify.com/admin/api/2023-04/graphql.json", "endpoint": "https://lana-kk.myshopify.com/admin/api/2023-04/graphql.json",
"query": "={\n customers(first: 1, query: \"email:'{{ $json[\"body\"][\"mautic.lead_channel_subscription_changed\"][0][\"contact\"][\"fields\"][\"core\"][\"email\"][\"value\"] }}'\" ) {\n edges {\n node {\n id\n email\n marketingOptInLevel\n }\n }\n }\n}" "query": "={\n customers(first: 1, query: \"email:'{{ $json[\"body\"][\"mautic.lead_channel_subscription_changed\"][0][\"contact\"][\"fields\"][\"core\"][\"email\"][\"value\"] }}'\" ) {\n edges {\n node {\n id\n email\n marketingOptInLevel\n }\n }\n }\n}"
}, },
"id": "08ea065c-cc8d-4020-89c0-0aa35d99a373", "id": "1bc94c14-ceda-42e1-94dc-1ac91ac72f8b",
"name": "GraphQL", "name": "GraphQL",
"type": "n8n-nodes-base.graphql", "type": "n8n-nodes-base.graphql",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
340, 940,
1000 700
], ],
"credentials": { "credentials": {
"httpHeaderAuth": { "httpHeaderAuth": {
"id": "5", "id": "26",
"name": "lanakk.com - Shopify" "name": "lanakk.com - Shopify"
} }
} }
@ -295,13 +295,13 @@
}, },
"combineOperation": "any" "combineOperation": "any"
}, },
"id": "107bae94-57b1-4991-a8eb-41e85e5f85af", "id": "162ccd38-f38c-4a76-8e56-1ab52b89601e",
"name": "IF1", "name": "IF1",
"type": "n8n-nodes-base.if", "type": "n8n-nodes-base.if",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
580, 1180,
1000 700
] ]
}, },
{ {
@ -315,13 +315,13 @@
] ]
} }
}, },
"id": "b83cfae2-25dc-4ed6-8133-73ee7bb94b29", "id": "47173c1e-7a30-41c3-902d-3c271608c5e5",
"name": "Email vorhanden?", "name": "Email vorhanden?",
"type": "n8n-nodes-base.if", "type": "n8n-nodes-base.if",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
540, 1140,
280 -20
] ]
}, },
{ {
@ -332,17 +332,17 @@
"query": "=mutation customerEmailMarketingConsentUpdate($input: CustomerEmailMarketingConsentUpdateInput!) {\n customerEmailMarketingConsentUpdate(input: $input) {\n customer {\n id\n }\n userErrors {\n field\n message\n }\n }\n}", "query": "=mutation customerEmailMarketingConsentUpdate($input: CustomerEmailMarketingConsentUpdateInput!) {\n customerEmailMarketingConsentUpdate(input: $input) {\n customer {\n id\n }\n userErrors {\n field\n message\n }\n }\n}",
"variables": "={ \"input\": { \"customerId\": \"{{ $node[\"GraphQL\"].json[\"data\"][\"customers\"][\"edges\"][0][\"node\"][\"id\"] }}\", \"emailMarketingConsent\": { \"consentUpdatedAt\": \"{{ $now }}\", \"marketingOptInLevel\": \"SINGLE_OPT_IN\", \"marketingState\": \"UNSUBSCRIBED\" } }}" "variables": "={ \"input\": { \"customerId\": \"{{ $node[\"GraphQL\"].json[\"data\"][\"customers\"][\"edges\"][0][\"node\"][\"id\"] }}\", \"emailMarketingConsent\": { \"consentUpdatedAt\": \"{{ $now }}\", \"marketingOptInLevel\": \"SINGLE_OPT_IN\", \"marketingState\": \"UNSUBSCRIBED\" } }}"
}, },
"id": "4815d1b0-2455-4bb0-8dd3-717b216e60a1", "id": "d634f91d-8688-4503-9654-12a699e4dad6",
"name": "GraphQL2", "name": "GraphQL2",
"type": "n8n-nodes-base.graphql", "type": "n8n-nodes-base.graphql",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
820, 1420,
1140 840
], ],
"credentials": { "credentials": {
"httpHeaderAuth": { "httpHeaderAuth": {
"id": "5", "id": "26",
"name": "lanakk.com - Shopify" "name": "lanakk.com - Shopify"
} }
} }
@ -355,17 +355,17 @@
"query": "=mutation customerEmailMarketingConsentUpdate($input: CustomerEmailMarketingConsentUpdateInput!) {\n customerEmailMarketingConsentUpdate(input: $input) {\n customer {\n id\n }\n userErrors {\n field\n message\n }\n }\n}", "query": "=mutation customerEmailMarketingConsentUpdate($input: CustomerEmailMarketingConsentUpdateInput!) {\n customerEmailMarketingConsentUpdate(input: $input) {\n customer {\n id\n }\n userErrors {\n field\n message\n }\n }\n}",
"variables": "={ \"input\": { \"customerId\": \"{{ $node[\"GraphQL\"].json[\"data\"][\"customers\"][\"edges\"][0][\"node\"][\"id\"] }}\", \"emailMarketingConsent\": { \"consentUpdatedAt\": \"{{ $now }}\", \"marketingOptInLevel\": \"SINGLE_OPT_IN\", \"marketingState\": \"SUBSCRIBED\" } }}" "variables": "={ \"input\": { \"customerId\": \"{{ $node[\"GraphQL\"].json[\"data\"][\"customers\"][\"edges\"][0][\"node\"][\"id\"] }}\", \"emailMarketingConsent\": { \"consentUpdatedAt\": \"{{ $now }}\", \"marketingOptInLevel\": \"SINGLE_OPT_IN\", \"marketingState\": \"SUBSCRIBED\" } }}"
}, },
"id": "52d46a11-f459-449c-b93e-2890a94b1e65", "id": "dcf79e78-d4ba-4a55-bbc0-840c5c01dae4",
"name": "Abonniert", "name": "Abonniert",
"type": "n8n-nodes-base.graphql", "type": "n8n-nodes-base.graphql",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
820, 1420,
860 560
], ],
"credentials": { "credentials": {
"httpHeaderAuth": { "httpHeaderAuth": {
"id": "5", "id": "26",
"name": "lanakk.com - Shopify" "name": "lanakk.com - Shopify"
} }
} }
@ -380,30 +380,30 @@
"additionalFields": {}, "additionalFields": {},
"options": {} "options": {}
}, },
"id": "cb999a33-6849-4e36-8141-b5e80c19b175", "id": "72dff69d-d130-4533-979f-341c220925d1",
"name": "Mautic", "name": "Mautic",
"type": "n8n-nodes-base.mautic", "type": "n8n-nodes-base.mautic",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
340, 940,
440 140
], ],
"credentials": { "credentials": {
"mauticOAuth2Api": { "mauticOAuth2Api": {
"id": "6", "id": "20",
"name": "Mautic account" "name": "Mautic account"
} }
} }
}, },
{ {
"parameters": {}, "parameters": {},
"id": "614139b6-28fa-4983-9732-9cfaad82067a", "id": "9e72fd94-5416-4186-9738-0b1a19330f2c",
"name": "No Operation, do nothing", "name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp", "type": "n8n-nodes-base.noOp",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
340, 940,
640 340
] ]
}, },
{ {
@ -417,13 +417,13 @@
] ]
} }
}, },
"id": "2e6cebc8-94ce-473c-9248-f5cc359ee300", "id": "d81ac980-1063-462f-9812-44239e6fc49d",
"name": "Kontakt gefunden?", "name": "Kontakt gefunden?",
"type": "n8n-nodes-base.if", "type": "n8n-nodes-base.if",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-140, 460,
300 0
], ],
"alwaysOutputData": false "alwaysOutputData": false
}, },
@ -438,13 +438,13 @@
] ]
} }
}, },
"id": "f6faee14-d93d-4b85-b8fa-9f4d8c127594", "id": "580be6e1-8658-4741-b52a-43d22faa7e23",
"name": "Marketing Einwilligung?", "name": "Marketing Einwilligung?",
"type": "n8n-nodes-base.if", "type": "n8n-nodes-base.if",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
60, 660,
460 160
] ]
}, },
{ {
@ -452,18 +452,18 @@
"authentication": "accessToken", "authentication": "accessToken",
"topic": "customers/update" "topic": "customers/update"
}, },
"id": "b20ef5e3-b002-4d29-bacf-cb731237803b", "id": "e34a2cf2-8ee5-4cb9-9a9c-9ecd422107df",
"name": "Shopify Trigger", "name": "Shopify Trigger",
"type": "n8n-nodes-base.shopifyTrigger", "type": "n8n-nodes-base.shopifyTrigger",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-560, 40,
300 0
], ],
"webhookId": "ebce58fc-45cf-4c1c-8427-3ffbaccdb440", "webhookId": "ebce58fc-45cf-4c1c-8427-3ffbaccdb440",
"credentials": { "credentials": {
"shopifyAccessTokenApi": { "shopifyAccessTokenApi": {
"id": "11", "id": "25",
"name": "Shopify Access Token account" "name": "Shopify Access Token account"
} }
} }
@ -477,13 +477,13 @@
"secret": "0a9dcfe4f362625efc5a38bc709598c61869552fcfc1aceb8fc08edad8dd3825", "secret": "0a9dcfe4f362625efc5a38bc709598c61869552fcfc1aceb8fc08edad8dd3825",
"encoding": "base64" "encoding": "base64"
}, },
"id": "2c64dae7-5409-4767-92ab-43239bb038f0", "id": "31deaf45-706d-4bcc-b92a-1f0ed7f8ff9e",
"name": "Crypto", "name": "Crypto",
"type": "n8n-nodes-base.crypto", "type": "n8n-nodes-base.crypto",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-140, 460,
1140 840
] ]
}, },
{ {
@ -497,13 +497,13 @@
] ]
} }
}, },
"id": "d16fae8c-6b13-42cb-831b-437c41919b1b", "id": "dec9961f-d754-4d87-980f-61853ea66a14",
"name": "IF", "name": "IF",
"type": "n8n-nodes-base.if", "type": "n8n-nodes-base.if",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
80, 680,
1140 840
] ]
}, },
{ {
@ -511,24 +511,24 @@
"setAllData": false, "setAllData": false,
"options": {} "options": {}
}, },
"id": "2677101f-c550-4748-afef-e41fe1af0604", "id": "cfff982c-953b-49fd-8d43-340ca7a1f447",
"name": "Move Binary Data", "name": "Move Binary Data",
"type": "n8n-nodes-base.moveBinaryData", "type": "n8n-nodes-base.moveBinaryData",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
-360, 240,
1140 840
] ]
}, },
{ {
"parameters": {}, "parameters": {},
"id": "6cb7bd1f-939d-43af-966e-171a1ba3d7da", "id": "9f471b45-d736-494d-9221-49c45f700c8b",
"name": "No Operation, do nothing1", "name": "No Operation, do nothing1",
"type": "n8n-nodes-base.noOp", "type": "n8n-nodes-base.noOp",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
340, 940,
1300 1000
] ]
}, },
{ {
@ -536,13 +536,13 @@
"endpoint": "https://swapi-graphql.netlify.app/.netlify/functions/index", "endpoint": "https://swapi-graphql.netlify.app/.netlify/functions/index",
"query": "query Query { allFilms { films { title director releaseDate speciesConnection { species { name classification homeworld { name } } } } } }" "query": "query Query { allFilms { films { title director releaseDate speciesConnection { species { name classification homeworld { name } } } } } }"
}, },
"id": "49c0a40f-d1a2-453a-ac5b-37230206772f", "id": "fe1512a0-bb72-4ef1-b6db-f676336c3fbe",
"name": "GraphQL1", "name": "GraphQL1",
"type": "n8n-nodes-base.graphql", "type": "n8n-nodes-base.graphql",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
180, 780,
160 -140
] ]
} }
], ],
@ -550,11 +550,11 @@
"settings": {}, "settings": {},
"staticData": { "staticData": {
"node:Shopify Trigger": { "node:Shopify Trigger": {
"webhookId": 1289446981897 "webhookId": 1286935085321
} }
}, },
"tags": [], "tags": [],
"triggerCount": 2, "triggerCount": 2,
"updatedAt": "2023-08-25T09:48:56.000Z", "updatedAt": "2023-08-07T06:58:05.000Z",
"versionId": "bd1863bc-07f6-4715-b7de-a081c5ac6cc8" "versionId": "71645759-216e-40ec-8b5c-3ba48b22cc4d"
} }

View File

@ -13,8 +13,8 @@
] ]
} }
}, },
"createdAt": "2023-08-25T09:28:20.711Z", "createdAt": "2023-02-21T04:38:04.209Z",
"id": "3", "id": "5",
"name": "Webcron", "name": "Webcron",
"nodes": [ "nodes": [
{ {
@ -27,13 +27,13 @@
] ]
} }
}, },
"id": "84ffc791-5209-498c-bc3c-702d68c87a32", "id": "361e5473-3df8-4543-8f80-c1eb9c8a1748",
"name": "Schedule Trigger", "name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger", "type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1, "typeVersion": 1,
"position": [ "position": [
360, 340,
280 420
] ]
}, },
{ {
@ -41,13 +41,13 @@
"url": "https://cloud.lanakk.com/cron.php", "url": "https://cloud.lanakk.com/cron.php",
"options": {} "options": {}
}, },
"id": "1e80fd49-aad7-4f14-9533-a5d4776bd275", "id": "72f1dec2-c62b-4112-ba2a-b73dd9db267a",
"name": "HTTP Request", "name": "HTTP Request",
"type": "n8n-nodes-base.httpRequest", "type": "n8n-nodes-base.httpRequest",
"typeVersion": 3, "typeVersion": 3,
"position": [ "position": [
540, 520,
280 420
] ]
} }
], ],
@ -60,6 +60,6 @@
}, },
"tags": [], "tags": [],
"triggerCount": 1, "triggerCount": 1,
"updatedAt": "2023-08-25T09:28:27.000Z", "updatedAt": "2023-03-30T06:48:30.000Z",
"versionId": "e11908fd-bdbb-4134-bbcf-d90b4b038fa2" "versionId": null
} }

View File

@ -1,448 +0,0 @@
{
"active": true,
"connections": {
"n8n": {
"main": [
[
{
"node": "OneAtATime",
"type": "main",
"index": 0
}
]
]
},
"new": {
"main": [
[
{
"node": "GitHub Create",
"type": "main",
"index": 0
}
]
]
},
"same": {
"main": [
[
{
"node": "OneAtATime",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "isDiffOrNew",
"type": "main",
"index": 0
}
]
]
},
"GitHub": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Globals": {
"main": [
[
{
"node": "n8n",
"type": "main",
"index": 0
}
]
]
},
"different": {
"main": [
[
{
"node": "GitHub Edit",
"type": "main",
"index": 0
}
]
]
},
"OneAtATime": {
"main": [
[
{
"node": "GitHub",
"type": "main",
"index": 0
},
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"GitHub Edit": {
"main": [
[
{
"node": "OneAtATime",
"type": "main",
"index": 0
}
]
]
},
"isDiffOrNew": {
"main": [
[
{
"node": "github_status",
"type": "main",
"index": 0
}
]
]
},
"GitHub Create": {
"main": [
[
{
"node": "OneAtATime",
"type": "main",
"index": 0
}
]
]
},
"github_status": {
"main": [
[
{
"node": "same",
"type": "main",
"index": 0
}
],
[
{
"node": "different",
"type": "main",
"index": 0
}
],
[
{
"node": "new",
"type": "main",
"index": 0
}
]
]
},
"Every 12 hours": {
"main": [
[
{
"node": "Globals",
"type": "main",
"index": 0
}
]
]
},
"On clicking 'execute'": {
"main": [
[
{
"node": "Globals",
"type": "main",
"index": 0
}
]
]
}
},
"createdAt": "2023-08-25T09:22:16.778Z",
"id": "2",
"name": "n8n Backup",
"nodes": [
{
"parameters": {},
"id": "85130382-8fe5-440c-89cd-d38345a844f0",
"name": "On clicking 'execute'",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-1185,
355
],
"typeVersion": 1
},
{
"parameters": {
"authentication": "oAuth2",
"resource": "file",
"operation": "get",
"owner": "={{$node[\"Globals\"].json[\"repo\"][\"owner\"]}}",
"repository": "={{$node[\"Globals\"].json[\"repo\"][\"name\"]}}",
"filePath": "={{$node[\"Globals\"].json[\"repo\"][\"path\"]}}{{$json[\"name\"]}}.json",
"asBinaryProperty": false,
"additionalParameters": {}
},
"id": "670f96a9-0299-4e92-9c85-9ce12eb6311d",
"name": "GitHub",
"type": "n8n-nodes-base.github",
"position": [
-340,
320
],
"typeVersion": 1,
"alwaysOutputData": true,
"credentials": {
"githubOAuth2Api": {
"id": "4",
"name": "GitHub account"
}
},
"continueOnFail": true
},
{
"parameters": {
"dataType": "string",
"value1": "={{$json[\"github_status\"]}}",
"rules": {
"rules": [
{
"value2": "same"
},
{
"value2": "different",
"output": 1
},
{
"value2": "new",
"output": 2
}
]
}
},
"id": "a53c7f77-c6f4-4da4-92ba-324dd1a8145b",
"name": "github_status",
"type": "n8n-nodes-base.switch",
"position": [
300,
460
],
"typeVersion": 1
},
{
"parameters": {},
"id": "a98b3acc-b3a1-4c75-91be-e4b55a6ad25f",
"name": "same",
"type": "n8n-nodes-base.noOp",
"position": [
540,
260
],
"typeVersion": 1
},
{
"parameters": {},
"id": "9c4b5247-4c8f-4744-84fe-4f1047778813",
"name": "different",
"type": "n8n-nodes-base.noOp",
"position": [
540,
460
],
"typeVersion": 1
},
{
"parameters": {},
"id": "2b3610ba-26f6-4eb4-a93f-a687a5bde275",
"name": "new",
"type": "n8n-nodes-base.noOp",
"position": [
540,
640
],
"typeVersion": 1
},
{
"parameters": {
"authentication": "oAuth2",
"resource": "file",
"operation": "edit",
"owner": "={{$node[\"Globals\"].json[\"repo\"][\"owner\"]}}",
"repository": "={{$node[\"Globals\"].json[\"repo\"][\"name\"]}}",
"filePath": "={{$node[\"Globals\"].json[\"repo\"][\"path\"]}}{{$node[\"OneAtATime\"].json[\"name\"]}}.json",
"fileContent": "={{$node[\"isDiffOrNew\"].json[\"n8n_data_stringy\"]}}",
"commitMessage": "=[N8N Backup] {{$node[\"OneAtATime\"].json[\"name\"]}}.json ({{$json[\"github_status\"]}})"
},
"id": "5093f483-1f89-461e-923b-2b2ec242d231",
"name": "GitHub Edit",
"type": "n8n-nodes-base.github",
"position": [
720,
460
],
"typeVersion": 1,
"credentials": {
"githubOAuth2Api": {
"id": "4",
"name": "GitHub account"
}
}
},
{
"parameters": {
"authentication": "oAuth2",
"resource": "file",
"owner": "={{$node[\"Globals\"].json[\"repo\"][\"owner\"]}}",
"repository": "={{$node[\"Globals\"].json[\"repo\"][\"name\"]}}",
"filePath": "={{$node[\"Globals\"].json[\"repo\"][\"path\"]}}{{$node[\"OneAtATime\"].json[\"name\"]}}.json",
"fileContent": "={{$node[\"isDiffOrNew\"].json[\"n8n_data_stringy\"]}}",
"commitMessage": "=[N8N Backup] {{$node[\"OneAtATime\"].json[\"name\"]}}.json ({{$json[\"github_status\"]}})"
},
"id": "7948af39-295e-496e-bab4-6558e6f1fc12",
"name": "GitHub Create",
"type": "n8n-nodes-base.github",
"position": [
720,
640
],
"typeVersion": 1,
"credentials": {
"githubOAuth2Api": {
"id": "4",
"name": "GitHub account"
}
}
},
{
"parameters": {
"batchSize": 1,
"options": {}
},
"id": "026290e1-7db2-4aca-990e-acebc3098880",
"name": "OneAtATime",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-560,
480
],
"typeVersion": 1
},
{
"parameters": {
"values": {
"string": [
{
"name": "repo.owner",
"value": "m3tam3re"
},
{
"name": "repo.name",
"value": "n8n-backup"
},
{
"name": "repo.path",
"value": "workflows/"
}
]
},
"options": {}
},
"id": "b1f6bda3-493b-4616-ac83-9445b8ed49f4",
"name": "Globals",
"type": "n8n-nodes-base.set",
"position": [
-1000,
480
],
"typeVersion": 1
},
{
"parameters": {
"triggerTimes": {
"item": [
{
"mode": "everyX",
"value": 12
}
]
}
},
"id": "7d03c69b-ab45-4126-ae89-e4b9655bb838",
"name": "Every 12 hours",
"type": "n8n-nodes-base.cron",
"position": [
-1185,
615
],
"typeVersion": 1
},
{
"parameters": {
"filters": {}
},
"id": "482a6d9f-100f-4976-a38d-0ff385f09918",
"name": "n8n",
"type": "n8n-nodes-base.n8n",
"position": [
-800,
480
],
"typeVersion": 1,
"credentials": {
"n8nApi": {
"id": "3",
"name": "n8n account"
}
}
},
{
"parameters": {
"jsCode": "// File Returned with Content\nif (Object.keys($input.all()[0].json).includes(\"content\")) {\n // Get JSON Objects\n var origWorkflow = JSON.parse(Buffer.from($input.all()[0].json.content, 'base64'));\n var n8nWorkflow = $input.all()[1].json;\n \n // Order JSON Objects\n var orderedOriginal = {}\n var orderedActual = {}\n \n Object.keys(origWorkflow).sort().forEach(function(key) {\n orderedOriginal[key] = origWorkflow[key];\n });\n \n Object.keys(n8nWorkflow).sort().forEach(function(key) {\n orderedActual[key] = n8nWorkflow[key];\n });\n\n // Determine Difference\n if ( JSON.stringify(orderedOriginal) === JSON.stringify(orderedActual) ) {\n $input.all()[0].json.github_status = \"same\";\n $input.all()[0].json.content_decoded = orderedOriginal;\n } else {\n $input.all()[0].json.github_status = \"different\";\n $input.all()[0].json.content_decoded = orderedOriginal;\n $input.all()[0].json.n8n_data_stringy = JSON.stringify(orderedActual, null, 2);\n }\n// No File Returned / New Workflow\n} else {\n // Order JSON Object\n var n8nWorkflow = ($input.all()[1].json);\n var orderedActual = {}\n Object.keys(n8nWorkflow).sort().forEach(function(key) {\n orderedActual[key] = n8nWorkflow[key];\n });\n \n // Proper Formatting\n $input.all()[0].json.github_status = \"new\";\n $input.all()[0].json.n8n_data_stringy = JSON.stringify(orderedActual, null, 2);\n}\n\n// Return Items\nreturn $input.all();"
},
"id": "170eb381-afa6-4cd0-9ed3-6a4686fef31b",
"name": "isDiffOrNew",
"type": "n8n-nodes-base.code",
"position": [
60,
460
],
"typeVersion": 1
},
{
"parameters": {},
"id": "9889f4d7-7e6b-4522-8f00-1110d7f2768a",
"name": "Merge",
"type": "n8n-nodes-base.merge",
"position": [
-120,
460
],
"typeVersion": 2
}
],
"pinData": {},
"settings": {},
"staticData": null,
"tags": [],
"triggerCount": 1,
"updatedAt": "2023-08-25T09:50:30.000Z",
"versionId": "6be3d1b5-554e-41a1-83e3-bffd640ce9da"
}