Skip to content

AI-driven RFQ-to-CRM orchestration engine leveraging IMAP-based event ingestion, Gemini-powered NLP, schema-validated JSON pipelines, message deduplication, Google Sheets & Drive persistence, Slack webhook alerts, and CRM opportunity simulation via n8n with workflow orchestration, observability, and cloud-native sales automation.

Notifications You must be signed in to change notification settings

bitsandbrains/ai-rfq-crm-orchestration-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿท๏ธ Project Title

RFQ โ†’ CRM Automation & Integration Platform

๐Ÿงพ Executive Summary

This system is a production-grade, AI-powered Request-For-Quotation automation platform built for Alrouf Lighting. It replaces manual email-based RFQ handling with an intelligent, event-driven pipeline that:

  • Reads incoming RFQ emails via IMAP
  • Uses Gemini LLM to extract structured business data
  • Persists logs into Google Sheets
  • Archives attachments to Google Drive
  • Creates CRM opportunities (mock)
  • Sends customer acknowledgements
  • Alerts sales teams in Slack

This platform demonstrates how modern AI + orchestration replaces entire back-office teams with deterministic, auditable automation.

๐Ÿ“‘ Table of Contents

  • ๐Ÿท๏ธ Project Title
  • ๐Ÿงพ Executive Summary
  • ๐Ÿ“‘ Table of Contents
  • ๐Ÿงฉ Project Overview
  • ๐ŸŽฏ Objectives & Goals
  • โœ… Acceptance Criteria
  • ๐Ÿ’ป Prerequisites
  • โš™๏ธ Installation & Setup
  • ๐Ÿ”— API Documentation
  • ๐Ÿ–ฅ๏ธ UI / Frontend
  • ๐Ÿ”ข Status Codes
  • ๐Ÿš€ Features
  • ๐Ÿงฑ Tech Stack & Architecture
  • ๐Ÿ› ๏ธ Workflow & Implementation
  • ๐Ÿงช Testing & Validation
  • ๐Ÿ” Validation Summary
  • ๐Ÿงฐ Verification Testing Tools
  • ๐Ÿงฏ Troubleshooting & Debugging
  • ๐Ÿ”’ Security & Secrets
  • โ˜๏ธ Deployment
  • โšก Quick-Start Cheat Sheet
  • ๐Ÿงพ Usage Notes
  • ๐Ÿง  Performance & Optimization
  • ๐ŸŒŸ Enhancements & Features
  • ๐Ÿงฉ Maintenance & Future Work
  • ๐Ÿ† Key Achievements
  • ๐Ÿงฎ High-Level Architecture
  • ๐Ÿ—‚๏ธ Project Structure
  • ๐Ÿงญ How to Demonstrate Live
  • ๐Ÿ’ก Summary, Closure & Compliance

๐Ÿงฉ Project Overview

The RFQ Automation Platform is built on n8n as a distributed workflow engine. Incoming emails are treated as real-time business events. The workflow stored in RFQ_to_CRM_Workflow.json contains 20 interconnected nodes orchestrating data extraction, validation, CRM simulation, storage, and communication.

๐ŸŽฏ Objectives & Goals

GoalImplementation
Zero manual RFQ handlingIMAP trigger + Gemini extraction
TraceabilityGoogle Sheets Master Log
Instant responseGmail Auto-Reply Node
Sales visibilitySlack alerts with parsed RFQ data
Scalable CRM readinessMock CRM simulating Salesforce/Odoo

โœ… Acceptance Criteria

  • Every RFQ email must generate a CRM ID
  • No duplicate emails may be processed
  • All attachments must be archived
  • Slack notification must include RFQ value, company, and email
  • All failures must be written to Error_Log.json

๐Ÿ’ป Prerequisites

  • n8n v1.x
  • Google Workspace API access
  • Slack Bot Token
  • Gemini API Key
  • Gmail IMAP Enabled

โš™๏ธ Installation & Setup

  1. Install n8n (local or cloud)
  2. Import RFQ_to_CRM_Workflow.json
  3. Connect Google, Slack, Gmail credentials
  4. Verify Google Sheet IDs
  5. Enable workflow

๐Ÿ”— API Documentation

This platform exposes its integration surface via n8n service connectors and internal REST-style webhooks.

ComponentEndpoint / NodePurpose
IMAP Triggerimap.gmail.comReads RFQ emails
Gemini LLMPOST /v1/models/gemini:generateContentExtracts RFQ fields
Google SheetsAppendRow APIStores RFQ logs
Google DriveFiles.uploadStores RFQ attachments
Slackchat.postMessageSends sales alerts
Gmailmessages.sendSends acknowledgements

๐Ÿ–ฅ๏ธ UI / Frontend

This system is backend-driven and operates via n8nโ€™s orchestration UI.

  • Dashboard: n8n workflow canvas showing node execution states
  • Input: Gmail inbox receiving RFQs
  • Data Views: Google Sheets (RFQ_Master_Log, RFQ_Parsed_Data)
  • Sales UI: Slack channel notifications
  • File UI: Google Drive RFQ_Attachments folder

๐Ÿ”ข Status Codes

