| { | |
| "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": [] | |
| } |