Quick Overview
This workflow monitors a Gmail inbox for procurement requests, uses Groq (Llama 3.1) to classify and route each ticket with SLA logic, escalates high-risk items to Slack, creates a ticket via HTTP, sends an auto-reply from Gmail, and logs the full record to Google Sheets.
How it works
- Triggers every minute when a new email arrives in a Gmail inbox.
- Extracts the sender, subject, body, timestamps, and Gmail thread/message IDs, and generates a procurement ticket ID.
- Looks up the email thread ID in Google Sheets to identify whether the request already exists.
- Uses Groq (Llama 3.1) to classify the request (category, urgency, sentiment, risk, team) and applies routing rules to set SLA deadlines, queues, and escalation flags.
- If escalation is required, posts a detailed alert to a Slack channel and creates an escalated ticket via an HTTP request; otherwise, creates a standard ticket via an HTTP request.
- Generates a short agent-facing status summary with Groq, emails the customer an acknowledgement and suggested reply via Gmail, and appends the full ticket and AI outputs to Google Sheets.
Setup
- Connect your Gmail OAuth2 credential for both the inbox trigger and the customer auto-reply sender.
- Add a Groq API credential and confirm the selected model (llama-3.1-8b-instant) is available in your Groq account.
- Connect a Google Sheets OAuth2 credential and update the spreadsheet and sheet IDs/names used for the thread lookup and ticket logging, ensuring the target sheet has the required columns (for example: thread_id, ticket_id, category, urgency, sla_deadline).
- Connect a Slack OAuth2 credential and create/select the channel used for escalations (procurement-escalations).
- Replace the demo HTTP request URLs with your real ticketing system endpoints (for example Jira, ServiceNow, or Freshdesk) and map any required request body/headers.