diff --git a/workflows/Analyze Customer Sentiment with Zoho CRM, Google Gemini & Send Gmail Alerts-11011/analyze_customer_sentiment_with_zoho_crm_google_gemini_send_gmail_alerts.json b/workflows/Analyze Customer Sentiment with Zoho CRM, Google Gemini & Send Gmail Alerts-11011/analyze_customer_sentiment_with_zoho_crm_google_gemini_send_gmail_alerts.json new file mode 100644 index 000000000..ab990142e --- /dev/null +++ b/workflows/Analyze Customer Sentiment with Zoho CRM, Google Gemini & Send Gmail Alerts-11011/analyze_customer_sentiment_with_zoho_crm_google_gemini_send_gmail_alerts.json @@ -0,0 +1 @@ +{"id":"Ag8cibmA2MT56mPT","meta":{"instanceId":"14e4c77104722ab186539dfea5182e419aecc83d85963fe13f6de862c875ebfa","templateCredsSetupCompleted":true},"name":"Zoho CRM - Sentiment Analysis for Customer Interactions","tags":[],"nodes":[{"id":"a6dbc64a-e182-448c-98cd-b8298dac9f3f","name":"Schedule Trigger","type":"n8n-nodes-base.scheduleTrigger","position":[-400,-80],"parameters":{"rule":{"interval":[{"field":"minutes"}]}},"typeVersion":1.2},{"id":"3ef82363-bba6-48b4-8209-0f54614aaaeb","name":"HTTP Request","type":"n8n-nodes-base.httpRequest","position":[-160,-80],"parameters":{"url":"=https://www.zohoapis.com/crm/v2/Notes?per_page=1&sort_by=Modified_Time&sort_order=desc","options":{},"authentication":"predefinedCredentialType","nodeCredentialType":"zohoOAuth2Api"},"credentials":{"zohoOAuth2Api":{"id":"","name":""}},"typeVersion":4.3},{"id":"97a62994-fcd7-43bd-adb8-43ea79b13ee9","name":"Code in JavaScript","type":"n8n-nodes-base.code","position":[112,-80],"parameters":{"mode":"runOnceForEachItem","jsCode":"const note = $json.data?.[0] || {};\n\nreturn {\n text: note.Note_Content || \"\",\n note_id: note.id,\n parent_id: note.Parent_Id?.id,\n module: note.$se_module\n};\n"},"typeVersion":2},{"id":"7e5674fa-641c-4c4a-a8be-4a1b7b7c52fb","name":"Basic LLM Chain","type":"@n8n/n8n-nodes-langchain.chainLlm","position":[464,-80],"parameters":{"text":"=Classify the sentiment of this text as: Positive, Neutral, or Negative. Sentiment score should be numeric based on analysis\nReturn ONLY the label and score.\nText: {{$json.text}}","batching":{},"promptType":"define","hasOutputParser":true},"typeVersion":1.7},{"id":"a0f433c3-fdb0-4655-9362-2d83b4f2e943","name":"Google Gemini Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[384,144],"parameters":{"options":{}},"credentials":{"googlePalmApi":{"id":"","name":""}},"typeVersion":1},{"id":"0bb49b1e-9014-4bfb-a6f9-1492ae199234","name":"Structured Output Parser","type":"@n8n/n8n-nodes-langchain.outputParserStructured","position":[704,144],"parameters":{"jsonSchemaExample":"{\n \"sentiment_label\":\"neural\",\n \"sentiment_score\":\"1.00\"\n}"},"typeVersion":1.3},{"id":"3b75f216-b77b-4c8f-aa76-10b7a5e86205","name":"HTTP Request1","type":"n8n-nodes-base.httpRequest","position":[1408,-224],"parameters":{"url":"=https://www.zohoapis.com/crm/v2/{{ $('Code in JavaScript').item.json.module }}/{{ $('Code in JavaScript').item.json.parent_id }}","method":"PUT","options":{},"jsonBody":"={\n \"data\": [\n {\n \"id\": \"{{ $('Code in JavaScript').item.json.parent_id }}\",\n \"Sentiment_Label\": \"{{ $json.output.sentiment_label }}\",\n \"Sentiment_Score\": \"{{ $json.output.sentiment_score }}\"\n }\n ]\n}\n","sendBody":true,"specifyBody":"json","authentication":"predefinedCredentialType","nodeCredentialType":"zohoOAuth2Api"},"credentials":{"zohoOAuth2Api":{"id":"","name":""}},"typeVersion":4.3},{"id":"74e227db-ced7-4597-9b69-450b7c9e75f0","name":"If","type":"n8n-nodes-base.if","position":[880,-80],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"loose"},"combinator":"and","conditions":[{"id":"241f3207-f4d4-4729-8f4c-f62f2ffa1990","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $('Basic LLM Chain').item.json.output.sentiment_label }}","rightValue":"Negative"}]},"looseTypeValidation":true},"typeVersion":2.2},{"id":"0aa66e99-1aea-4056-a0f9-b86fd51241f0","name":"Send a message","type":"n8n-nodes-base.gmail","position":[1152,-224],"webhookId":"5bbbec88-57a2-48fe-8d4e-d0eb36a97188","parameters":{"sendTo":"","message":"=Hi Team,\n🚨 Negative sentiment detected\nRecord: {{ $('Code in JavaScript').item.json.parent_id }}\nNote ID: {{ $('Code in JavaScript').item.json.note_id }}\nSentiment: {{ $('Basic LLM Chain').item.json.output.sentiment_label }}\nScore: {{ $('Basic LLM Chain').item.json.output.sentiment_score }}\nText: {{ $('Code in JavaScript').item.json.text }}","options":{},"subject":"🚨 Negative sentiment detected","emailType":"text"},"credentials":{"gmailOAuth2":{"id":"","name":""}},"typeVersion":2.1},{"id":"4ed8bd28-a9ed-4c6a-aa38-a3c4787712c9","name":"HTTP Request2","type":"n8n-nodes-base.httpRequest","position":[1136,16],"parameters":{"url":"=https://www.zohoapis.com/crm/v2/{{ $('Code in JavaScript').item.json.module }}/{{ $('Code in JavaScript').item.json.parent_id }}","method":"PUT","options":{},"jsonBody":"={\n \"data\": [\n {\n \"id\": \"{{ $('Code in JavaScript').item.json.parent_id }}\",\n \"Sentiment_Label\": \"{{ $json.output.sentiment_label }}\",\n \"Sentiment_Score\": \"{{ $json.output.sentiment_score }}\"\n }\n ]\n}\n","sendBody":true,"specifyBody":"json","authentication":"predefinedCredentialType","nodeCredentialType":"zohoOAuth2Api"},"credentials":{"zohoOAuth2Api":{"id":"","name":""}},"typeVersion":4.3},{"id":"dd64df91-98a5-4cf6-9371-ffd49d18b289","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-1072,-656],"parameters":{"width":560,"height":544,"content":"## Workflow Overview\n**How It Works** \nThis workflow monitors Zoho CRM for newly added Notes and analyzes the text to understand customer sentiment in real time. Each time a new note is created—whether by a salesperson, support agent, or automation—the content is captured, cleaned, and sent to an AI sentiment analysis step. The AI evaluates the text and returns a score or label (Positive, Neutral, Negative).\n\nThe workflow then writes this sentiment result back into Zoho CRM, where sentiment Label and sentiment score , 2 custom fields are added in each Module, updating the associated record so teams can instantly see customer mood trends. If the sentiment is negative or dropping, the workflow sends an internal alert so the team can take corrective action before the issue escalates. This turns Zoho CRM into an early-warning system that detects customer dissatisfaction automatically.\n\n**Setup Steps**\n\nConnect Zoho CRM OAuth credentials (Notes/Activities module access required).\n\nAdd 2 custom fields in zoho CRM - Sentiment Label & Sentiment Score \n\nAdd your AI provider credentials (Gemini, OpenAI, or any other LLM).\n\nConfigure the alert recipient (email).\n\nActivate the trigger and add a test note in Zoho CRM to validate the workflow"},"typeVersion":1},{"id":"52eb558f-8f93-4b94-93e1-b916b530796b","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[-480,-208],"parameters":{"color":7,"width":496,"height":288,"content":"## Trigger & Fetch\nMonitors Zoho CRM for newly created Notes and pulls the content for processing."},"typeVersion":1},{"id":"9ec73a9a-7955-4616-bcba-20bce2c5476c","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[48,-208],"parameters":{"color":7,"width":272,"height":288,"content":"## Text Preparation\nCleans and formats the text before sending it to the sentiment model."},"typeVersion":1},{"id":"aeedaa41-1ce6-43e1-a018-3886028200cf","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[352,-224],"parameters":{"color":7,"width":464,"height":560,"content":"## Sentiment Analysis\nAI evaluates tone and returns Positive, Neutral, or Negative sentiment with optional confidence score."},"typeVersion":1},{"id":"8e661a9b-6e0f-4fba-a25a-f09d9534d184","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[864,-352],"parameters":{"color":7,"width":816,"height":512,"content":"## Update sentiment in ZOHO CRM\nCheck for the sentiment's positive and negative approach , and updates sentiment Label and score in Zoho CRM. IF negative sentiment found , then gives alert in gmail"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"timezone":"Asia/Kolkata","callerPolicy":"workflowsFromSameOwner","availableInMCP":false,"executionOrder":"v1"},"versionId":"eb334b27-1cb6-4264-bbb7-49b96210a128","connections":{"If":{"main":[[{"node":"Send a message","type":"main","index":0}],[{"node":"HTTP Request2","type":"main","index":0}]]},"HTTP Request":{"main":[[{"node":"Code in JavaScript","type":"main","index":0}]]},"HTTP Request1":{"main":[[]]},"Send a message":{"main":[[{"node":"HTTP Request1","type":"main","index":0}]]},"Basic LLM Chain":{"main":[[{"node":"If","type":"main","index":0}]]},"Schedule Trigger":{"main":[[{"node":"HTTP Request","type":"main","index":0}]]},"Code in JavaScript":{"main":[[{"node":"Basic LLM Chain","type":"main","index":0}]]},"Google Gemini 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}]]}}} \ No newline at end of file