{ "meta": { "instanceId": "a2434c94d549548a685cca39cc4614698e94f527bcea84eefa363f1037ae14cd" }, "nodes": [ { "id": "88c0f64c-a7cd-4f35-96dd-9eee4b1d6a1a", "name": "Generate reply", "type": "n8n-nodes-base.openAi", "position": [ -480, 2260 ], "parameters": { "prompt": "=From: {{ $json.from.value }}\nTo: {{ $json.to.value }}\nSubject: {{ $json.subject }}\nBody: {{ $json.reply }}\n\n\nReply: ", "options": { "maxTokens": "={{ $('Configure').first().json.replyTokenSize }}" } }, "credentials": { "openAiApi": { "id": "27", "name": "[UPDATE ME]" } }, "typeVersion": 1 }, { "id": "7105b689-9f9c-4354-aad9-8f1abb6c0a06", "name": "On email received", "type": "n8n-nodes-base.gmailTrigger", "position": [ -2460, 2680 ], "parameters": { "simple": false, "filters": {}, "options": {}, "pollTimes": { "item": [ { "mode": "everyMinute" } ] } }, "credentials": { "gmailOAuth2": { "id": "26", "name": "[UPDATE ME]" } }, "typeVersion": 1 }, { "id": "ea18ed9a-0158-45e1-ac1b-1993ace4ff2c", "name": "Only continue for specific emails", "type": "n8n-nodes-base.if", "position": [ -1360, 2460 ], "parameters": { "conditions": { "string": [ { "value1": "={{ $('Configure').first().json.recipients.split(',') }}", "value2": "*", "operation": "contains" }, { "value1": "={{ $('Configure').first().json.recipients.split(',') }}", "value2": "={{ $json.from.value[0].address }}", "operation": "contains" } ] }, "combineOperation": "any" }, "typeVersion": 1 }, { "id": "d1425dff-0fc1-4a4b-9202-418ce30d7cd9", "name": "Configure", "type": "n8n-nodes-base.set", "position": [ -1940, 2800 ], "parameters": { "values": { "number": [ { "name": "maxTokenSize", "value": 4000 }, { "name": "replyTokenSize", "value": 300 } ], "string": [ { "name": "spreadsheetId" }, { "name": "worksheetId" }, { "name": "spreadsheetName", "value": "ChatGPT responses" }, { "name": "worksheetName", "value": "Database" }, { "name": "recipients", "value": "[UPDATE ME]" } ] }, "options": {} }, "typeVersion": 1 }, { "id": "594f77e6-9e7e-4e93-b6e0-95fad57e42f0", "name": "Note5", "type": "n8n-nodes-base.stickyNote", "position": [ -2060, 2480 ], "parameters": { "width": 330.0279884670691, "height": 929.4540475960038, "content": "### Configuration\nIf you decide to use your own spreadsheet, it is up to you to ensure all columns are present before running this workflow. A good way to do this is to run this workflow once with **empty** `spreadsheetid` and `worksheetId` variables (see the `Configure` node). Then map the output from `Store spreadsheet ID` to this node.\n\nIt is recommended that you specify the `spreadsheetId` and `worksheetId`, since relying solely on a workflow's static data is considered bad practice.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n__`spreadsheetId`__: The ID of the spreadsheet where Pipedrive deals will be stored.\n__`worksheetId`__: The ID of the worksheet where Pipedrive deals will be stored.\n__`spreadsheetName`(required)__: The human readable name of the spreadsheet where Pipedrive deals will be stored.\n__`worksheetName`(required)__: The human readable name of the worksheet in the spreadsheet where Pipedrive deals will be stored.\n__`recipients`(required)__: Comma-separated list of email recipients to send ChatGPT emails to. Use `*` to send ChatGPT response to every email address.\n__`maxTokenSize`(required)__: The maximum token size for the model you choose. See possible models from OpenAI [here](https://platform.openai.com/docs/models/gpt-3).\n__`replyTokenSize`(required)__: The reply's maximum token size. Default is 300. This determines how much text the AI will reply with." }, "typeVersion": 1 }, { "id": "2dc3e403-f2a0-43c2-a1e4-187d901d692f", "name": "Send reply to recipient", "type": "n8n-nodes-base.gmail", "position": [ 360, 1860 ], "parameters": { "message": "={{ $json.html }}", "options": {}, "emailType": "html", "messageId": "={{ $node[\"On email received\"].json.id }}", "operation": "reply" }, "credentials": { "gmailOAuth2": { "id": "26", "name": "[UPDATE ME]" } }, "typeVersion": 2 }, { "id": "f845aa4d-5542-4126-a42d-4e5afa1893d1", "name": "Generate UUID", "type": "n8n-nodes-base.crypto", "position": [ -1140, 2360 ], "parameters": { "action": "generate", "dataPropertyName": "uuid" }, "typeVersion": 1 }, { "id": "3c468585-4546-439b-9e8a-efb7231277d8", "name": "Thanks for your response!", "type": "n8n-nodes-base.html", "position": [ -1140, 2980 ], "parameters": { "html": "\n\n\n
\n \n