Upload Google Reviews Automation.json
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718{ "name": "Google Reviews Automation", "nodes": [ { "parameters": { "pollTimes": { "item": [ { "mode": "everyMinute" } ] }, "account": { "__rl": true, "value": "accounts/112359161525876857659", "mode": "list", "cachedResultName": "mouad Mouad" }, "location": { "__rl": true, "value": "locations/8151693557096422588", "mode": "list", "cachedResultName": "locations/8151693557096422588" } }, "id": "e34a545e-1efc-4a22-be77-b31e5727beeb", "name": "Monitor New Reviews", "type": "n8n-nodes-base.googleBusinessProfileTrigger", "position": [ -2480, -112 ], "typeVersion": 1, "credentials": { "googleBusinessProfileOAuth2Api": { "id": "mHNIT5TeMvmdBkZH", "name": "Google Business Profile account" } } }, { "parameters": { "assignments": { "assignments": [ { "id": "1", "name": "reviewText", "type": "string", "value": "={{ $json.comment }}" }, { "id": "2", "name": "rating", "type": "number", "value": "={{ $json.starRating }}" }, { "id": "3", "name": "reviewerName", "type": "string", "value": "={{ $json.reviewer.displayName }}" }, { "id": "4", "name": "reviewId", "type": "string", "value": "={{ $json.reviewId }}" }, { "id": "5", "name": "reviewDate", "type": "string", "value": "={{ $json.createTime }}" } ] }, "options": { "ignoreConversionErrors": true } }, "id": "de9b6122-09b9-4057-bdc3-dfa17c626fa8", "name": "Extract Review Data", "type": "n8n-nodes-base.set", "position": [ -2256, -112 ], "typeVersion": 3.4 }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 2 }, "conditions": [ { "id": "check_negative", "operator": { "type": "string", "operation": "equals" }, "leftValue": "={{ $json.output.sentiment }}", "rightValue": "negative" } ], "combinator": "and" }, "options": {} }, "id": "55463ed4-31c6-4275-be06-aae65e2f5ecf", "name": "Is Negative Review?", "type": "n8n-nodes-base.if", "position": [ -1680, -112 ], "typeVersion": 2.2 }, { "parameters": { "authentication": "oAuth2", "operation": "sendAndWait", "select": "channel", "channelId": { "__rl": true, "value": "C09GSTTLTNG", "mode": "list", "cachedResultName": "errors-handling-tickets" }, "message": "=\n🚨 REVIEW APPROVAL NEEDED\n\nSummary : {{ $('Basic LLM Chain').item.json.output.summary }}\n\n⭐ Rating: {{ $('Monitor New Reviews').item.json.starRating }} ⭐\n👤 Customer: {{ $('Monitor New Reviews').item.json.reviewer.displayName }}\n\n📝 CUSTOMER REVIEW:\n{{ $('Monitor New Reviews').item.json.comment }}\n\n🤖 AI SUGGESTED REPLY:\n{{ $json.output.draftedReply }}\n---\nClick Approve to send this reply, or Decline to discard.\n\n", "approvalOptions": { "values": { "approvalType": "double" } }, "options": {} }, "id": "209f953a-7ee1-4d90-92b4-a301bcbd149a", "name": "Slack - Request Approval", "type": "n8n-nodes-base.slack", "typeVersion": 2.3, "position": [ -1456, -208 ], "webhookId": "7b495e67-7e9b-4603-940b-01f46f03a90c", "credentials": { "slackOAuth2Api": { "id": "fVclEXygO5u0nPia", "name": "Slack account" } } }, { "parameters": { "operation": "append", "documentId": { "__rl": true, "value": "1C0Jspcv2Xj9EiMOS3qCi5MUw-kugGLWZh8HDY3KtPDI", "mode": "list", "cachedResultName": "google_reviews_logging_template", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1C0Jspcv2Xj9EiMOS3qCi5MUw-kugGLWZh8HDY3KtPDI/edit?usp=drivesdk" }, "sheetName": { "__rl": true, "value": 544803624, "mode": "list", "cachedResultName": "google_reviews_logging_template.csv", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1C0Jspcv2Xj9EiMOS3qCi5MUw-kugGLWZh8HDY3KtPDI/edit#gid=544803624" }, "columns": { "mappingMode": "defineBelow", "value": { "ReviewDate": "={{ $('Extract Review Data').item.json.reviewDate }}", "ReviewID": "={{ $('Extract Review Data').item.json.reviewId }}", "Reviewer": "={{ $('Extract Review Data').item.json.reviewerName }}", "Rating": "={{ $('Extract Review Data').item.json.rating }}", "ReviewText": "={{ $('Extract Review Data').item.json.reviewText }}", "Sentiment": "={{ $('Basic LLM Chain').item.json.output.sentiment }}", "SentimentScore": "={{ $('Basic LLM Chain').item.json.output.sentimentScore }}", "AI-Reply": "={{ $('Basic LLM Chain').item.json.output.draftedReply }}", "FinalReply": "={{ $data.comment }}", "PostedToGoogle": "={{ $json.updateTime }}" }, "matchingColumns": [], "schema": [ { "id": "ReviewDate", "displayName": "ReviewDate", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "ReviewID", "displayName": "ReviewID", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "Reviewer", "displayName": "Reviewer", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "Rating", "displayName": "Rating", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "ReviewText", "displayName": "ReviewText", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "Sentiment", "displayName": "Sentiment", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "SentimentScore", "displayName": "SentimentScore", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "AI-Reply", "displayName": "AI-Reply", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "FinalReply", "displayName": "FinalReply", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false }, { "id": "PostedToGoogle", "displayName": "PostedToGoogle", "required": false, "defaultMatch": false, "display": true, "type": "string", "canBeUsedToMatch": true, "removed": false } ], "attemptToConvertTypes": false, "convertFieldsToString": false }, "options": {} }, "id": "9c820bfa-6cf2-4b7a-bd80-3baa6b357b52", "name": "Log to Google Sheets", "type": "n8n-nodes-base.googleSheets", "position": [ -560, -112 ], "typeVersion": 4.6, "credentials": { "googleSheetsOAuth2Api": { "id": "cqc0aG1cc1RyiagA", "name": "Google Sheets account" } } }, { "parameters": { "promptType": "define", "text": "=Analyze this customer review and provide a response:\n\nCUSTOMER NAME: {{ $json.reviewerName }}\nRATING: {{ $json.rating }}/5\nREVIEW TEXT: {{ $json.reviewText }}\n\nProvide your response as JSON with these exact fields:\n- sentiment: (string) \"positive\" or \"negative\" or \"neutral\"\n- sentimentScore: (number) 0-100 confidence percentage\n- draftedReply: (string) your professional response to the customer\n- summary: (string, only if sentiment is negative) brief 1-sentence summary of their complaint\n\nRespond ONLY with the JSON object. No markdown, no code blocks, just the JSON.", "hasOutputParser": true, "messages": { "messageValues": [ { "message": "=You are a professional customer service AI assistant. \n\nYour job is to: 1. Analyze the sentiment of a customer review \n\n2. Draft an appropriate professional reply based on the sentiment \n\n3. If the review is negative, provide a brief summary of the complaint \n\nYou must respond ONLY with valid JSON. No additional text. \n\nFor positive/neutral reviews: Be warm, grateful, and genuine. For negative reviews: Be empathetic, professional, and solution-focused. \n\nAll replies must be under 100 words." } ] }, "batching": {} }, "type": "@n8n/n8n-nodes-langchain.chainLlm", "typeVersion": 1.7, "position": [ -2032, -112 ], "id": "e25cc4bd-2c5b-439d-ad24-982b6004fcda", "name": "Basic LLM Chain" }, { "parameters": { "options": {} }, "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter", "typeVersion": 1, "position": [ -2048, 112 ], "id": "36a800f6-d19e-4106-a3ba-65e5ff637998", "name": "OpenRouter Chat Model", "credentials": { "openRouterApi": { "id": "Uh6EhUnlPGQ0AEYw", "name": "OpenRouter account" } } }, { "parameters": { "schemaType": "manual", "inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"sentiment\": {\n \"type\": \"string\",\n \"description\": \"positive, negative\"\n },\n \"sentimentScore\": {\n \"type\": \"number\",\n \"description\": \"0-100 confidence\"\n },\n \"draftedReply\": {\n \"type\": \"string\",\n \"description\": \"The reply text\"\n },\n \"summary\": {\n \"type\": \"string\",\n \"description\": \"Summary if negative\"\n }\n }\n}" }, "type": "@n8n/n8n-nodes-langchain.outputParserStructured", "typeVersion": 1.3, "position": [ -1856, 112 ], "id": "610b9d70-6b0e-49a1-addb-f202f75235a7", "name": "Structured Output Parser" }, { "parameters": { "conditions": { "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "strict", "version": 2 }, "conditions": [ { "id": "73178ad4-60f4-4591-8584-9be7903cbb9f", "leftValue": "={{ $json.data.approved }}", "rightValue": "", "operator": { "type": "boolean", "operation": "true", "singleValue": true } } ], "combinator": "and" }, "options": {} }, "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [ -1232, -208 ], "id": "dde24943-f847-4957-af96-b8b6485e7321", "name": "If" }, { "parameters": { "authentication": "oAuth2", "operation": "sendAndWait", "select": "channel", "channelId": { "__rl": true, "value": "C09GSTTLTNG", "mode": "list", "cachedResultName": "errors-handling-tickets" }, "message": "=Draft your reply for this review \n\nClient Review : {{ $('Monitor New Reviews').item.json.comment }}\n\nwe'll post it to Google Maps immediately ", "responseType": "freeText", "options": { "appendAttribution": false } }, "type": "n8n-nodes-base.slack", "typeVersion": 2.3, "position": [ -1008, -112 ], "id": "f3b9dc1f-18bc-406b-9aee-f65ed25f9f4c", "name": "Send message and wait for response", "webhookId": "298952f2-3717-4b05-9741-0432a94cd43d", "credentials": { "slackOAuth2Api": { "id": "fVclEXygO5u0nPia", "name": "Slack account" } } }, { "parameters": { "resource": "review", "operation": "reply", "account": { "__rl": true, "value": "accounts/112359161525876857659", "mode": "list", "cachedResultName": "mouad Mouad" }, "location": { "__rl": true, "value": "locations/8151693557096422588", "mode": "list", "cachedResultName": "locations/8151693557096422588" }, "review": { "__rl": true, "value": "={{ $('Monitor New Reviews').item.json.reviewId }}", "mode": "id" }, "reply": "={{ $json.output.draftedReply }}", "requestOptions": {} }, "id": "e061b0b4-a312-4243-880d-9db887ad68a2", "name": "PositiveReviewReply", "type": "n8n-nodes-base.googleBusinessProfile", "position": [ -784, 80 ], "typeVersion": 1, "credentials": { "googleBusinessProfileOAuth2Api": { "id": "mHNIT5TeMvmdBkZH", "name": "Google Business Profile account" } } }, { "parameters": { "resource": "review", "operation": "reply", "account": { "__rl": true, "value": "accounts/112359161525876857659", "mode": "list", "cachedResultName": "mouad Mouad" }, "location": { "__rl": true, "value": "locations/8151693557096422588", "mode": "list", "cachedResultName": "locations/8151693557096422588" }, "review": { "__rl": true, "value": "={{ $('Extract Review Data').item.json.reviewId }}", "mode": "id" }, "reply": "={{ $('Basic LLM Chain').item.json.output.draftedReply }}", "requestOptions": {} }, "id": "fdd6dba8-17c8-4c78-81f1-f3cb9d6786b4", "name": "NegativeReplyAI", "type": "n8n-nodes-base.googleBusinessProfile", "position": [ -784, -304 ], "typeVersion": 1, "credentials": { "googleBusinessProfileOAuth2Api": { "id": "mHNIT5TeMvmdBkZH", "name": "Google Business Profile account" } } }, { "parameters": { "resource": "review", "operation": "reply", "account": { "__rl": true, "value": "accounts/112359161525876857659", "mode": "list", "cachedResultName": "mouad Mouad" }, "location": { "__rl": true, "value": "locations/8151693557096422588", "mode": "list", "cachedResultName": "locations/8151693557096422588" }, "review": { "__rl": true, "value": "={{ $('Extract Review Data').item.json.reviewId }}", "mode": "id" }, "reply": "={{ $json.data.text }}", "requestOptions": {} }, "id": "341bd98c-0e12-43bd-a270-88b094a448dd", "name": "NegativeReplyHuman", "type": "n8n-nodes-base.googleBusinessProfile", "position": [ -784, -112 ], "typeVersion": 1, "credentials": { "googleBusinessProfileOAuth2Api": { "id": "mHNIT5TeMvmdBkZH", "name": "Google Business Profile account" } } } ], "pinData": {}, "connections": { "Monitor New Reviews": { "main": [ [ { "node": "Extract Review Data", "type": "main", "index": 0 } ] ] }, "Extract Review Data": { "main": [ [ { "node": "Basic LLM Chain", "type": "main", "index": 0 } ] ] }, "Slack - Request Approval": { "main": [ [ { "node": "If", "type": "main", "index": 0 } ] ] }, "Log to Google Sheets": { "main": [ [] ] }, "Basic LLM Chain": { "main": [ [ { "node": "Is Negative Review?", "type": "main", "index": 0 } ] ] }, "OpenRouter Chat Model": { "ai_languageModel": [ [ { "node": "Basic LLM Chain", "type": "ai_languageModel", "index": 0 } ] ] }, "Structured Output Parser": { "ai_outputParser": [ [ { "node": "Basic LLM Chain", "type": "ai_outputParser", "index": 0 } ] ] }, "Is Negative Review?": { "main": [ [ { "node": "Slack - Request Approval", "type": "main", "index": 0 } ], [ { "node": "PositiveReviewReply", "type": "main", "index": 0 } ] ] }, "If": { "main": [ [ { "node": "NegativeReplyAI", "type": "main", "index": 0 } ], [ { "node": "Send message and wait for response", "type": "main", "index": 0 } ] ] }, "Send message and wait for response": { "main": [ [ { "node": "NegativeReplyHuman", "type": "main", "index": 0 } ] ] }, "PositiveReviewReply": { "main": [ [ { "node": "Log to Google Sheets", "type": "main", "index": 0 } ] ] }, "NegativeReplyAI": { "main": [ [ { "node": "Log to Google Sheets", "type": "main", "index": 0 } ] ] }, "NegativeReplyHuman": { "main": [ [ { "node": "Log to Google Sheets", "type": "main", "index": 0 } ] ] } }, "active": false, "settings": { "executionOrder": "v1" }, "versionId": "85526ba1-eb9b-4b95-a762-10828f437757", "meta": { "templateCredsSetupCompleted": true, "instanceId": "66c58b798d3adbdaf64a47b3041d335e10015ca13cec5104fbf9f568a82eba73" }, "id": "dhJDjJR6j23OFurA", "tags": []}GoogleReview_Automation/Google Reviews Automation.jsonAdded+718