Quick Overview
This workflow monitors Gmail and a webhook for sales notes, uses Groq (Llama 3.3) to extract competitor intelligence, then routes confirmed competitor signals to Salesforce, Slack, and Google Sheets for real-time alerting and logging.
How it works
- Triggers when a new Gmail message arrives or when an external system sends a POST request to the webhook endpoint.
- Normalizes the incoming email or webhook payload into a consistent event format and removes duplicate webhook events using a unique ID.
- Sends the cleaned text to a Groq Llama 3.3 chat model to extract a structured JSON report including competitors, deal stage, sentiment, risk level, urgency, insights, and recommended actions.
- Validates the AI output and logs malformed or empty results to Google Sheets.
- Enriches valid results with source context and a calculated risk score, then skips and logs events where no competitor names are detected.
- Splits the competitor list into one record per competitor, maps it to a Salesforce stage and alert priority, and creates a Salesforce Opportunity.
- Posts a formatted competitor alert to Slack and appends the intelligence record to Google Sheets, sending a Slack error alert if any downstream step fails.
Setup
- Add credentials for Gmail, Groq, Slack, Google Sheets, and Salesforce.
- Configure the webhook source application to POST competitor-intel events to this workflow’s webhook URL.
- Update the target Slack channel IDs for competitor alerts and error alerts.
- Update the Google Sheets document and sheet to match your logging spreadsheet schema.
- Review the Salesforce Opportunity fields (stage mapping, naming, and description) to match your Salesforce pipeline and required fields.