feat: add folder support for workflows (fixes #70)
This commit is contained in:
@@ -0,0 +1,165 @@
|
||||
{
|
||||
"id": "1001",
|
||||
"name": "typeform feedback workflow",
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Typeform Trigger",
|
||||
"type": "n8n-nodes-base.typeformTrigger",
|
||||
"notes": "course feedback",
|
||||
"position": [
|
||||
450,
|
||||
300
|
||||
],
|
||||
"webhookId": "1234567890",
|
||||
"parameters": {
|
||||
"formId": "yxcvbnm"
|
||||
},
|
||||
"credentials": {
|
||||
"typeformApi": "typeform"
|
||||
},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "IF",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"notes": "filter feedback",
|
||||
"position": [
|
||||
850,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"number": [
|
||||
{
|
||||
"value1": "={{$json[\"usefulness\"]}}",
|
||||
"value2": 3,
|
||||
"operation": "largerEqual"
|
||||
}
|
||||
],
|
||||
"string": [],
|
||||
"boolean": []
|
||||
}
|
||||
},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"notes": "positive feedback",
|
||||
"position": [
|
||||
1050,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"range": "positive_feedback!A:C",
|
||||
"options": {},
|
||||
"sheetId": "asdfghjklöä",
|
||||
"operation": "append",
|
||||
"authentication": "oAuth2"
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": "google_sheets_oauth"
|
||||
},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Set",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"notes": "capture typeform data",
|
||||
"position": [
|
||||
650,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"values": {
|
||||
"number": [
|
||||
{
|
||||
"name": "usefulness",
|
||||
"value": "={{$json[\"How useful was the course?\"]}}"
|
||||
}
|
||||
],
|
||||
"string": [
|
||||
{
|
||||
"name": "opinion",
|
||||
"value": "={{$json[\"Your opinion on the course:\"]}}"
|
||||
}
|
||||
],
|
||||
"boolean": []
|
||||
},
|
||||
"options": {},
|
||||
"keepOnlySet": true
|
||||
},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Google Sheets1",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"notes": "negative feedback",
|
||||
"position": [
|
||||
1050,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"range": "negative_feedback!A:C",
|
||||
"keyRow": 1,
|
||||
"options": {},
|
||||
"sheetId": "qwertzuiop",
|
||||
"operation": "append",
|
||||
"authentication": "oAuth2"
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": "google_sheets_oauth"
|
||||
},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"settings": {},
|
||||
"connections": {
|
||||
"IF": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "IF",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Typeform Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
700,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"range": "Problems!A:D",
|
||||
"options": {},
|
||||
"sheetId": "17fzSFl1BZ1njldTfp5lvh8HtS0-pNXH66b7qGZIiGRU"
|
||||
},
|
||||
"credentials": {
|
||||
"googleApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
500,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"path": "webhook",
|
||||
"options": {},
|
||||
"responseData": "allEntries",
|
||||
"responseMode": "lastNode"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Read Sheet",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
450,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"sheetId": "1GT2dc0dOkAC1apY0UlTKY9vitBl8PtKrILvFiAy5VBs"
|
||||
},
|
||||
"credentials": {
|
||||
"googleApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Convert to XLS",
|
||||
"type": "n8n-nodes-base.spreadsheetFile",
|
||||
"position": [
|
||||
650,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"operation": "toFile"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Upload Dropbox",
|
||||
"type": "n8n-nodes-base.dropbox",
|
||||
"position": [
|
||||
850,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"path": "/my-sheets/prices.xls",
|
||||
"binaryData": true
|
||||
},
|
||||
"credentials": {
|
||||
"dropboxApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Trigger all 15 min",
|
||||
"type": "n8n-nodes-base.interval",
|
||||
"position": [
|
||||
250,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"unit": "minutes",
|
||||
"interval": 15
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Read Sheet": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Convert to XLS",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Convert to XLS": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Upload Dropbox",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Trigger all 15 min": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Read Sheet",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Google Sheets1",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"notes": "Append data to sheet",
|
||||
"position": [
|
||||
980,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"range": "A:C",
|
||||
"options": {
|
||||
"usePathForKeyRow": true
|
||||
},
|
||||
"sheetId": "qwertz",
|
||||
"operation": "append",
|
||||
"authentication": "oAuth2"
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "2",
|
||||
"name": "google_sheets_oauth"
|
||||
}
|
||||
},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "read json file",
|
||||
"type": "n8n-nodes-base.readBinaryFile",
|
||||
"position": [
|
||||
620,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"filePath": "/username/users_spreadsheet.json"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "move binary data 2",
|
||||
"type": "n8n-nodes-base.moveBinaryData",
|
||||
"position": [
|
||||
800,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"read json file": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "move binary data 2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"move binary data 2": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Cron",
|
||||
"type": "n8n-nodes-base.cron",
|
||||
"position": [
|
||||
100,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"triggerTimes": {
|
||||
"item": [
|
||||
{
|
||||
"hour": 5,
|
||||
"mode": "everyWeek"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "MySQL - insert",
|
||||
"type": "n8n-nodes-base.mySql",
|
||||
"position": [
|
||||
500,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"table": "books",
|
||||
"columns": "title, price",
|
||||
"options": {
|
||||
"ignore": true,
|
||||
"priority": "LOW_PRIORITY"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"mySql": {
|
||||
"id": "82",
|
||||
"name": "MySQL account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Google Sheets - read",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
300,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"sheetId": "qwertz",
|
||||
"authentication": "oAuth2"
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "2",
|
||||
"name": "google_sheets_oauth"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Cron": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets - read",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Sheets - read": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "MySQL - insert",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Cron",
|
||||
"type": "n8n-nodes-base.cron",
|
||||
"position": [
|
||||
100,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"triggerTimes": {
|
||||
"item": [
|
||||
{
|
||||
"hour": 5,
|
||||
"mode": "everyWeek"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "MySQL - select",
|
||||
"type": "n8n-nodes-base.mySql",
|
||||
"position": [
|
||||
300,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"query": "SELECT * FROM books;",
|
||||
"operation": "executeQuery"
|
||||
},
|
||||
"credentials": {
|
||||
"mySql": {
|
||||
"id": "82",
|
||||
"name": "MySQL account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Google Sheets - write",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
500,
|
||||
420
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"sheetId": "qwertz",
|
||||
"operation": "append",
|
||||
"authentication": "oAuth2"
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "2",
|
||||
"name": "google_sheets_oauth"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Cron": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "MySQL - select",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"MySQL - select": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets - write",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Read from Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
460,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"sheetId": "1uFISwZJ1rzkOnOSNocX-_n-ASSAznWGdpcPK3_KCvVo"
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "19",
|
||||
"name": "Tom's Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"name": "Create HTML file",
|
||||
"type": "n8n-nodes-base.spreadsheetFile",
|
||||
"position": [
|
||||
680,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "toFile",
|
||||
"fileFormat": "html"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
240,
|
||||
300
|
||||
],
|
||||
"webhookId": "08569699-fea2-4856-80aa-fe878ab9dd4f",
|
||||
"parameters": {
|
||||
"path": "08569699-fea2-4856-80aa-fe878ab9dd4f",
|
||||
"options": {},
|
||||
"responseData": "firstEntryBinary",
|
||||
"responseMode": "lastNode"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Read from Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Read from Google Sheets": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Create HTML file",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Read from Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
460,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"sheetId": "1uFISwZJ1rzkOnOSNocX-_n-ASSAznWGdpcPK3_KCvVo"
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "19",
|
||||
"name": "Tom's Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"name": "Respond to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
900,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"responseHeaders": {
|
||||
"entries": [
|
||||
{
|
||||
"name": "Content-Type",
|
||||
"value": "text/html; charset=UTF-8"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"respondWith": "text",
|
||||
"responseBody": "={{$json[\"html\"]}}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Build HTML",
|
||||
"type": "n8n-nodes-base.function",
|
||||
"position": [
|
||||
680,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"functionCode": "const columns = Object.keys(items[0].json);\n\nconst html = `\n<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>HTML Table Example</title>\n <link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx\" crossorigin=\"anonymous\">\n </head>\n <body>\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col\">\n <h1>HTML Table Example</h1>\n <table class=\"table\">\n <thead>\n <tr>\n ${columns.map(e => '<th scope=\"col\">' + e + '</th>').join('\\n')}\n </tr>\n </thead>\n <tbody>\n ${items.map(e => '<tr>' + columns.map(ee => '<td>' + e.json[ee] + '</td>').join('\\n') + '</tr>').join('\\n')}\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js\" integrity=\"sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa\" crossorigin=\"anonymous\"></script>\n </body>\n</html>\n`;\n\nreturn [{\n json: {\n html: html\n }\n}];"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
240,
|
||||
300
|
||||
],
|
||||
"webhookId": "bbcd9487-54f9-449d-8246-49f3f61f44fc",
|
||||
"parameters": {
|
||||
"path": "bbcd9487-54f9-449d-8246-49f3f61f44fc",
|
||||
"options": {},
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Read from Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Build HTML": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Read from Google Sheets": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Build HTML",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Google Sheets1",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"notes": "Append data to sheet",
|
||||
"position": [
|
||||
980,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"range": "A:C",
|
||||
"options": {
|
||||
"usePathForKeyRow": true
|
||||
},
|
||||
"sheetId": "qwertz",
|
||||
"operation": "append",
|
||||
"authentication": "oAuth2"
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "2",
|
||||
"name": "google_sheets_oauth"
|
||||
}
|
||||
},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "read json file",
|
||||
"type": "n8n-nodes-base.readBinaryFile",
|
||||
"position": [
|
||||
620,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"filePath": "/username/users_spreadsheet.json"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "move binary data 2",
|
||||
"type": "n8n-nodes-base.moveBinaryData",
|
||||
"position": [
|
||||
800,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"read json file": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "move binary data 2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"move binary data 2": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "a2434c94d549548a685cca39cc4614698e94f527bcea84eefa363f1037ae14cd"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "b3a0fa7c-eb47-4f51-98d7-ac1a8de7b05d",
|
||||
"name": "On new or updated row",
|
||||
"type": "n8n-nodes-base.googleSheetsTrigger",
|
||||
"position": [
|
||||
800,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"columnsToWatch": [
|
||||
"Security Code"
|
||||
]
|
||||
},
|
||||
"pollTimes": {
|
||||
"item": [
|
||||
{
|
||||
"mode": "everyMinute"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Np8TQv7kWwwrGiPkWWsmr4WYWAosv1BMBwwCd0f-dis/edit#gid=0",
|
||||
"cachedResultName": "Investments"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1Np8TQv7kWwwrGiPkWWsmr4WYWAosv1BMBwwCd0f-dis",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Np8TQv7kWwwrGiPkWWsmr4WYWAosv1BMBwwCd0f-dis/edit?usp=drivesdk",
|
||||
"cachedResultName": "Investments"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsTriggerOAuth2Api": {
|
||||
"id": "35",
|
||||
"name": "TEST USER"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "61b96d9b-801c-43e6-b89a-a55245386e4f",
|
||||
"name": "Send message",
|
||||
"type": "n8n-nodes-base.discord",
|
||||
"position": [
|
||||
1200,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=```\n{{ $json.ascii_table }}\n```",
|
||||
"options": {},
|
||||
"webhookUri": "https://discord.com/api/webhooks/..."
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2dc9ce88-2079-4419-9f48-2281ac25cb36",
|
||||
"name": "Convert to ASCII table",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
1000,
|
||||
380
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "/* configure columns to be displayed */\nconst columns_to_display = [\n \"Security Code\",\n \"Price\",\n \"Quantity\",\n]\n\n/* End of configuration section (do not edit code below) */\nconst google_sheets_data = $('On new or updated row').all();\n\n/**\n * Takes a list of objects and returns an ascii table with\n * padding and headers.\n */\nfunction ascii_table(data, columns_to_display) {\n let table = \"\"\n \n // Get the headers\n let headers = []\n for (let i = 0; i < columns_to_display.length; i++) {\n headers.push(columns_to_display[i])\n }\n\n // Get the longest string in each column\n let longest_strings = []\n for (let i = 0; i < headers.length; i++) {\n let longest_string = headers[i].length\n for (let j = 0; j < data.length; j++) {\n let string_length = data[j].json[headers[i]].length\n if (string_length > longest_string) {\n longest_string = string_length\n }\n }\n longest_strings.push(longest_string)\n }\n\n // Add the headers to the table\n for (let i = 0; i < headers.length; i++) {\n table += headers[i].toString().padEnd(longest_strings[i] + 2, \" \")\n }\n\n // Add the data to the table\n for (let i = 0; i < data.length; i++) {\n table += \"\\n\"\n for (let j = 0; j < headers.length; j++) {\n table += data[i].json[headers[j]].toString().padEnd(longest_strings[j] + 2, \" \")\n }\n }\n\n return table\n}\n\noutput = {\n ascii_table: ascii_table(google_sheets_data, columns_to_display),\n}\n\nconsole.log(output.ascii_table)\n\nreturn output"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2db7b37b-22f9-424d-a889-33f8a0db2b01",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
340,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"width": 402,
|
||||
"height": 433,
|
||||
"content": "## Send Google Sheets data as a message to a Discord channel\nThis workflow sends a message to a Discord channel when a new row is added or a row is updated in a Google Sheet. The message will send all data rows in the Google Sheet.\n\n### How it works\nUsing a code node, we can use the obtained Google Sheet data to create a custom message that will be sent to Discord. The message will be sent to the Discord channel specified in the Discord node.\n\n### Setup\nThis workflow requires that you set up a Discord webhook and have an existing Google Sheet with data. See how to set up a Discord webhook [here](https://docs.n8n.io/integrations/builtin/credentials/discord/#creating-a-webhook-in-discord).\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"On new or updated row": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Convert to ASCII table",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Convert to ASCII table": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Send message",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
700,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"range": "Problems!A:D",
|
||||
"options": {},
|
||||
"sheetId": "17fzSFl1BZ1njldTfp5lvh8HtS0-pNXH66b7qGZIiGRU"
|
||||
},
|
||||
"credentials": {
|
||||
"googleApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
500,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"path": "webhook",
|
||||
"options": {},
|
||||
"responseData": "allEntries",
|
||||
"responseMode": "lastNode"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "096a8e0c-8f72-40fb-aa1e-118fb33a3916",
|
||||
"name": "Prepare Fields",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
1740,
|
||||
860
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "const formData = $input.all()[0].json.payload.data\nconst Date = $input.all()[0].json.payload.submittedAt || new Date()\n\nreturn {\n ...formData, // creates a new field for every element inside formData\n Date\n}\n\n \n"
|
||||
},
|
||||
"notesInFlow": false,
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "c98bb655-aa79-447f-897d-56ba9640073b",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1660,
|
||||
780
|
||||
],
|
||||
"parameters": {
|
||||
"color": 2,
|
||||
"width": 270,
|
||||
"height": 250,
|
||||
"content": "1 line of code to take the data object (adding date as a plus)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "05a27975-ac48-48db-9c82-c9658a8d14c2",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
1260,
|
||||
640
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 267,
|
||||
"height": 394,
|
||||
"content": "Make sure to disable legacy API\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "59d25f8e-bc9d-43ac-9c4b-3013f81c3e3d",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
2040,
|
||||
760
|
||||
],
|
||||
"parameters": {
|
||||
"color": 4,
|
||||
"width": 270,
|
||||
"height": 274,
|
||||
"content": "Automatically create column names and append data (works even on empty sheets)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "33c45b7e-e696-4aed-9374-0b232bfd52f1",
|
||||
"name": "On Form Submission",
|
||||
"type": "n8n-nodes-base.webflowTrigger",
|
||||
"position": [
|
||||
1340,
|
||||
860
|
||||
],
|
||||
"webhookId": "c3ef5b9f-88f6-40e6-bc54-067e421b059a",
|
||||
"parameters": {
|
||||
"site": "640cfc01791fc750653436fd"
|
||||
},
|
||||
"credentials": {
|
||||
"webflowOAuth2Api": {
|
||||
"id": "a3UDqxewt1XM79VP",
|
||||
"name": "Webflow account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "4ce0eeea-dd09-4d79-967e-210f2762d5c3",
|
||||
"name": "Append New Row",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
2120,
|
||||
860
|
||||
],
|
||||
"parameters": {
|
||||
"columns": {
|
||||
"value": {
|
||||
"Name": "={{ $json.data.Name }}",
|
||||
"Email": "={{ $json.data.Email }}",
|
||||
"Message": "={{ $json.data.Message }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "Name",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Name",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Email",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Email",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Message",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Message",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "data",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": true,
|
||||
"required": false,
|
||||
"displayName": "data",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "autoMapInputData",
|
||||
"matchingColumns": []
|
||||
},
|
||||
"options": {},
|
||||
"operation": "append",
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gLJ5I4ZJ9FQHJH56lunUKnHUBUsIms9PciIkJYi8SJE/edit#gid=0",
|
||||
"cachedResultName": "Sheet1"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1gLJ5I4ZJ9FQHJH56lunUKnHUBUsIms9PciIkJYi8SJE",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gLJ5I4ZJ9FQHJH56lunUKnHUBUsIms9PciIkJYi8SJE/edit?usp=drivesdk",
|
||||
"cachedResultName": "Automation test"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "QkZbOZMXiUKxATjx",
|
||||
"name": "Google Sheets account 2"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "01a09112-930c-493a-b16c-660e4dc3d272",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
260,
|
||||
160
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 520,
|
||||
"height": 1680,
|
||||
"content": "## Self-hosted N8N users only:\n\n### How to get Client ID and Client Secret\n\n- From your Webflow dashboard go to \"Apps & Integrations\"\n\n\n- Look for \"App development\" and click \"Create an App\"\n\n\n- Fill the fields and click \"Continue\"\n\n\n- Inside \"Building blocks\" enable REST API, insert your \"Redirect URL\" from N8N, enable form access and click \"Create App\"\n\n\n\n- Copy and paste Client ID and Client Secret to N8N and connect\n\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Prepare Fields": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Append New Row",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"On Form Submission": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Prepare Fields",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Typeform Trigger",
|
||||
"type": "n8n-nodes-base.typeformTrigger",
|
||||
"position": [
|
||||
450,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"formId": "UXuY0A"
|
||||
},
|
||||
"credentials": {
|
||||
"typeformApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "IF",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
850,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"number": [
|
||||
{
|
||||
"value1": "={{$node[\"Google Sheets\"].data[\"Severity\"]}}",
|
||||
"value2": 7,
|
||||
"operation": "larger"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
650,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"range": "Problems!A:D",
|
||||
"sheetId": "17fzSFl1BZ1njldTfp5lvh8HtS0-pNXH66b7qGZIiGRU",
|
||||
"operation": "append"
|
||||
},
|
||||
"credentials": {
|
||||
"googleApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Send Email",
|
||||
"type": "n8n-nodes-base.emailSend",
|
||||
"position": [
|
||||
1050,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Email: {{$node[\"IF\"].data[\"Email\"]}}\nName: {{$node[\"IF\"].data[\"Name\"]}}\nSeverity: {{$node[\"IF\"].data[\"Severity\"]}}\n\nProblem:\n{{$node[\"IF\"].data[\"Problem\"]}}",
|
||||
"subject": "User Reported Problem",
|
||||
"toEmail": "",
|
||||
"fromEmail": ""
|
||||
},
|
||||
"credentials": {
|
||||
"smtp": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Slack",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
1050,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Email: {{$node[\"IF\"].data[\"Email\"]}}\nName: {{$node[\"IF\"].data[\"Name\"]}}\nSeverity: {{$node[\"IF\"].data[\"Severity\"]}}\n\nProblem:\n{{$node[\"IF\"].data[\"Problem\"]}}",
|
||||
"channel": "problems",
|
||||
"attachments": [],
|
||||
"otherOptions": {}
|
||||
},
|
||||
"credentials": {
|
||||
"slackApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"IF": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Slack",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Send Email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Sheets": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "IF",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Typeform Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "b503899dfd9ae32bbf8e1f446a1f2c9b3c59f80c79b274c49b1606b7ae9579e1"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "21da7bb6-6544-4756-9d0a-ab8ae21650d4",
|
||||
"name": "Google Sheets Trigger",
|
||||
"type": "n8n-nodes-base.googleSheetsTrigger",
|
||||
"position": [
|
||||
-120,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"event": "rowAdded",
|
||||
"options": {},
|
||||
"pollTimes": {
|
||||
"item": [
|
||||
{
|
||||
"mode": "everyMinute"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1SP8Y-qffC96ZV3ueVUYWP5pjqtaycaM7Kbv5L-ztw5g/edit#gid=0",
|
||||
"cachedResultName": "Sheet1"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1SP8Y-qffC96ZV3ueVUYWP5pjqtaycaM7Kbv5L-ztw5g",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1SP8Y-qffC96ZV3ueVUYWP5pjqtaycaM7Kbv5L-ztw5g/edit?usp=drivesdk",
|
||||
"cachedResultName": "URL list"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "39a9a0a3-13c7-4271-bca4-31848201e48b",
|
||||
"name": "Take a screenshot of a website",
|
||||
"type": "@custom-js/n8n-nodes-pdf-toolkit.websiteScreenshot",
|
||||
"position": [
|
||||
160,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"urlInput": "={{ $json.Url }}"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1dc3cb1a-99ee-4e85-b628-0f4a77149728",
|
||||
"name": "Store Screenshots",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
400,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"name": "={{ $json.Title }}.png",
|
||||
"driveId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "My Drive"
|
||||
},
|
||||
"options": {},
|
||||
"folderId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1oFbmzgG2fsRix45r5JtowYjAdwskJ0P6",
|
||||
"cachedResultUrl": "https://drive.google.com/drive/folders/1oFbmzgG2fsRix45r5JtowYjAdwskJ0P6",
|
||||
"cachedResultName": "screenshots"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Google Sheets Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Take a screenshot of a website",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Take a screenshot of a website": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Store Screenshots",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,351 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "6a5e68bcca67c4cdb3e0b698d01739aea084e1ec06e551db64aeff43d174cb23",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "bc49829b-45f2-4910-9c37-907271982f14",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-140,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 780,
|
||||
"height": 540,
|
||||
"content": "### 4. Do you need more details?\nFind a step-by-step guide in this tutorial\n\n[🎥 Watch My Tutorial](https://www.youtube.com/watch?v=kQ8dO_30SB0)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "40c6e16a-3b4f-4e28-b0a1-7066e0efab5d",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
-460,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Email Subject: {{ $json.subject }}\nEmail Body: \n{{ $json.text }}",
|
||||
"options": {
|
||||
"systemMessage": "=You are an assistant that processes emails related to inbound orders from Hermas.\n\nEach email has the subject line containing a purchase order reference (e.g., \"PO45231\").\nIn the email body, you will find:\n\nAn expected delivery date, typically in formats like 27/03/2025 or 2025-03-27.\n\nOne or more order lines, where each line contains:\n\nAn SKU (e.g., HERM-SHOE-001)\n\nA quantity (e.g., 120)\n\nYour goal is to extract the following fields:\n\npurchase_order: The PO number from the subject line (e.g., PO45231)\n\nexpected_delivery_date: In ISO format (e.g., 2025-03-27)\n\nlines: A list of objects with sku and quantity for each order line\n\nReturn your output strictly as a valid JSON object using the format below."
|
||||
},
|
||||
"promptType": "define",
|
||||
"hasOutputParser": true
|
||||
},
|
||||
"typeVersion": 1.8
|
||||
},
|
||||
{
|
||||
"id": "e9cb7bb1-40e7-463e-8b3f-417602338e5c",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
-520,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"model": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gpt-4o-mini"
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "468bdb39-223f-4bae-8bdb-a72272ab57c3",
|
||||
"name": "Structured Output Parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
|
||||
"position": [
|
||||
-180,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"jsonSchemaExample": "{\n \"purchase_order\": \"PO45231\",\n \"expected_delivery_date\": \"2025-03-27\",\n \"lines\": [\n { \"sku\": \"HERM-SHOE-001\", \"quantity\": 120 },\n { \"sku\": \"HERM-BAG-032\", \"quantity\": 45 },\n { \"sku\": \"HERM-WATCH-105\", \"quantity\": 30 },\n { \"sku\": \"HERM-SCARF-018\", \"quantity\": 80 }\n ]\n}\n"
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "667a8d43-1ce5-4ec8-871a-26007356a89e",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1000,
|
||||
-460
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 380,
|
||||
"height": 720,
|
||||
"content": "### 1. Workflow Trigger with Gmail Trigger\nThe workflow is triggered by a new email received in your Gmail mailbox. \nIf the subject includes the string \"Inbound Order\" we proceed, if not we do nothing.\n\n#### How to setup?\n- **Gmail Trigger Node:** set up your Gmail API credentials\n[Learn more about the Gmail Trigger Node](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.gmailtrigger)\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "e1e2d95a-9bbd-4bd5-92ec-7a4835db21a2",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-600,
|
||||
-460
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 660,
|
||||
"height": 720,
|
||||
"content": "### 2. AI Agent equipped with the query tool\nThe email body and subject are sent to the AI agent for parsing. The results include the **PO Number**, **expected delivery date** and all the order lines with **SKU ID** and **order quantity**. Outputs are formatted by the code node to fit in a Google Sheet.\n\n#### How to setup?\n- **AI Agent with the Chat Model**:\n 1. Add a **chat model** with the required credentials *(Example: Open AI 4o-mini)*\n 2. Adapt the system prompt to the format of your emails\n [Learn more about the AI Agent Node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "53375c17-a36c-431e-9ba6-07a9a84fc4c9",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
80,
|
||||
-460
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 460,
|
||||
"height": 540,
|
||||
"content": "### 3. Store the orderlines in a Google Sheet\nThe table generated by the **code node** includes all the order lines with the **PO Number** and the **expected delivery date**. This **Google Sheet Node** loads the content in a Google Sheet.\n\n#### How to setup?\n- **Add Results in Google Sheets**:\n 1. Add your Google Sheet API credentials to access the Google Sheet file\n 2. Select the file using the list, an URL or an ID\n 3. Select the sheet in which the vocabulary list is stored\n 4. Create the columns: **PO_NUMBER, EXPECTED_DELIVERY DATE, SKU_ID, QUANTITY**\n [Learn more about the Google Sheet Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googlesheets)"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "776cfc0e-264b-44cc-b534-dc387b0c9fce",
|
||||
"name": "Store Purchase Order Lines",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
180,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"columns": {
|
||||
"value": {
|
||||
"SKU_ID": "={{ $json.sku }}",
|
||||
"QUANTITY": "={{ $json.quantity }}",
|
||||
"PO_NUMBER": "={{ $json.purchase_order }}",
|
||||
"EXPECTED_DELIVERY DATE": "={{ $json.expected_delivery_date }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "PO_NUMBER",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "PO_NUMBER",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "EXPECTED_DELIVERY DATE",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "EXPECTED_DELIVERY DATE",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "SKU_ID",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "SKU_ID",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "QUANTITY",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "QUANTITY",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
},
|
||||
"options": {},
|
||||
"operation": "append",
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "=",
|
||||
"cachedResultName": "="
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1HnaJJ-DqzqgWJo2YwQDcgB6BgWiU6eMlnGvv4kapubg",
|
||||
"cachedResultUrl": "=",
|
||||
"cachedResultName": "="
|
||||
}
|
||||
},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "d5c52625-fef2-47a9-b2a4-bf005d8b9e05",
|
||||
"name": "Email Received",
|
||||
"type": "n8n-nodes-base.gmailTrigger",
|
||||
"position": [
|
||||
-980,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"simple": false,
|
||||
"filters": {},
|
||||
"options": {},
|
||||
"pollTimes": {
|
||||
"item": [
|
||||
{
|
||||
"mode": "everyMinute"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "6dc9e5cc-9ab3-469c-ad93-e0e7817ccbf7",
|
||||
"name": "Is PO?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
-760,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "f300ae2b-5de4-4efc-88ae-130a957588cb",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "contains"
|
||||
},
|
||||
"leftValue": "={{ $json.subject }}",
|
||||
"rightValue": "Inbound Order"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "385db736-0867-46b9-9274-380e7c255fc4",
|
||||
"name": "Format Purchase Order Lines",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"position": [
|
||||
-120,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"jsCode": "const {purchase_order, expected_delivery_date, lines} = $input.first().json.output;\n\nreturn lines.map( line => ({\n json: {\n purchase_order,\n expected_delivery_date,\n sku: line.sku,\n quantity: line.quantity\n }\n}))\n"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "b2e39591-70be-4d7f-a5d4-1505741d6310",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1000,
|
||||
320
|
||||
],
|
||||
"parameters": {
|
||||
"width": 780,
|
||||
"height": 720,
|
||||
"content": "### Test the workflow with this email!\n\n#### How?\n1. Send this email to the Gmail box you set up in your credentials.\n2. Click on Test workflow\n\n### Email\n**Email Subject:** Inbound Order PO45231 – Expected Delivery on 2025-03-27\n\n**Email Body:** \nDear LogiGreen Team,\n\nPlease find below the details of the upcoming inbound order.\n\nPurchase Order: PO45231\nExpected Delivery Date: 27/03/2025\n\nOrder Lines:\n\nSKU: HERM-SHOE-001 — Qty: 120\n\nSKU: HERM-BAG-032 — Qty: 45\n\nSKU: HERM-WATCH-105 — Qty: 30\n\nSKU: HERM-SCARF-018 — Qty: 80\n\nLet us know if you need any additional details.\n\nBest regards,\nSophie Lambert\nAdmin Assistant – Hermas Logistics\n📞 +33 1 23 45 67 89 78 84\n✉️ sophie.lambert@hermas.com\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Is PO?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"AI Agent": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Format Purchase Order Lines",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Email Received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Is PO?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Structured Output Parser": {
|
||||
"ai_outputParser": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_outputParser",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Format Purchase Order Lines": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Store Purchase Order Lines",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "9a8d7d07-a1b3-4bca-8e77-10da3a2abc45",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"position": [
|
||||
-160,
|
||||
0
|
||||
],
|
||||
"webhookId": "7f35a3a8-54c3-49d7-879d-6c3429f0e5da",
|
||||
"parameters": {
|
||||
"path": "retell-dynamic-variables",
|
||||
"options": {
|
||||
"ipWhitelist": "100.20.5.228"
|
||||
},
|
||||
"httpMethod": "POST",
|
||||
"responseMode": "responseNode"
|
||||
},
|
||||
"typeVersion": 2
|
||||
},
|
||||
{
|
||||
"id": "79e77d72-6e13-428c-ad10-58e6930e2d90",
|
||||
"name": "Respond to Webhook",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"position": [
|
||||
440,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"respondWith": "json",
|
||||
"responseBody": "={\n \"call_inbound\": {\n \"dynamic_variables\": {\n \"first_name\": \"{{ $json['First Name'] }}\",\n \"last_name\": \"{{ $json['Last name'] }}\",\n \"email\": \"{{ $json['E-Mail'] }}\",\n \"variable_1\": \"{{ $json['User Variable 1'] }}\",\n \"variable_2\": \"{{ $json['User Variable 2']}}\"\n },\n \"metadata\": {\n }\n }\n}"
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "10919781-9750-417f-bba6-293bf99dbc3e",
|
||||
"name": "Get user in DB by Phone Number",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
140,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"filtersUI": {
|
||||
"values": [
|
||||
{
|
||||
"lookupValue": "={{ $json.body.call_inbound.from_number }}",
|
||||
"lookupColumn": "Phone Number"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1TYgk8PK5w2l8Q5NtepdyLvgtuHXBHcODy-2hXOPP6AU/edit#gid=0",
|
||||
"cachedResultName": "Users"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1TYgk8PK5w2l8Q5NtepdyLvgtuHXBHcODy-2hXOPP6AU",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1TYgk8PK5w2l8Q5NtepdyLvgtuHXBHcODy-2hXOPP6AU/edit?usp=drivesdk",
|
||||
"cachedResultName": "Retell sample UserDB"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "ufBkeygvc1l17m5N",
|
||||
"name": "Baptiste AS - Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "de9a2ff5-690e-4e1e-ab5c-5a8825986871",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-880,
|
||||
-440
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 601,
|
||||
"height": 1105,
|
||||
"content": "## Handle Retell's Inbound call webhooks\n\n## Overview\n- This workflow provides Retell agent builders with a simple way to populate [dynamic variables](https://docs.retellai.com/build/dynamic-variables) using n8n.\n- The workflow fetches user information from a Google Sheet based on the phone number and sends it back to Retell.\n- It is based on Retell's [Inbound Webhook Call](https://docs.retellai.com/features/inbound-call-webhook).\n- Retell is a service that lets you create Voice Agents that handle voice calls simply, based on a prompt or using a conversational flow builder.\n\n## Prerequisites\n- Have a [Retell AI Account](https://www.retellai.com/)\n- [Create a Retell agent](https://docs.retellai.com/get-started/quick-start)\n- [Purchase a phone number](https://docs.retellai.com/deploy/purchase-number) and associate it with your agent\n- Create a Google Sheets - for example, [make a copy of this one](https://docs.google.com/spreadsheets/d/1TYgk8PK5w2l8Q5NtepdyLvgtuHXBHcODy-2hXOPP6AU/edit?usp=sharing).\n- Your Google Sheet must have at least one column with the phone number. The remaining columns will be used to populate your Retell agent’s dynamic variables.\n- All fields are returned as strings to Retell (variables are replaced as text)\n\n## How it works\n- The webhook call is received from Retell. We filter the call using their whitelisted IP address.\n- It extracts data from the webhook call and uses it to retrieve the user from Google Sheets.\n- It formats the data in the response to match Retell's expected format.\n- Retell uses this data to replace [dynamic variables](https://docs.retellai.com/build/dynamic-variables#dynamic-variables) in the prompts.\n\n\n## How to use it\nSee the description for screenshots!\n- Set the webhook name (keep it as POST).\n- Copy the Webhook URL (e.g., `https://your-instance.app.n8n.cloud/webhook/retell-dynamic-variables`) and paste it into Retell's interface. Navigate to \"Phone Numbers\", click on the phone number, and enable \"Add an inbound webhook\".\n- In your prompt (e.g., \"welcome message\"), use the variable with this syntax: `{{variable_name}}` (see [Retell's documentation](https://docs.retellai.com/build/dynamic-variables)).\n- These variables will be dynamically replaced by the data in your Google Sheet.\n\n\n## Notes\n- In Google Sheets, the phone number must start with `'+'`.\n- Phone numbers must be formatted like the example: with the `+`, extension, and no spaces.\n- You can use any database—just replace Google Sheets with your own, making sure to keep the phone number formatting consistent.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "55b087bf-d51f-4660-94c7-3742915ff79b",
|
||||
"name": "Sticky Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-220,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 220,
|
||||
"height": 300,
|
||||
"content": "Change the path if needed"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "bd6a7c81-5125-4f46-a1ba-86029d3a0eda",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
80,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 220,
|
||||
"height": 300,
|
||||
"content": "Replace with your own Google Sheets, including the dynamic variables of your Retell Agent"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "7105c832-ffbe-4d36-90ec-b8c868388c4e",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
380,
|
||||
-120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 5,
|
||||
"width": 220,
|
||||
"height": 300,
|
||||
"content": "Adapt the response to match your Retell dynamic variables"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get user in DB by Phone Number",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get user in DB by Phone Number": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Respond to Webhook",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,647 @@
|
||||
{
|
||||
"meta": {
|
||||
"instanceId": "5e2cdd86a9e1ca2fc82cc63db38d1710d5d6a5c6fe352258a6f7112815bcd512"
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"id": "13188ea7-7e66-4955-89d0-82ba4dc08dc9",
|
||||
"name": "Search For Folder",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
-2420,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"filter": {
|
||||
"folderId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $json.id }}"
|
||||
}
|
||||
},
|
||||
"options": {},
|
||||
"resource": "fileFolder",
|
||||
"queryString": "={{$json.folderName}}"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "VypmUgEf64twpmiZ",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "ed2ababb-7022-43e1-b638-0132c08ef701",
|
||||
"name": "Create Month Folder",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
-2060,
|
||||
680
|
||||
],
|
||||
"parameters": {
|
||||
"name": "={{ $('YYYY/MM').first().json.folderName }}",
|
||||
"driveId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "My Drive"
|
||||
},
|
||||
"options": {},
|
||||
"folderId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $('YYYY/MM').item.json.id }}"
|
||||
},
|
||||
"resource": "folder"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "VypmUgEf64twpmiZ",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "f5f2365d-0977-48b1-bd2e-29b7707839d9",
|
||||
"name": "Check If Folder Exists",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
-2240,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "09b62415-cb8f-478e-b6d3-aa463fe70c81",
|
||||
"operator": {
|
||||
"type": "object",
|
||||
"operation": "notEmpty",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ $json }}",
|
||||
"rightValue": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "c27b0a9d-8ee2-4eae-963c-14256ffae0b8",
|
||||
"name": "Gmail Trigger",
|
||||
"type": "n8n-nodes-base.gmailTrigger",
|
||||
"position": [
|
||||
-4400,
|
||||
780
|
||||
],
|
||||
"parameters": {
|
||||
"simple": false,
|
||||
"filters": {
|
||||
"labelIds": [
|
||||
"Label_2"
|
||||
]
|
||||
},
|
||||
"options": {},
|
||||
"pollTimes": {
|
||||
"item": [
|
||||
{
|
||||
"mode": "everyX",
|
||||
"unit": "minutes",
|
||||
"value": 15
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"gmailOAuth2": {
|
||||
"id": "HI2iZSvhvC5XOdpp",
|
||||
"name": "Gmail account 2"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "3eac8c53-1b20-4511-9f2a-f5e838ca0fa0",
|
||||
"name": "Gmail",
|
||||
"type": "n8n-nodes-base.gmail",
|
||||
"position": [
|
||||
-1720,
|
||||
460
|
||||
],
|
||||
"webhookId": "e62ae049-d968-4e6a-a62d-06963c8e592f",
|
||||
"parameters": {
|
||||
"simple": false,
|
||||
"options": {
|
||||
"downloadAttachments": true
|
||||
},
|
||||
"messageId": "={{ $('Gmail Trigger').item.json.id }}",
|
||||
"operation": "get"
|
||||
},
|
||||
"credentials": {
|
||||
"gmailOAuth2": {
|
||||
"id": "HI2iZSvhvC5XOdpp",
|
||||
"name": "Gmail account 2"
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.1
|
||||
},
|
||||
{
|
||||
"id": "bfae9bb5-6915-4968-8b5e-e72dd46bda55",
|
||||
"name": "Split Up Binary Data1",
|
||||
"type": "n8n-nodes-base.function",
|
||||
"position": [
|
||||
-1560,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"functionCode": "let results = [];\n\nfor (item of items) {\n for (key of Object.keys(item.binary)) {\n results.push({\n json: {\n fileName: item.binary[key].fileName\n },\n binary: {\n data: item.binary[key],\n }\n });\n }\n}\n\nreturn results;"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "baf55ab9-511f-4404-a2cc-b1c848f6f5c5",
|
||||
"name": "Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-1800,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 920,
|
||||
"height": 660,
|
||||
"content": "## Upload attachments to Drive\nIncoming files are split up into individual items, each with a single binary data object under the `data` key.\nFiles names are prefixed with the current timestamp"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "5d706d3a-db17-4f5f-9eac-ba91c470dbdd",
|
||||
"name": "YYYY/MM",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
-2600,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "143b3b94-a8d7-46b6-8ea8-2e70c082f5b1",
|
||||
"name": "=folderName",
|
||||
"type": "string",
|
||||
"value": "={{\n new Date($('Gmail Trigger').item.json.date).getUTCFullYear() \n + '/' + \n String(new Date($('Gmail Trigger').item.json.date).getUTCMonth() + 1).padStart(2, '0')\n}}\n"
|
||||
}
|
||||
]
|
||||
},
|
||||
"includeOtherFields": true
|
||||
},
|
||||
"typeVersion": 3.4
|
||||
},
|
||||
{
|
||||
"id": "b20a3833-f648-454d-999b-d799727e18e8",
|
||||
"name": "Loop Over Items",
|
||||
"type": "n8n-nodes-base.splitInBatches",
|
||||
"position": [
|
||||
-1320,
|
||||
460
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "bb8c0d21-de74-4abf-bf6c-5eef3f301513",
|
||||
"name": "Note3",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-2680,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 820,
|
||||
"height": 660,
|
||||
"content": "# Checks if YYYY/MM Folder exists\n## If the directory doesn't exist it is created"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "40971ca3-91d3-4651-8137-e973dbd2dbbd",
|
||||
"name": "Company Folder Exists",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
-3180,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"conditions": {
|
||||
"options": {
|
||||
"version": 2,
|
||||
"leftValue": "",
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict"
|
||||
},
|
||||
"combinator": "and",
|
||||
"conditions": [
|
||||
{
|
||||
"id": "09b62415-cb8f-478e-b6d3-aa463fe70c81",
|
||||
"operator": {
|
||||
"type": "object",
|
||||
"operation": "notEmpty",
|
||||
"singleValue": true
|
||||
},
|
||||
"leftValue": "={{ $json }}",
|
||||
"rightValue": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 2.2
|
||||
},
|
||||
{
|
||||
"id": "086ff643-ca10-46ec-92b5-8a014fd3bf3f",
|
||||
"name": "Create Company Folder",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
-2920,
|
||||
620
|
||||
],
|
||||
"parameters": {
|
||||
"name": "={{ $('Lookup in Sheets').item.json.company }}",
|
||||
"driveId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "My Drive"
|
||||
},
|
||||
"options": {},
|
||||
"folderId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "18ry0AUtrpp3re6u3zQvvs0BQUGFmBKN9",
|
||||
"cachedResultUrl": "https://drive.google.com/drive/folders/18ry0AUtrpp3re6u3zQvvs0BQUGFmBKN9",
|
||||
"cachedResultName": "Invoices"
|
||||
},
|
||||
"resource": "folder"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "VypmUgEf64twpmiZ",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
},
|
||||
{
|
||||
"id": "7792afb7-61d9-402f-814b-f4625cd012bc",
|
||||
"name": "Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-3500,
|
||||
120
|
||||
],
|
||||
"parameters": {
|
||||
"color": 7,
|
||||
"width": 760,
|
||||
"height": 820,
|
||||
"content": "# Checks if a folder with the company of the email exists\n## If it doesn't the directory is created"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "1f61ea45-49e6-4018-91ad-2144c1bbc19a",
|
||||
"name": "Sticky Note4",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-4120,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 560,
|
||||
"height": 660,
|
||||
"content": "# 2. Google Sheets Whitelist Config\n\n## To filter contacts against a whitelist:\n### 1. Make a copy of [this spreadsheet](https://docs.google.com/spreadsheets/d/1tTz9BflstxVL18YG11Ny1eiDj3FcjvtZ619b_bHx8h4/edit?usp=sharing)\n**OR** create a Google Sheet with two columns:\n| **email** | **company** |\n\n\n### 2. Add whitelisted emails and their company as rows in the sheet and configure this node **Document** and **Sheet** to point to it.\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "f7009cc2-8194-40c9-98e9-edc4a29c5ce8",
|
||||
"name": "Lookup in Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
-3900,
|
||||
780
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"filtersUI": {
|
||||
"values": [
|
||||
{
|
||||
"lookupValue": "={{ $('Gmail Trigger').item.json.from.value[0].address }}",
|
||||
"lookupColumn": "email"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gZE7EbLJqfMzQlPoCgE0eeqee_F1Lh9eIwhHsVmYKdw/edit#gid=0",
|
||||
"cachedResultName": "Sheet1"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1gZE7EbLJqfMzQlPoCgE0eeqee_F1Lh9eIwhHsVmYKdw",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gZE7EbLJqfMzQlPoCgE0eeqee_F1Lh9eIwhHsVmYKdw/edit?usp=drivesdk",
|
||||
"cachedResultName": "Contacts Whitelist"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "63dUs6P8a2b5ed5J",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5,
|
||||
"alwaysOutputData": false
|
||||
},
|
||||
{
|
||||
"id": "932afe12-3341-4f77-88ab-0b558e0d6ee2",
|
||||
"name": "Search Company Folder1",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
-3440,
|
||||
500
|
||||
],
|
||||
"parameters": {
|
||||
"filter": {
|
||||
"whatToSearch": "folders"
|
||||
},
|
||||
"options": {},
|
||||
"resource": "fileFolder",
|
||||
"queryString": "={{ $('Lookup in Sheets').item.json.company }}"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "VypmUgEf64twpmiZ",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3,
|
||||
"alwaysOutputData": true
|
||||
},
|
||||
{
|
||||
"id": "b9e66cf4-365a-4d11-bff9-48bf28be9e96",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-4740,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"width": 560,
|
||||
"height": 660,
|
||||
"content": "# 1. Trigger Settings and Filters\n\n## Configure the interval to check for new emails and apply filters to process only some emails\n\n**For example**: To create a filter that applies a label to emails **with attachments** containing the words \"invoice\" or \"receipt,\" follow these steps:\n\n1. Open your Gmail and click on the burger menu button next to the search bar to open the search options.\n2. In the `Has the words` field type in 'invoice receipt'\n3. Check the `Has attachment` checkbox\n4. Click on the \"Create filter with this search\" option at the bottom of the search window.\n5. In the filter options, select the \"Apply the label\" option and choose or create a label for these emails.\n6. Click \"Create filter\" to save your new filter.\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "2a932450-d0e9-44b4-adfb-2254b8e6e547",
|
||||
"name": "Sticky Note2",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-3000,
|
||||
220
|
||||
],
|
||||
"parameters": {
|
||||
"color": 6,
|
||||
"height": 540,
|
||||
"content": "# 3. Configure storage location\n## Set where to store files from the `parent folder` dropdown"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "247e4ed7-ebff-4392-adf2-4a63e80e04f4",
|
||||
"name": "Upload To Folder",
|
||||
"type": "n8n-nodes-base.googleDrive",
|
||||
"position": [
|
||||
-1100,
|
||||
480
|
||||
],
|
||||
"parameters": {
|
||||
"name": "={{ Date.now();}}-{{ $('Loop Over Items').item.binary.data.fileName }} ",
|
||||
"driveId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "My Drive",
|
||||
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
|
||||
"cachedResultName": "My Drive"
|
||||
},
|
||||
"options": {
|
||||
"ocrLanguage": "en",
|
||||
"propertiesUi": {
|
||||
"propertyValues": [
|
||||
{
|
||||
"key": "sender",
|
||||
"value": "={{ $('Gmail').item.json.from.value[0].address }}"
|
||||
},
|
||||
{
|
||||
"key": "time_received",
|
||||
"value": "={{ $('Gmail').item.json.date }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"folderId": {
|
||||
"__rl": true,
|
||||
"mode": "id",
|
||||
"value": "={{ $('Search For Folder').first().json.id || $('Create Month Folder').item.json.id }}"
|
||||
},
|
||||
"inputDataFieldName": "=data"
|
||||
},
|
||||
"credentials": {
|
||||
"googleDriveOAuth2Api": {
|
||||
"id": "VypmUgEf64twpmiZ",
|
||||
"name": "Google Drive account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 3
|
||||
}
|
||||
],
|
||||
"pinData": {},
|
||||
"connections": {
|
||||
"Gmail": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Split Up Binary Data1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"YYYY/MM": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Search For Folder",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Gmail Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Lookup in Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Loop Over Items": {
|
||||
"main": [
|
||||
[],
|
||||
[
|
||||
{
|
||||
"node": "Upload To Folder",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Lookup in Sheets": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Search Company Folder1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Upload To Folder": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Search For Folder": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Check If Folder Exists",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create Month Folder": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Gmail",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Company Folder Exists": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "YYYY/MM",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Create Company Folder",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Create Company Folder": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "YYYY/MM",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Split Up Binary Data1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Loop Over Items",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Check If Folder Exists": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Gmail",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Create Month Folder",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Search Company Folder1": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Company Folder Exists",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Typeform Trigger",
|
||||
"type": "n8n-nodes-base.typeformTrigger",
|
||||
"position": [
|
||||
450,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"formId": "UXuY0A"
|
||||
},
|
||||
"credentials": {
|
||||
"typeformApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "IF",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
850,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"number": [
|
||||
{
|
||||
"value1": "={{$node[\"Google Sheets\"].data[\"Severity\"]}}",
|
||||
"value2": 7,
|
||||
"operation": "larger"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
650,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"range": "Problems!A:D",
|
||||
"sheetId": "17fzSFl1BZ1njldTfp5lvh8HtS0-pNXH66b7qGZIiGRU",
|
||||
"operation": "append"
|
||||
},
|
||||
"credentials": {
|
||||
"googleApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Send Email",
|
||||
"type": "n8n-nodes-base.emailSend",
|
||||
"position": [
|
||||
1050,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Email: {{$node[\"IF\"].data[\"Email\"]}}\nName: {{$node[\"IF\"].data[\"Name\"]}}\nSeverity: {{$node[\"IF\"].data[\"Severity\"]}}\n\nProblem:\n{{$node[\"IF\"].data[\"Problem\"]}}",
|
||||
"subject": "User Reported Problem",
|
||||
"toEmail": "",
|
||||
"fromEmail": ""
|
||||
},
|
||||
"credentials": {
|
||||
"smtp": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Slack",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
1050,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Email: {{$node[\"IF\"].data[\"Email\"]}}\nName: {{$node[\"IF\"].data[\"Name\"]}}\nSeverity: {{$node[\"IF\"].data[\"Severity\"]}}\n\nProblem:\n{{$node[\"IF\"].data[\"Problem\"]}}",
|
||||
"channel": "problems",
|
||||
"attachments": [],
|
||||
"otherOptions": {}
|
||||
},
|
||||
"credentials": {
|
||||
"slackApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"IF": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Slack",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Send Email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Sheets": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "IF",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Typeform Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Typeform Trigger",
|
||||
"type": "n8n-nodes-base.typeformTrigger",
|
||||
"position": [
|
||||
450,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"formId": "UXuY0A"
|
||||
},
|
||||
"credentials": {
|
||||
"typeformApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "IF",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
850,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"number": [
|
||||
{
|
||||
"value1": "={{$node[\"Google Sheets\"].data[\"Severity\"]}}",
|
||||
"value2": 7,
|
||||
"operation": "larger"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
650,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"range": "Problems!A:D",
|
||||
"sheetId": "17fzSFl1BZ1njldTfp5lvh8HtS0-pNXH66b7qGZIiGRU",
|
||||
"operation": "append"
|
||||
},
|
||||
"credentials": {
|
||||
"googleApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Send Email",
|
||||
"type": "n8n-nodes-base.emailSend",
|
||||
"position": [
|
||||
1050,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Email: {{$node[\"IF\"].data[\"Email\"]}}\nName: {{$node[\"IF\"].data[\"Name\"]}}\nSeverity: {{$node[\"IF\"].data[\"Severity\"]}}\n\nProblem:\n{{$node[\"IF\"].data[\"Problem\"]}}",
|
||||
"subject": "User Reported Problem",
|
||||
"toEmail": "",
|
||||
"fromEmail": ""
|
||||
},
|
||||
"credentials": {
|
||||
"smtp": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Slack",
|
||||
"type": "n8n-nodes-base.slack",
|
||||
"position": [
|
||||
1050,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=Email: {{$node[\"IF\"].data[\"Email\"]}}\nName: {{$node[\"IF\"].data[\"Name\"]}}\nSeverity: {{$node[\"IF\"].data[\"Severity\"]}}\n\nProblem:\n{{$node[\"IF\"].data[\"Problem\"]}}",
|
||||
"channel": "problems",
|
||||
"attachments": [],
|
||||
"otherOptions": {}
|
||||
},
|
||||
"credentials": {
|
||||
"slackApi": ""
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"IF": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Slack",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "Send Email",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Google Sheets": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "IF",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Typeform Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"id": 4,
|
||||
"name": "Save Telegram reply to journal spreadsheet",
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Add entry to sheet",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
700,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"sheetId": "YOUR_SPREADSHEET_ID",
|
||||
"operation": "append"
|
||||
},
|
||||
"credentials": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Get journal reply",
|
||||
"type": "n8n-nodes-base.telegramTrigger",
|
||||
"position": [
|
||||
220,
|
||||
240
|
||||
],
|
||||
"webhookId": "fe4a6042-d343-4a02-b443-6d32c38e094d",
|
||||
"parameters": {
|
||||
"updates": [
|
||||
"message"
|
||||
],
|
||||
"additionalFields": {}
|
||||
},
|
||||
"credentials": {},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Parse message",
|
||||
"type": "n8n-nodes-base.functionItem",
|
||||
"position": [
|
||||
460,
|
||||
240
|
||||
],
|
||||
"parameters": {
|
||||
"functionCode": "// When telgram sees a message it will make sure its a reply to its message and from the user. \n// If thats the case then it will return {entry: string, date: string}\n\nconst botUsername = 'BOT_USERNAME'\nconst user = 'YOUR_USERNAME'\n\nconst res = item.message\n\nconst isReplyToBot = res.reply_to_message.from.username === botUsername\nconst isFromUser = res.from.username === user\n\n// This assumes your message is formatted as follows: \"SOME CUSTOM MESSAGE: YYYY-MM-DD\"\nconst date = res.reply_to_message.text.split(':')[1].replace(/\\s/g, '');\n\nconst journalEntry = res.text\n\nif (isReplyToBot && isFromUser) {\n return {entry: journalEntry, date}\n}\n\nreturn undefined;"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"settings": {},
|
||||
"connections": {
|
||||
"Parse message": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Add entry to sheet",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get journal reply": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Parse message",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Read Sheet",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
700,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"range": "Data!A:G",
|
||||
"rawData": true
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Cron",
|
||||
"type": "n8n-nodes-base.cron",
|
||||
"position": [
|
||||
500,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"triggerTimes": {
|
||||
"item": [
|
||||
{
|
||||
"mode": "custom",
|
||||
"cronExpression": "0 */2 * * * *"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Write Sheet 2",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
900,
|
||||
400
|
||||
],
|
||||
"parameters": {
|
||||
"range": "={{$node[\"Read Sheet\"].parameter[\"range\"]}}",
|
||||
"rawData": true,
|
||||
"operation": "update"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Write Sheet 1",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
900,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"range": "={{$node[\"Read Sheet\"].parameter[\"range\"]}}",
|
||||
"rawData": true,
|
||||
"operation": "update"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Cron": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Read Sheet",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Read Sheet": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Write Sheet 2",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
},
|
||||
{
|
||||
"node": "Write Sheet 1",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
188
workflows/Googlesheets/1153_GoogleSheets_Orbit_Automation.json
Normal file
188
workflows/Googlesheets/1153_GoogleSheets_Orbit_Automation.json
Normal file
@@ -0,0 +1,188 @@
|
||||
{
|
||||
"name": "Moving metrics from Google Sheets to Orbit",
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Merge",
|
||||
"type": "n8n-nodes-base.merge",
|
||||
"position": [
|
||||
1473,
|
||||
426
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "mergeByKey",
|
||||
"propertyName1": "GitHub Username",
|
||||
"propertyName2": "attributes.slug"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Add Members",
|
||||
"type": "n8n-nodes-base.orbit",
|
||||
"position": [
|
||||
1073,
|
||||
326
|
||||
],
|
||||
"parameters": {
|
||||
"operation": "upsert",
|
||||
"identityUi": {
|
||||
"identityValue": {
|
||||
"source": "github",
|
||||
"searchBy": "username",
|
||||
"username": "={{$json[\"GitHub\"]}}"
|
||||
}
|
||||
},
|
||||
"workspaceId": "543",
|
||||
"additionalFields": {
|
||||
"name": "={{$json[\"Name\"]}}",
|
||||
"tShirt": "={{$json[\"T-Shirt Size\"]}}",
|
||||
"location": "={{$json[\"Location\"]}}",
|
||||
"tagsToAdd": "={{$json[\"Tags\"]}}"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"orbitApi": "Orbit Credentials"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Get all members",
|
||||
"type": "n8n-nodes-base.orbit",
|
||||
"position": [
|
||||
1273,
|
||||
526
|
||||
],
|
||||
"parameters": {
|
||||
"options": {},
|
||||
"operation": "getAll",
|
||||
"returnAll": true,
|
||||
"workspaceId": "543"
|
||||
},
|
||||
"credentials": {
|
||||
"orbitApi": "Orbit Credentials"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Get Members",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
873,
|
||||
326
|
||||
],
|
||||
"parameters": {
|
||||
"range": "Members!A:F",
|
||||
"options": {},
|
||||
"sheetId": "1GiR5glinWBUJ-pw3w8LpcuwyOXst2z5nnFSak8DQrMQ",
|
||||
"authentication": "oAuth2"
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": "Google Sheets Credentials"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Get Activities",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
1273,
|
||||
326
|
||||
],
|
||||
"parameters": {
|
||||
"range": "Activities!A:D",
|
||||
"options": {
|
||||
"returnAllMatches": true
|
||||
},
|
||||
"sheetId": "={{$node[\"Get Members\"].parameter[\"sheetId\"]}}",
|
||||
"operation": "lookup",
|
||||
"lookupValue": "={{$node[\"Get Members\"].json[\"GitHub\"]}}",
|
||||
"lookupColumn": "GitHub Username",
|
||||
"authentication": "oAuth2"
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": "Google Sheets Credentials"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Add Activities",
|
||||
"type": "n8n-nodes-base.orbit",
|
||||
"position": [
|
||||
1673,
|
||||
426
|
||||
],
|
||||
"parameters": {
|
||||
"title": "={{$json[\"Title\"]}}",
|
||||
"memberId": "={{$json[\"id\"]}}",
|
||||
"resource": "activity",
|
||||
"workspaceId": "543",
|
||||
"additionalFields": {
|
||||
"link": "={{$json[\"Activity Link\"]}}",
|
||||
"description": "={{$node[\"Merge\"].json[\"Description\"]}}"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"orbitApi": "Orbit Credentials"
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"settings": {},
|
||||
"connections": {
|
||||
"Merge": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Add Activities",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Add Members": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Activities",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Members": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Add Members",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Activities": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get all members": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Merge",
|
||||
"type": "main",
|
||||
"index": 1
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
{
|
||||
"id": 90,
|
||||
"name": "Extract expenses from emails and add to Google Sheet",
|
||||
"nodes": [
|
||||
{
|
||||
"name": "Check subject",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"position": [
|
||||
800,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"string": [
|
||||
{
|
||||
"value1": "={{$json[\"subject\"].toLowerCase()}}",
|
||||
"value2": "=/{{$json[\"subjectPatterns\"].toLowerCase()}}/",
|
||||
"operation": "regex"
|
||||
}
|
||||
]
|
||||
},
|
||||
"combineOperation": "any"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Setup Variables",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
620,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"values": {
|
||||
"string": [
|
||||
{
|
||||
"name": "subjectPatterns",
|
||||
"value": "(expenses|reciept)"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Check for new emails",
|
||||
"type": "n8n-nodes-base.emailReadImap",
|
||||
"position": [
|
||||
440,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"format": "resolved",
|
||||
"mailbox": "Inbox",
|
||||
"options": {
|
||||
"allowUnauthorizedCerts": true
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"imap": {
|
||||
"id": "24",
|
||||
"name": "GMAIL"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Read Receipts",
|
||||
"type": "n8n-nodes-base.mindee",
|
||||
"position": [
|
||||
1020,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"binaryPropertyName": "attachment_0"
|
||||
},
|
||||
"credentials": {
|
||||
"mindeeReceiptApi": {
|
||||
"id": "61",
|
||||
"name": "Mindee Receipt account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Set column data",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"position": [
|
||||
1200,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"values": {
|
||||
"string": [
|
||||
{
|
||||
"name": "Date",
|
||||
"value": "={{$json[\"date\"]}}"
|
||||
},
|
||||
{
|
||||
"name": "Description",
|
||||
"value": "={{$node[\"Check for new emails\"].json[\"subject\"].split(\"-\")[1]}}"
|
||||
},
|
||||
{
|
||||
"name": "Category",
|
||||
"value": "={{$json[\"category\"]}}"
|
||||
},
|
||||
{
|
||||
"name": "Currency",
|
||||
"value": "={{$json[\"currency\"]}}"
|
||||
},
|
||||
{
|
||||
"name": "Amount",
|
||||
"value": "={{$json[\"total\"]}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"name": "Add to Google Sheet",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
1380,
|
||||
280
|
||||
],
|
||||
"parameters": {
|
||||
"range": "A:E",
|
||||
"options": {},
|
||||
"sheetId": "1xAtx1ORZYKu4urgqpOe3DawFjiWeOZO0VCVvOlQYnaE",
|
||||
"operation": "append",
|
||||
"authentication": "oAuth2"
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "8",
|
||||
"name": "Sheets"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"settings": {},
|
||||
"connections": {
|
||||
"Check subject": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Read Receipts",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Read Receipts": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set column data",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set column data": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Add to Google Sheet",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Setup Variables": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Check subject",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Check for new emails": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Setup Variables",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,376 @@
|
||||
{
|
||||
"id": "aLTkMiEDYXbMK4fT",
|
||||
"meta": {
|
||||
"instanceId": "5b860a91d7844b5237bb51cc58691ca8c3dc5b576f42d4d6bbedfb8d43d58ece",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "AI agent: expense tracker in Google Sheets and n8n chat",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "9260b53e-6848-4f34-9643-311c58c807f6",
|
||||
"name": "AI Agent",
|
||||
"type": "@n8n/n8n-nodes-langchain.agent",
|
||||
"position": [
|
||||
360,
|
||||
40
|
||||
],
|
||||
"parameters": {
|
||||
"options": {
|
||||
"maxIterations": 3,
|
||||
"systemMessage": "You are a helpful accountant. Use save to db tool to save expense message to DB. respond with \"Your expense saved, here is the output of save sub-workflow:[data]\""
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.7
|
||||
},
|
||||
{
|
||||
"id": "0d7a686c-42c2-4223-9f78-b454788fb6da",
|
||||
"name": "When chat message received",
|
||||
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
|
||||
"position": [
|
||||
0,
|
||||
40
|
||||
],
|
||||
"webhookId": "6a34ec84-459d-4cc4-83b6-06ae4c99dc8f",
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "f1f27aaf-cf13-40d9-b8f9-800a862f8bf0",
|
||||
"name": "Workflow Input Trigger",
|
||||
"type": "n8n-nodes-base.executeWorkflowTrigger",
|
||||
"position": [
|
||||
180,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"workflowInputs": {
|
||||
"values": [
|
||||
{
|
||||
"name": "input1"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "a1530601-1a91-45be-adef-2e0608bfe773",
|
||||
"name": "OpenAI Chat Model",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
340,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "vHFEeel4RHFsjcMI",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "c6f9782e-6b9b-421e-8b10-9ef04cbbee8c",
|
||||
"name": "Window Buffer Memory",
|
||||
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
|
||||
"position": [
|
||||
500,
|
||||
300
|
||||
],
|
||||
"parameters": {},
|
||||
"typeVersion": 1.3
|
||||
},
|
||||
{
|
||||
"id": "bbe1116a-1c66-496e-a9bf-747457e47bb0",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-760,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"width": 720,
|
||||
"height": 500,
|
||||
"content": "## Save your expenses via chat message. \n\nLLM will parse your message to structured JSON and save as a new row into Google Sheet.\n\n## Installation\n### 1. Set up Google Sheets:\nClone this Sheet:\nhttps://docs.google.com/spreadsheets/d/1D0r3tun7LF7Ypb21CmbTKEtn76WE-kaHvBCM5NdgiPU/edit?gid=0#gid=0\n\n(File -> Make a copy)\n\nChoose this sheet into \"Save expense into Google Sheets\" node.\n\n\n### 2. Fix sub-workflow dropdown: \nopen \"Parse msg and save to Sheets\" node (which is an n8n sub-workflow executor tool) and choose the SAME workflow in the dropdown. it will allow n8n to call \"Workflow Input Trigger\" properly when needed.\n\n\n### 3. Activate the workflow to make chat work properly.\nSent message to chat, something like \"car wash; 59.3 usd; 25 jan 2024\"\n\nyou should get a response:\nYour expense saved, here is the output of save sub-workflow:{\"cost\":59.3,\"descr\":\"car wash\",\"date\":\"2024-01-25\",\"msg\":\"car wash; 59.3 usd; 25 jan 2024\"}\n\nand new row in Google sheets should be inserted!"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "61a489f7-5b95-438a-81f0-1e3e8c445622",
|
||||
"name": "OpenAI Chat Model1",
|
||||
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
|
||||
"position": [
|
||||
400,
|
||||
900
|
||||
],
|
||||
"parameters": {
|
||||
"options": {}
|
||||
},
|
||||
"credentials": {
|
||||
"openAiApi": {
|
||||
"id": "vHFEeel4RHFsjcMI",
|
||||
"name": "OpenAi account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 1.1
|
||||
},
|
||||
{
|
||||
"id": "57908f61-ed9b-41a9-aba6-031bfc65bd31",
|
||||
"name": "Expense text to JSON parser",
|
||||
"type": "@n8n/n8n-nodes-langchain.informationExtractor",
|
||||
"position": [
|
||||
400,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"text": "=convert expense to JSON: \n\n{{ $json.input1 }}",
|
||||
"options": {},
|
||||
"attributes": {
|
||||
"attributes": [
|
||||
{
|
||||
"name": "cost",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "expense cost"
|
||||
},
|
||||
{
|
||||
"name": "descr",
|
||||
"required": true,
|
||||
"description": "description of expense"
|
||||
},
|
||||
{
|
||||
"name": "date",
|
||||
"type": "date",
|
||||
"description": "date in UTC format. "
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "23f123eb-c4d9-4e6c-a521-311498d40d61",
|
||||
"name": "Save expense into Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
760,
|
||||
600
|
||||
],
|
||||
"parameters": {
|
||||
"columns": {
|
||||
"value": {
|
||||
"msg": "={{ $('Workflow Input Trigger').item.json.input1 }}",
|
||||
"cost": "={{ $json.output.cost }}",
|
||||
"date": "={{ $json.output.date ? $json.output.date : $now }}",
|
||||
"descr": "={{ $json.output.descr }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "date",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "date",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "cost",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "cost",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "descr",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "descr",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "msg",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "msg",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
},
|
||||
"options": {
|
||||
"useAppend": true
|
||||
},
|
||||
"operation": "append",
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1_BMLmh5MtmQarWuZIJANQZSkjaQ2Rc3YYLhwyz1Sec0/edit#gid=0",
|
||||
"cachedResultName": "Sheet1"
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1_BMLmh5MtmQarWuZIJANQZSkjaQ2Rc3YYLhwyz1Sec0",
|
||||
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1_BMLmh5MtmQarWuZIJANQZSkjaQ2Rc3YYLhwyz1Sec0/edit?usp=drivesdk",
|
||||
"cachedResultName": "ai-expense"
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "vowsrhMIxy2PRDbH",
|
||||
"name": "Google Sheets account"
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "83770030-eab1-499a-b743-fe639e34fbb2",
|
||||
"name": "Parse msg and save to Sheets",
|
||||
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
|
||||
"notes": "Make sure that this SAME workflow is chosen in the Workflow dropdown!",
|
||||
"position": [
|
||||
660,
|
||||
300
|
||||
],
|
||||
"parameters": {
|
||||
"name": "save_expense_in_db",
|
||||
"workflowId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "aLTkMiEDYXbMK4fT",
|
||||
"cachedResultName": "sub-workflow1"
|
||||
},
|
||||
"description": "Call this tool to save expense in db.",
|
||||
"workflowInputs": {
|
||||
"value": {
|
||||
"input1": "={{ $json.chatInput }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "input1",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"removed": false,
|
||||
"required": false,
|
||||
"displayName": "input1",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
}
|
||||
},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 2
|
||||
}
|
||||
],
|
||||
"active": true,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "9ab1bbef-ffe8-462c-a201-920c6d250ade",
|
||||
"connections": {
|
||||
"OpenAI Chat Model": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"OpenAI Chat Model1": {
|
||||
"ai_languageModel": [
|
||||
[
|
||||
{
|
||||
"node": "Expense text to JSON parser",
|
||||
"type": "ai_languageModel",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Window Buffer Memory": {
|
||||
"ai_memory": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_memory",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Workflow Input Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Expense text to JSON parser",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"When chat message received": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Expense text to JSON parser": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Save expense into Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Parse msg and save to Sheets": {
|
||||
"ai_tool": [
|
||||
[
|
||||
{
|
||||
"node": "AI Agent",
|
||||
"type": "ai_tool",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
{
|
||||
"id": "dCLvOuZgc8tToQwu",
|
||||
"meta": {
|
||||
"instanceId": "14e4c77104722ab186539dfea5182e419aecc83d85963fe13f6de862c875ebfa",
|
||||
"templateCredsSetupCompleted": true
|
||||
},
|
||||
"name": "Add new incoming emails to a Google Sheets spreadsheet as a new row.",
|
||||
"tags": [],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "4db1f92f-6425-41c4-8f26-94e13ef5cd1f",
|
||||
"name": "Gmail Trigger",
|
||||
"type": "n8n-nodes-base.gmailTrigger",
|
||||
"notes": "Gmail Trigger\n",
|
||||
"position": [
|
||||
-200,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"filters": {},
|
||||
"pollTimes": {
|
||||
"item": [
|
||||
{
|
||||
"mode": "everyMinute"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"gmailOAuth2": {
|
||||
"id": "",
|
||||
"name": ""
|
||||
}
|
||||
},
|
||||
"notesInFlow": true,
|
||||
"typeVersion": 1.2
|
||||
},
|
||||
{
|
||||
"id": "77c70cbd-fca7-4925-9a47-e2c903b8a64e",
|
||||
"name": "Google Sheets",
|
||||
"type": "n8n-nodes-base.googleSheets",
|
||||
"position": [
|
||||
180,
|
||||
-20
|
||||
],
|
||||
"parameters": {
|
||||
"columns": {
|
||||
"value": {
|
||||
"body": "={{ $json.snippet }}",
|
||||
"Subject": "={{ $json.Subject }}",
|
||||
"Sender Email": "={{ $json.From }}"
|
||||
},
|
||||
"schema": [
|
||||
{
|
||||
"id": "Sender Email",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Sender Email",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "Subject",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "Subject",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
},
|
||||
{
|
||||
"id": "body",
|
||||
"type": "string",
|
||||
"display": true,
|
||||
"required": false,
|
||||
"displayName": "body",
|
||||
"defaultMatch": false,
|
||||
"canBeUsedToMatch": true
|
||||
}
|
||||
],
|
||||
"mappingMode": "defineBelow",
|
||||
"matchingColumns": [],
|
||||
"attemptToConvertTypes": false,
|
||||
"convertFieldsToString": false
|
||||
},
|
||||
"options": {},
|
||||
"operation": "append",
|
||||
"sheetName": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "gid=0",
|
||||
"cachedResultUrl": "",
|
||||
"cachedResultName": ""
|
||||
},
|
||||
"documentId": {
|
||||
"__rl": true,
|
||||
"mode": "list",
|
||||
"value": "1o28BFBtzzsnwN01VTcfRp2BUyAFi9e-91H_b920_gJc",
|
||||
"cachedResultUrl": "",
|
||||
"cachedResultName": ""
|
||||
}
|
||||
},
|
||||
"credentials": {
|
||||
"googleSheetsOAuth2Api": {
|
||||
"id": "",
|
||||
"name": ""
|
||||
}
|
||||
},
|
||||
"typeVersion": 4.5
|
||||
},
|
||||
{
|
||||
"id": "0bc68783-e959-40f7-8cc3-a8800e62029a",
|
||||
"name": "Sticky Note",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-260,
|
||||
-80
|
||||
],
|
||||
"parameters": {
|
||||
"color": 2,
|
||||
"width": 660,
|
||||
"height": 260,
|
||||
"content": "### Add new incoming emails to a Google Sheets spreadsheet as a new row.\n"
|
||||
},
|
||||
"typeVersion": 1
|
||||
},
|
||||
{
|
||||
"id": "90a94a4d-60fc-40d2-8b1e-1bf01c98d789",
|
||||
"name": "Sticky Note1",
|
||||
"type": "n8n-nodes-base.stickyNote",
|
||||
"position": [
|
||||
-260,
|
||||
200
|
||||
],
|
||||
"parameters": {
|
||||
"color": 2,
|
||||
"width": 660,
|
||||
"content": "## Description :\nThis n8n workflow automates the process of storing email details in a spreadsheet whenever a new email is received. It utilizes the Email Trigger node to detect incoming emails and then extracts the sender, subject, and email content, which are subsequently saved into a spreadsheet (e.g., Google Sheets or an Excel file). This ensures a structured record of emails for further processing, analysis, or reporting.\n\nYou can customize this workflow as per your requirements, such as adding additional columns in the spreadsheet to store more details or modifying it for different use cases, like lead tracking, customer inquiries, or automated email logging. "
|
||||
},
|
||||
"typeVersion": 1
|
||||
}
|
||||
],
|
||||
"active": false,
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"versionId": "d8ab2b16-b091-455b-ad43-8e117a49e297",
|
||||
"connections": {
|
||||
"Gmail Trigger": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Google Sheets",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user