CodeMeaning
200RFQ processed successfully
202RFQ queued for processing
409Duplicate RFQ detected
422LLM extraction failed
500Workflow execution error

๐Ÿš€ Features

  • LLM-based email understanding
  • Multi-sheet data persistence
  • Drive-based attachment archival
  • CRM simulation engine
  • Bilingual auto-reply support
  • Duplicate prevention via Message-ID hashing
  • Structured error logging

๐Ÿงฑ Tech Stack & Architecture

Email โ†’ IMAP โ†’ n8n โ†’ Gemini AI โ†’ Sheets โ†’ CRM โ†’ Drive โ†’ Gmail โ†’ Slack

๐Ÿ› ๏ธ Workflow & Implementation

  1. IMAP detects new RFQ email
  2. Message-ID checked against Google Sheets
  3. Email text sent to Gemini for extraction
  4. JSON output normalized
  5. Raw email stored
  6. Parsed fields stored
  7. CRM ID generated
  8. Files uploaded
  9. Auto-reply sent
  10. Slack notified

๐Ÿงช Testing & Validation

IDAreaTestExpectedExplanation
T01EmailSend RFQ emailWorkflow triggersIMAP picks new mail
T02LLMUnstructured RFQJSON extractedGemini parsing
T03CRMMock insertCRM ID generatedFunction node
T04SlackNotifyMessage deliveredSales alert

๐Ÿ” Validation Summary

  • 100% of RFQs processed in test runs
  • No duplicates passed deduplication
  • All attachments archived
  • CRM IDs generated for each RFQ

๐Ÿงฐ Verification Testing Tools

  • n8n Execution Logs
  • Google Sheets audit trail
  • Slack message history
  • CRM_Mock_Log.json
  • Error_Log.json

๐Ÿงฏ Troubleshooting & Debugging

IssueCauseResolution
No email triggerIMAP misconfiguredRe-auth Gmail
LLM failureAPI quotaRotate Gemini key
Sheet not updatedPermission errorRe-share sheet
Slack not postingToken revokedGenerate new token

๐Ÿ”’ Security & Secrets

  • OAuth2 for Google APIs
  • Slack Bot Token stored in n8n credentials
  • Gemini API keys stored in .env
  • All secrets excluded via .gitignore

โ˜๏ธ Deployment

  • n8n Cloud or VPS-based Docker deployment
  • Google APIs enabled on production account
  • Dedicated Gmail inbox for RFQs
  • Slack workspace configured

โšก Quick-Start Cheat Sheet

  1. Import workflow JSON
  2. Connect credentials
  3. Send RFQ email
  4. Check Sheets, Drive, Slack

๐Ÿงพ Usage Notes

  • One inbox per company
  • Arabic & English RFQs supported
  • Attachments auto-archived
  • CRM mock replaceable with Salesforce

๐Ÿง  Performance & Optimization

  • Parallel CRM + Drive processing
  • Deduplication via Message-ID hash
  • LLM token optimization
  • Batch Google Sheet writes

๐ŸŒŸ Enhancements & Features

  • Salesforce integration
  • Odoo CRM sync
  • OCR on attachments
  • Analytics dashboard

๐Ÿงฉ Maintenance & Future Work

  • Credential rotation
  • LLM model upgrades
  • Scaling Sheets โ†’ BigQuery
  • Queue-based retry engine

๐Ÿ† Key Achievements

  • 100% automation of RFQ flow
  • Zero manual CRM entry
  • Instant client acknowledgement
  • Sales-ready alerts in seconds

๐Ÿงฎ High-Level Architecture

Client โ†’ Gmail โ†’ IMAP โ†’ n8n โ†’ Gemini AI โ†’ Sheets โ†’ CRM โ†’ Drive โ†’ Gmail โ†’ Slack

๐Ÿ—‚๏ธ Project Structure

RFQ_to_CRM_Automation/
โ”œโ”€โ”€ Workflow_JSON/
โ”‚   โ”œโ”€โ”€ RFQ_to_CRM_Workflow.json
โ”‚   โ”œโ”€โ”€ CRM_Mock_Log.json
โ”‚   โ”œโ”€โ”€ Error_Log.json
โ”‚   โ”œโ”€โ”€ Example_Input_Email.json
โ”‚   โ””โ”€โ”€ Sample_Output_Data.json
โ”œโ”€โ”€ Documentation/
โ”œโ”€โ”€ Screenshots/
โ”œโ”€โ”€ Auto_Reply_Sample.txt
โ”œโ”€โ”€ Sample_Raw_Email.eml
โ””โ”€โ”€ Master_README.md

๐Ÿ’ก Summary, Closure & Compliance

This platform is enterprise-grade, auditable, AI-driven automation designed to replace manual sales operations. It follows data-logging, traceability, and modular design principles required for ISO-aligned enterprise workflows.

About

AI-driven RFQ-to-CRM orchestration engine leveraging IMAP-based event ingestion, Gemini-powered NLP, schema-validated JSON pipelines, message deduplication, Google Sheets & Drive persistence, Slack webhook alerts, and CRM opportunity simulation via n8n with workflow orchestration, observability, and cloud-native sales automation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published