How shre-yes/leadflow-ai works
1. Repository shape
- This repo is not a traditional application codebase; it is primarily an n8n workflow export (lead_processing_system.json) plus documentation and screenshots in assets/.
- The architecture lives inside the workflow definition, so the main “system boundary” is the n8n automation runtime.
2. Primary runtime boundary: n8n
- n8n is the orchestration layer that connects all services.
- It receives lead records, moves them through scoring/enrichment steps, and then fans out into notification and logging paths.
3. Lead ingestion path
- Leads originate in Google Forms, land in Google Sheets, and are then picked up by the n8n workflow.
- In architectural terms, Google Sheets acts as the intake surface for form submissions, not just a datastore.
4. Processing core: rule-based scoring
- A Code node in the workflow runs custom Python-based logic to score leads.
- The scoring uses three main signals from the lead data:
- estimated monthly order volume
- job authority / designation
- number of requested needs/services
- This is the first decisioning layer and produces a numeric priority score.
5. LLM enrichment layer
- After scoring, the workflow calls Groq for LLM-based summarization/enrichment.
- This step turns raw lead fields into a concise narrative summary suitable for sales triage.
- The LLM is an external service boundary; the workflow depends on it for human-readable context, not for the core priority calculation.
6. Priority classification
- The workflow categorizes leads into HOT / WARM / COLD based on score thresholds.
- This creates the key routing boundary in the system:
- high-priority leads trigger immediate alerting
- all leads are still persisted for tracking
7. Notification path
- HOT leads are pushed to Slack, specifically to a high-priority channel (hot_leads per README).
- Slack is the real-time operational output for the sales team, used only for urgent visibility rather than long-term storage.
8. Persistence path
- Every lead is logged to Google Sheets with fields like date, priority, score, contact info, services, and summary.
- This sheet functions as the system of record for lead tracking and auditing.
9. Data flow summary
- The end-to-end flow is:
- Google Forms → Google Sheets → n8n workflow → Python scoring → Groq summarization → priority decision → Slack for HOT leads → Google Sheets logging for all leads
- The workflow is effectively a split path after classification: one branch for notification and one for persistence.
10. Operational dependencies
- The system depends on external credentials and integrations:
- Google Sheets OAuth2 / Google Cloud access
- Groq API key
- Slack app credentials or webhook
- These integrations are part of the deployment boundary, not the repo itself.
11. What is and isn’t in the repo
- There is no standalone backend service, frontend, database schema, or container setup in this repository.
- The architecture is mostly declarative automation plus configuration, with the workflow JSON as the executable artifact.
12. Diagramming takeaway
- When drawing the architecture, center the diagram on n8n and show it orchestrating three external systems: Google Sheets, Groq, and Slack.
- Treat Google Forms as the upstream source feeding Sheets, and Sheets as both ingestion buffer and persistent log.
Main entry points: lead_processing_system.json Workflow export · README.md README
Components 16
Repository
Source materials and exported workflow artifact
- README · Human-facing overview and usage notes
README.md - Workflow export · Executable lead processing definition
lead_processing_system.json - Assets · Reference images and visual documentation
assets
n8n Workflow
Automation runtime and processing stages
- n8n · Workflow runtime that coordinates ingestion, enrichment, and routing
- Lead trigger · Starts the workflow when new lead records are available
- Lead prep · Normalizes incoming lead fields for downstream processing
- Lead score · Code node that computes numeric priority from lead signals
- Scoring signals · Monthly volume, authority, and requested services
- Lead summary · Produces human-readable narrative context for sales triage
- Priority gate · Maps scores to HOT, WARM, and COLD routing bands
- Lead log · Writes all lead records and tracking fields back to Sheets
External Systems
Upstream and downstream integrations
- Google Forms · Upstream form submissions that originate leads
- Intake Sheet · Sheets surface where form submissions are picked up
- Groq · LLM boundary used for concise lead summarization
- Slack · Real-time notification channel for urgent leads
- Tracking Sheet · Persistent audit and tracking store for all processed leads
Connections 15
- Google Forms → Intake Sheet: submit · Form submissions land in Sheets
- Intake Sheet → Lead trigger: pickup · n8n reads new lead records from the intake sheet
- Lead trigger → n8n: start · Workflow runtime begins processing
- n8n → Lead prep: prepare · Incoming data is shaped for scoring and enrichment
- Lead prep → Scoring signals: features · Lead fields are reduced to scoring inputs
- Scoring signals → Lead score: drive · Scoring logic evaluates the lead signals
- Lead score → Groq: context · Lead context is passed for LLM enrichment
- Groq → Lead summary: return · Groq produces concise narrative output
- Lead score → Priority gate: score · Numeric priority score is compared to thresholds
- Lead summary → Priority gate: enrich · Summary is attached before routing decisions
- Priority gate → Slack: HOT · High-priority leads trigger immediate Slack alerts
- Priority gate → Lead log: all leads · Every classified lead is persisted for tracking
- Lead log → Tracking Sheet: write · Processed lead data is appended to the tracking sheet
- Workflow export → n8n: defines · Exported workflow is the executable artifact for the runtime
- README → Workflow export: documents · Documentation explains the workflow behavior