Build an SMB AI Infrastructure Stack
Build a 7-layer AI system in n8n that qualifies leads and runs a CRM.
Introduction
30 Second Summary
Small businesses juggle dozens of customer interactions every day. Leads come in from different channels, questions pile up, and owners lose track of who needs follow-up. Most businesses either hire staff they can't afford or let opportunities slip through the cracks.
In this project, you will build a complete 7-layer AI infrastructure stack in n8n that qualifies leads, answers FAQs using a business knowledge base, routes inquiries to a CRM, and generates daily insights for the business owner.
What You'll Build
A fully connected AI-powered business system that handles the complete lifecycle of a customer interaction, from intake to qualification to owner dashboard.
By the end of this project, you'll have:
- A RAG-powered knowledge base that makes AI responses sound like they deeply understand the client's business.
- An AI communication agent that qualifies leads, categorizes inquiries, and crafts personalized responses in real-time.
- An orchestration engine that routes different inquiry types to different CRM workflows in HubSpot automatically.
- An AI-powered analytics layer that writes plain-English operational insights to a Google Sheets owner dashboard.
- Secret Mission: Add a reactivation campaign workflow that identifies stale leads and generates personalized re-engagement messages using the knowledge base.
Are there any prerequisites?
You need a running n8n instance, an OpenAI API key, an Anthropic (Claude) API key, a Google account, and a free HubSpot account. You will create a HubSpot private app token during Step 1.
Before We Start
Before We Start...
Configure Credentials and Prepare the Foundation
Every layer of the AI infrastructure stack communicates with external services. Your AI agent needs OpenAI for embeddings, Claude for conversation, HubSpot for CRM operations, and Google Sheets for the owner dashboard.
In this step, you will wire up all the credentials so your workflows can authenticate with each service. You will also create the Google Sheet that serves as your owner-facing dashboard.
In this step, get ready to:
- Set up a HubSpot Private App and connect it to n8n.
- Configure OpenAI and Anthropic API credentials in n8n.
- Connect Google Sheets and create the SMB AI Dashboard.
Set up HubSpot Private App token
Your n8n workflows need permission to create contacts and deals in HubSpot on behalf of the AI system. A Private App generates a scoped access token that grants only the permissions you choose.
- Log into your HubSpot account.
- Click the settings icon (gear) in the top navigation bar.
- In the left sidebar, navigate to Integrations, then select Private Apps.
- Click Create a private app.
- On the Basic Info tab, enter SMB AI Infrastructure as the app name.
- Click the Scopes tab.
- Search for and select the checkbox for each of the following scopes:
- crm.objects.contacts.read
- crm.objects.contacts.write
- crm.objects.deals.read
- crm.objects.deals.write
- crm.objects.companies.read
- crm.objects.owners.read
- crm.lists.write
- Click Create app in the top right corner.
- In the confirmation dialog, click Continue creating.
- Click Show token, then click Copy to copy your access token to the clipboard.
What is a Private App?
A HubSpot Private App is a scoped authentication method that generates an access token with only the permissions you select. Unlike a full API key, it limits what can be accessed if the token is ever exposed.
The regular HubSpot API Key method is deprecated. Private App tokens are the current recommended approach.
Now save this token as a credential in n8n.
- Open your n8n instance in the browser.
- Click the Create button in the upper-left corner of the side menu.
- Select Credential.
- Search for and select HubSpot.
- In the Authentication dropdown, select App Token.
- Paste the access token you copied from HubSpot into the Access Token field.
- Click Save. n8n will test the credential automatically to confirm it works.
Credential test failing?
Make sure you selected App Token (not API Key or OAuth2) as the authentication method. The regular API Key method is deprecated in HubSpot.
Double-check you copied the full token string from HubSpot without extra spaces at the beginning or end.
help me debug my HubSpot credential connection in n8n
Configure OpenAI and Anthropic credentials in n8n
The AI layers of your system use two different LLM providers. OpenAI handles embeddings for the knowledge base, and Anthropic's Claude powers the conversational agent.
- In n8n, click the Create button in the upper-left corner.
- Select Credential.
- Search for and select OpenAI.
- Paste your OpenAI API key into the API Key field.
- Click Save. n8n will test the credential to confirm it works.
Now create the Anthropic credential.
- Click the Create button again and select Credential.
- Search for and select Anthropic.
- Paste your Claude API key into the API Key field.
- Click Save. n8n will test the credential automatically.
Test both credentials together by creating a quick test workflow.
- Click Create and select Workflow.
- Click the + button on the canvas to add a node.
- Search for AI Agent and add it.
- In the AI Agent node, click the Chat Model connection and select OpenAI Chat Model.
- Select your OpenAI credential in the dropdown.
- In the Prompt field, type a simple test message like Hello, are you working?.
- Click Test step to execute the node.
You should see an AI-generated response in the output panel, confirming the credential is working.
Why test with the AI Agent node?
The AI Agent node is the core building block for all AI workflows in n8n. Testing it now confirms both your credential and the node itself are functional before you build the real workflows.
Not seeing a response?
Verify your OpenAI account has available credits. A new account with no payment method will reject API calls.
For the Anthropic credential, ensure your Anthropic Console account has access to Claude models and has credits available.
help me troubleshoot my AI Agent node test in n8n
Connect Google Sheets and Google Drive
The final credential connects n8n to your Google account via OAuth2. This lets your workflows read from and write to Google Sheets and Google Drive without manual intervention.
- In n8n, click the Create button and select Credential.
- Search for Google Sheets OAuth2 API and select it.
- n8n will display an OAuth Redirect URL. Copy this URL.
- Follow the on-screen instructions to connect your Google account. This involves creating an OAuth client in your Google Cloud Console and pasting the Client ID and Client Secret back into n8n.
- Click Sign in with Google to complete the authentication.
- Click Save.
What does OAuth2 do here?
OAuth2 lets n8n access your Google Sheets and Google Drive on your behalf without ever storing your Google password. You authorize specific permissions (reading and writing spreadsheets), and Google issues a token that n8n uses for future requests.
Now create the Google Sheet that will serve as your owner dashboard.
- Open Google Sheets in your browser at sheets.google.com.
- Create a new blank spreadsheet.
- Rename it to SMB AI Dashboard.
- Rename the first tab (sheet) to Lead Pipeline.
- In row 1 of the Lead Pipeline tab, enter the following column headers:
- Timestamp in A1.
- Name in B1.
- Email in C1.
- Phone in D1.
- Source in E1.
- AI Score in F1.
- AI Category in G1.
- AI Response in H1.
- Status in I1.
- Click the + button at the bottom of the screen to add a new tab.
- Rename this tab to Daily Insights.
- In row 1, enter the column headers: Date in A1, Total Leads in B1, Avg Score in C1, Top Source in D1, AI Recommendation in E1.
- Add another new tab by clicking + again.
- Rename this tab to Knowledge Log.
- In row 1, enter the column headers: Timestamp in A1, Document in B1, Chunks in C1, Status in D1.
You should now see three tabs at the bottom of your spreadsheet, each with its own column headers in row 1.
Google OAuth not connecting?
Make sure you enabled the Google Sheets API and Google Drive API in your Google Cloud Console project. Without these enabled, the OAuth flow will complete but n8n will fail to read or write data.
If you see a consent screen warning about an unverified app, click Advanced and then Go to (app name) to proceed.
help me fix my Google OAuth2 connection in n8n
Your foundation is set. Every external service your AI infrastructure needs is now authenticated and ready to receive data. Next up, you will build the knowledge base that gives your AI agent deep business context.
Build the Knowledge Base
Your credentials are locked in and your dashboard is ready to receive data. Now you need to give your AI system the one thing that separates a generic chatbot from a business-aware assistant: deep knowledge of the client's business.
In this step, you will build a RAG (Retrieval-Augmented Generation) knowledge base. You will create sample business documents, then build an n8n workflow that ingests those documents into a vector store so your AI agent can search them for relevant context whenever a customer inquiry arrives.
In this step, get ready to:
- Create sample business knowledge documents in Google Drive.
- Build a document ingestion workflow that chunks, embeds, and stores the documents.
- Run the ingestion pipeline and verify that the vector store returns relevant results.
Create sample business documents
A RAG system is only as good as the knowledge you feed it. Before building the ingestion pipeline, you need source documents that simulate a real SMB client's business knowledge.
- Open Google Drive in your browser.
- Create a new folder called SMB Knowledge Base.
- Inside the SMB Knowledge Base folder, create a new Google Doc called Services and Pricing.
- Add content that lists 3-4 services with pricing tiers. For example, list a basic, standard, and premium tier for each service with monthly rates.
- Create a second Google Doc called FAQs.
- Add 8-10 common customer questions with detailed answers. Cover topics like turnaround times, payment methods, service guarantees, and what to expect during onboarding.
- Create a third Google Doc called SOPs and Policies.
- Add content covering business hours, the booking process, cancellation policy, and service area.
What goes in these documents?
Think of these as the documents a new employee would read on their first day. The AI agent will use them to answer customer questions as if it worked at the business.
For this project, you can use a fictional business (e.g., a home cleaning company or a digital marketing agency). The content does not need to be real, but it should be detailed enough for the AI to give useful answers.
- Confirm you have three documents inside the SMB Knowledge Base folder.
Can't find the folder?
Make sure you created the folder at the top level of your Google Drive (not inside another folder). The n8n Google Drive node will need to locate it by name later.
help me find my Google Drive folder in n8n
Build the document ingestion workflow
Now you will build the workflow that reads each document from Google Drive, splits it into small chunks, generates vector embeddings, and stores them for retrieval.
- In n8n, click the + button in the top right to create a new workflow.
- Click the workflow name at the top and rename it to KB - Document Ingestion.
- Click Add first step and search for Manual Trigger. Select it.
Why a Manual Trigger?
You only need to run this workflow when you add or update knowledge base documents. A manual trigger lets you run it on demand rather than on a schedule.
- Click the + connector on the Manual Trigger node to add a new node.
- Search for Google Drive and select it.
- Set the Operation to Get Many (to list files).
- Under Filter, set the folder to your SMB Knowledge Base folder.
- Select your Google credential from the Credential to connect with dropdown.
- Click the + connector on the Google Drive node to add the next node.
- Search for Loop Over Items and select it.
- Leave the default Batch Size at 1 so each document is processed individually.
Why loop over items?
The vector store sub-nodes (Default Data Loader, Text Splitter, Embeddings) resolve expressions for only the first input item. The Loop Over Items node feeds one document at a time, ensuring each file is processed correctly.
- From the Loop Over Items node's loop output, add a new Google Drive node.
- Set the Operation to Download File.
- Map the file ID from the loop's current item into the File ID field using an expression.
- Click the + connector on the Download File node to add the next node.
- Search for Simple Vector Store and select it.
- Set the Operation Mode to Insert Documents.
- In the Memory Key field, type smb_knowledge_base.
Now connect the sub-nodes that tell the vector store how to process the documents.
- On the Simple Vector Store node, click the Document Loader connector and add a Default Data Loader node.
- In the Default Data Loader, set Text Splitting to Custom.
- On the Default Data Loader node, click the Text Splitter connector and add a Recursive Character Text Splitter node.
- Set Chunk Size to 500.
- Set Chunk Overlap to 50.
- Back on the Simple Vector Store node, click the Embedding connector and add an Embeddings OpenAI node.
- In the Embeddings OpenAI node, select the Model text-embedding-3-small.
- Select your OpenAI credential from the Credential to connect with dropdown.
What does this pipeline do?
Each document flows through four processing stages. The Default Data Loader reads the binary file content. The Recursive Character Text Splitter breaks it into 500-character chunks with 50-character overlap so context is preserved between chunks.
The Embeddings OpenAI node converts each chunk into a numerical vector using the text-embedding-3-small model. Finally, the Simple Vector Store node stores those vectors in memory under the key smb_knowledge_base.
The last piece is logging each processed document to your Google Sheet.
- Connect the output of the Simple Vector Store node back to the Loop Over Items node (the loop input).
- From the Loop Over Items node's done output, add a Google Sheets node.
- Set the Operation to Append Row.
- Select your SMB AI Dashboard spreadsheet.
- Select the Knowledge Log tab.
- Map the columns: set Timestamp to the current date/time expression, Document to the file name, Chunks to the number of chunks processed, and Status to Processed.
- Select your Google credential from the Credential to connect with dropdown.
Use n8n expressions for dynamic values
For the Timestamp column, use the expression {{ $now }} which returns the current date and time. For the Document column, map from the file name field returned by the Google Drive node.
Nodes not connecting?
Make sure the Simple Vector Store node's main output connects back to the Loop Over Items node's input. The done output of Loop Over Items connects to the Google Sheets node.
help me wire the Loop Over Items node correctly in my ingestion workflow
Run the ingestion and verify
With the workflow assembled, it is time to run it and confirm your knowledge base is populated.
- Click Test Workflow (or press the play button) to execute the workflow.
- Watch the execution progress through each node. Each document should flow through the loop, get downloaded, chunked, embedded, and stored.
- When the execution completes, open your SMB AI Dashboard Google Sheet and navigate to the Knowledge Log tab.
- Verify you see 3 rows (one for each document) with timestamps, document names, and a Processed status.
What should I see?
Each node in the workflow should show a green checkmark after execution. The Loop Over Items node should show it processed 3 items. The Knowledge Log tab in Google Sheets should have 3 rows with timestamps and document names.
Now test that the vector store actually returns useful results when queried.
- Create a new workflow in n8n (this is a temporary test workflow).
- Add a Manual Trigger node.
- Add a Simple Vector Store node and set the Operation Mode to Get Many.
- Set the Memory Key to smb_knowledge_base.
- In the Prompt field, enter What are your prices?.
- Add an Embeddings OpenAI sub-node connected to the Simple Vector Store (same text-embedding-3-small model and OpenAI credential).
- Click Test Workflow.
- Inspect the output of the Simple Vector Store node. You should see text chunks from your Services and Pricing document returned as results.
No results from the vector store?
The Simple Vector Store uses in-memory storage. If you restarted your n8n instance between running the ingestion and this test, the data will have been cleared. Re-run the KB - Document Ingestion workflow first, then immediately test again without restarting n8n.
Also confirm the Memory Key matches exactly: smb_knowledge_base in both workflows.
help me debug my Simple Vector Store returning empty results
Your knowledge base is loaded and searchable. Next up, you will build the AI communication agent that uses this knowledge base to answer customer questions intelligently.
Build the AI Communication Agent
Your knowledge base is loaded and ready to provide business context. Now you need a way for customer inquiries to reach your system and get intelligent, personalized responses.
In this step, you will build the AI Communication Hub workflow. This workflow receives incoming customer messages via a webhook, passes them to an AI agent that uses your knowledge base to craft responses, and structures the output for downstream routing.
In this step, get ready to:
- Create a webhook endpoint that receives customer inquiries.
- Connect an AI Agent with RAG-powered business context.
- Structure the AI output into fields your routing engine can use.
Create the webhook entry point (Layer 1)
Every customer interaction starts with data arriving at your system. A webhook provides a single URL endpoint that can receive messages from any source: a website form, a chat widget, or a third-party API.
- In n8n, click the + button in the top right to create a new workflow.
- Name the workflow AI Communication Hub by clicking on the workflow name at the top.
- Click the + node button on the canvas to add your first node.
- Search for Webhook and select it.
- Set the HTTP Method to POST.
- In the Path field, enter smb-intake.
What does the Webhook node do?
The Webhook node creates a live URL that listens for incoming HTTP requests. When a POST request hits the smb-intake path, the workflow triggers and passes the request body to the next node.
This single endpoint simulates all customer channels. The webhook expects JSON with fields: name, email, phone, message, and source.
Build the AI Agent with business context (Layer 2)
The AI Agent node is where intelligence lives. It receives the customer message, searches your knowledge base for relevant context, and generates a qualified response.
- Click the + connector on the right side of the Webhook node to add the next node.
- Search for AI Agent and select it.
- In the AI Agent node settings, set Prompt to Define below.
- In the Text field, enter an expression to pass the customer message from the Webhook:
{{ $json.body.message }}
Why use an expression here?
The expression {{ $json.body.message }} pulls the message field from the incoming webhook body. This dynamically passes whatever the customer wrote into the AI Agent as its prompt.
Now connect the Anthropic Chat Model as the AI's brain.
- Click the Chat Model connector at the bottom of the AI Agent node (the sub-node connection).
- Search for Anthropic Chat Model and select it.
- In the Anthropic Chat Model sub-node, select your Anthropic credential from the Credential to connect with dropdown.
- Set the Model to Claude (select the Claude model available in your dropdown).
Next, write the System Message that defines how the AI agent behaves.
- Back in the AI Agent node, scroll to the System Message field and paste the following:
You are a professional business receptionist AI. Your job is to handle incoming customer inquiries with expertise and warmth.
For every message you receive, you must:
1. Qualify the lead by scoring their buying intent from 1-10 (10 = ready to purchase, 1 = just browsing)
2. Categorize the inquiry into exactly one of: new_lead, faq, appointment_request, complaint, follow_up
3. Answer any FAQ questions using the business knowledge base (search it for relevant context)
4. Always respond professionally and helpfully
You MUST format your response as valid JSON with these exact fields:
{
"ai_score": <number 1-10>,
"ai_category": "<one of: new_lead, faq, appointment_request, complaint, follow_up>",
"ai_response": "<the message to send back to the customer>",
"ai_reasoning": "<internal note explaining your scoring and categorization>"
}
Only output the JSON object. Do not include any other text before or after it.
What does this System Message do?
The System Message gives the AI its identity and rules. It instructs the agent to perform three jobs on every inquiry: score buying intent, categorize the message type, and craft a helpful response.
By requiring JSON output with specific fields, you ensure the downstream nodes can reliably parse and route the response. The ai_reasoning field gives the business owner visibility into why the AI made each decision.
Now attach the Vector Store Tool so the agent can search your knowledge base.
- Click the Tool connector at the bottom of the AI Agent node.
- Search for Vector Store Tool and select it.
- In the Vector Store Tool sub-node, click the Vector Store connector.
- Search for In-Memory Vector Store and select it.
- Set the Memory Key to smb_knowledge_base. This connects to the same vector store you populated in Step 2.
What is RAG?
RAG (Retrieval-Augmented Generation) means the AI retrieves relevant documents before generating its response. Instead of guessing, the agent searches your knowledge base for pricing, policies, and FAQs, then uses that context to craft accurate, business-specific answers.
Finally, add Simple Memory for conversation context.
- Click the Memory connector at the bottom of the AI Agent node.
- Search for Simple Memory and select it.
- Leave the default settings. Simple Memory maintains conversation context within a single session.
AI Agent node showing an error?
The AI Agent node requires at least one tool sub-node connected to function. Make sure the Vector Store Tool is properly connected (you should see it attached below the agent node). If your Anthropic credential shows a red warning, re-open it and verify the API key is correct.
help me troubleshoot my AI Agent node connection errors
Structure the AI output
The AI Agent returns a text response containing JSON. You need to parse that text into individual fields so the rest of your workflow can route and log each piece of data separately.
- Click the + connector on the right side of the AI Agent node.
- Search for Code and select it.
- Set the Language to JavaScript.
- Paste the following code into the Code node:
// Parse the AI agent's JSON response into structured fields
const aiOutput = $input.first().json.output;
let parsed;
try {
// Extract the JSON object from the AI response text
const jsonMatch = aiOutput.match(/\{[\s\S]*\}/);
parsed = JSON.parse(jsonMatch[0]);
} catch (error) {
// Fallback if the AI doesn't return valid JSON
parsed = {
ai_score: 5,
ai_category: "new_lead",
ai_response: aiOutput,
ai_reasoning: "Could not parse structured response"
};
}
return [{
json: {
ai_score: parsed.ai_score,
ai_category: parsed.ai_category,
ai_response: parsed.ai_response,
ai_reasoning: parsed.ai_reasoning
}
}];
What does this code do?
`$input.first().json.output` grabs the AI Agent's text response from the previous node.
The regex /\{[\s\S]*\}/ extracts the JSON object from the response. The try/catch block provides a graceful fallback if the AI occasionally returns malformed JSON. The output is a clean object with four fields that downstream nodes can reference directly.
Now add the Set node to combine the original webhook data with the AI output.
- Click the + connector on the right side of the Code node.
- Search for Edit Fields (Set) and select it.
- Set Mode to Manual Mapping.
- Add the following fields using the Add Field button. For each field, toggle the value to Expression and enter the expression shown:
- Field name with expression: {{ $("Webhook").item.json.body.name }}
- Field email with expression: {{ $("Webhook").item.json.body.email }}
- Field phone with expression: {{ $("Webhook").item.json.body.phone }}
- Field message with expression: {{ $("Webhook").item.json.body.message }}
- Field source with expression: {{ $("Webhook").item.json.body.source }}
- Field ai_score with expression: {{ $json.ai_score }}
- Field ai_category with expression: {{ $json.ai_category }}
- Field ai_response with expression: {{ $json.ai_response }}
- Field ai_reasoning with expression: {{ $json.ai_reasoning }}
What does the Set node do here?
The Set node merges two data sources into one clean object. It pulls the original customer details (name, email, phone, message, source) from the Webhook node using $("Webhook").item.json.body, and combines them with the AI output fields from the Code node using $json.
Downstream nodes (routing, CRM, logging) can now access all fields from a single input object.
- Enable Keep Only Set Fields so only your defined fields pass through.
- Save the workflow by pressing Cmd+S (macOS) or Ctrl+S (Windows).
- Toggle the workflow to Active using the switch in the top right corner. This makes the webhook URL live and ready to receive requests.
Expressions showing an error?
Make sure the Webhook node is named exactly Webhook (the default). If you renamed it, update the expression $("Webhook") to match the actual node name. Also confirm you toggled each field value to Expression mode before pasting. Fixed mode treats the expression text as a literal string.
help me fix expression errors in my n8n Set node
Your AI Communication Hub is live. When a POST request hits the webhook URL, it flows through the AI Agent, gets parsed into structured data, and produces a unified output object. Next up, you will build the routing engine that sends each inquiry type down a different path.
Build the Orchestration Engine
Your AI Communication Hub can now receive inquiries and generate intelligent responses. The problem is that every inquiry gets the same treatment. A hot lead asking about premium services should trigger a different workflow than someone asking a basic FAQ question.
In this step, you will build the orchestration layer that routes each inquiry to the correct workflow path based on the AI's categorization. Then you will connect those paths to HubSpot for CRM operations. Finally, you will log everything and return the AI response to the caller.
In this step, get ready to:
- Add routing logic that sends each inquiry type down a different path.
- Create CRM operations in HubSpot for leads, FAQ interactions, and appointment requests.
- Log all interactions to Google Sheets and return the AI response to the webhook caller.
Create routing logic (Layer 3)
The Switch node is n8n's multi-output router. It reads a field from the incoming data and sends the item down a different output depending on its value. You will route on the ai_category field that the Code node produced in the previous step.
- Open your AI Communication Hub workflow in n8n.
- Click the + button after the Set node on the canvas.
- Search for Switch and add it to the workflow.
- In the Switch node panel, set Mode to Rules.
- Click Add Routing Rule to create the first rule.
- Set the data type to String and the comparison to is equal to.
- In the Value 1 field, switch to Expression mode and enter:
{{ $json.ai_category }}
- In the Value 2 field, type new_lead.
- Click Add Routing Rule four more times and repeat the pattern for each category: faq, appointment_request, complaint, follow_up.
- Under Rule Options, set Fallback Output to Extra Output so unrecognized categories still pass through.
What does this node do?
The Switch node examines the ai_category field on each item. If the value matches new_lead, the item exits through Output 0. If it matches faq, Output 1. And so on for each rule.
This is the decision-making brain of the system. Instead of one flat automation, you now have distinct paths that can each do specialized work.
You should now see five output connectors on the Switch node, one for each routing rule.
Switch node only shows one output?
Make sure you added all five routing rules. Each rule automatically creates a new output connector on the node.
If you accidentally used Expression mode instead of Rules mode, the node will ask for a single numeric output index. Switch back to Rules mode in the Mode dropdown.
Help me configure my Switch node to route on ai_category
Build the CRM operations (Layer 4)
Each Switch output now needs its own set of CRM actions. The new_lead path does the most work because it creates both a contact and a deal in HubSpot. The other paths log a lighter-weight record.
- Click the first output (Output 0 / new_lead) on the Switch node and add a HubSpot node.
- In the HubSpot node, set Resource to Contact and Operation to Create/Update.
- Select your HubSpot credential from the Credential dropdown.
- Set Email to the expression {{ $json.email }}.
- Under Additional Fields, add First Name mapped to {{ $json.name }} and Phone mapped to {{ $json.phone }}.
- Name this node Create Contact.
What about the AI score custom property?
HubSpot allows custom contact properties. In a production deployment, you would create a custom property called ai_score in HubSpot's property settings (Settings > Properties > Contact properties > Create property) and map {{ $json.ai_score }} to it in the Additional Fields section.
For this project, you can skip the custom property creation and add the AI score mapping later when deploying for a real client.
- After the Create Contact node, add another HubSpot node.
- Set Resource to Deal and Operation to Create.
- Set Deal Name using this expression to combine the contact name and today's date:
{{ $json.name }} - {{ $now.toFormat('yyyy-MM-dd') }}
- Set Stage using a conditional expression that maps the AI score to a pipeline stage. Items scoring 7 or above go to Qualified, 4 through 6 go to Nurture, and 1 through 3 go to Cold.
- Name this node Create Deal.
How does the deal stage expression work?
Use a ternary expression in the Stage field to evaluate ai_score and return the matching stage name. The exact stage identifiers depend on your HubSpot pipeline configuration. By default, HubSpot Free accounts come with stages you can rename to Qualified, Nurture, and Cold.
Now connect the faq and appointment_request outputs to their own HubSpot nodes.
- Click the second Switch output (Output 1 / faq) and add a HubSpot node.
- Set Resource to Engagement and Operation to Create.
- Configure it to log the interaction as a note engagement. Name this node Log FAQ Engagement.
- Click the third Switch output (Output 2 / appointment_request) and add another HubSpot node.
- Set Resource to Engagement and Operation to Create. Configure it as a task for the business owner to follow up. Name this node Create Owner Task.
Leave complaint and follow_up paths for now
The complaint and follow_up paths can be wired up later with escalation logic. For now, they will still flow through to the logging step you build next. The Merge node you add will collect items from all paths regardless of whether they have a dedicated CRM action.
HubSpot node returning a 401 error?
This means your credential is not connecting. Confirm you selected App Token as the authentication method when creating the HubSpot credential in Step 1. Also verify the token has the required scopes: crm.objects.contacts.read, crm.objects.contacts.write, crm.objects.deals.read, and crm.objects.deals.write.
Help me fix a 401 error with my HubSpot node in n8n
Log all interactions and send the response
Every inquiry, regardless of its category, needs to be logged and returned. You will use a Merge node to bring all the paths back together, then append a row to Google Sheets and send the response back through the webhook.
- Add a Merge node to the canvas.
- Connect the output of each CRM node (Create Deal, Log FAQ Engagement, Create Owner Task) and the remaining Switch outputs (complaint, follow_up, fallback) into the Merge node inputs.
- Set the Merge node Mode to Append. This waits for all connected inputs and passes every item through sequentially.
Why Append mode?
Since only one path fires per webhook execution, the Merge node in Append mode simply passes through whichever branch produced output. It does not try to combine items from different branches. This makes it perfect for reuniting branched workflows.
- After the Merge node, add a Google Sheets node.
- Set Operation to Append Row.
- Under Document, select your SMB AI Dashboard spreadsheet.
- Under Sheet, select the Lead Pipeline tab.
- Set Mapping Column Mode to Map Each Column Manually.
- Map each column to the matching expression: Timestamp to {{ $now.toISO() }}, Name to {{ $json.name }}, Email to {{ $json.email }}, Phone to {{ $json.phone }}, Source to {{ $json.source }}, AI Score to {{ $json.ai_score }}, AI Category to {{ $json.ai_category }}, AI Response to {{ $json.ai_response }}, Status to processed.
What does Map Each Column Manually mean?
This mode lets you explicitly match each spreadsheet column to a value or expression. n8n fetches the column headers from your sheet and presents them as fields you can fill. This guarantees your data lands in the correct columns even if the incoming field names do not exactly match your headers.
- After the Google Sheets node, add a Respond to Webhook node.
- Set Respond With to JSON.
- In the Response Body field, enter this JSON expression to return the AI-generated response:
{
"response": "{{ $json.ai_response }}",
"category": "{{ $json.ai_category }}",
"score": "{{ $json.ai_score }}"
}
What does the Respond to Webhook node do?
This node sends an HTTP response back to whatever system called your webhook. A frontend chat widget, API consumer, or test tool receives this JSON payload. Without this node, the webhook would return a generic 200 status with no useful data.
Make sure your original Webhook node at the start of the workflow has Respond set to Using 'Respond to Webhook' node. Otherwise it will respond immediately and ignore this node.
- Go back to the Webhook node at the start of the workflow.
- Confirm that Respond is set to Using 'Respond to Webhook' node.
- Click Save in the top right corner to save the workflow.
- Toggle the workflow to Active using the toggle in the top right corner.
Your canvas should now show the full flow: Webhook > AI Agent > Code > Set > Switch > (branched CRM nodes) > Merge > Google Sheets > Respond to Webhook.
Google Sheets node failing with a permissions error?
Verify that the Google credential you connected has access to the SMB AI Dashboard spreadsheet. If you used OAuth2, you may need to re-authorize. Open the credential in n8n and click Sign in with Google again to refresh the token.
Help me fix a Google Sheets permissions error in n8n
Your orchestration engine is live. Every inquiry now gets routed, logged, and responded to automatically. Next up, you will build the analytics layer that turns all this logged data into actionable insights for the business owner.
Build the Analytics and Owner Dashboard
Your AI Communication Hub is now routing leads, updating HubSpot, and logging every interaction to the Lead Pipeline tab. The raw data is flowing, but an SMB owner does not have time to read a spreadsheet row by row every morning.
In this step, you will build an analytics layer that reads all Lead Pipeline data, calculates key metrics, and feeds those numbers to an AI model. The AI generates a plain-English summary with actionable recommendations, then writes everything to the Daily Insights tab so the owner can act on it in 30 seconds.
In this step, get ready to:
- Create a scheduled workflow that automatically runs daily to analyze lead data.
- Write a Code node that calculates key business metrics from the Lead Pipeline.
- Connect an AI model that turns those metrics into a plain-English owner briefing.
Create the scheduled analytics workflow
The analytics workflow runs on a schedule, pulls all the data your AI Communication Hub has logged, and crunches it into key business metrics. You will use a Schedule Trigger to fire the workflow daily without anyone clicking a button.
- In your n8n instance, click the + button in the top right to create a new workflow.
- Name the workflow Analytics - Daily Insights.
- Click the + node button on the canvas to add your first node.
- Search for Schedule Trigger and select it.
- Set the Trigger Interval to Days and leave the default at every 1 day.
- Close the Schedule Trigger settings.
Why a Schedule Trigger?
The Schedule Trigger fires your workflow automatically at a fixed interval. For a daily owner briefing, it runs once per day and pulls the latest data without manual intervention.
Now connect a Google Sheets node to read all the lead data that has been accumulating.
- Click the + connector on the Schedule Trigger node.
- Search for Google Sheets and select it.
- Set Operation to Get Many.
- Select your SMB AI Dashboard spreadsheet.
- Select the Lead Pipeline tab.
- Toggle Return All on so you get every row.
Next, add the Code node that calculates your business metrics.
- Click the + connector on the Google Sheets node.
- Search for Code and select it.
- Set Mode to Run Once for All Items.
- Paste the following JavaScript into the code editor:
// Get all rows from the Lead Pipeline sheet
const items = $input.all();
const today = new Date().toISOString().split('T')[0];
// Filter for today's leads based on Timestamp column
const todayLeads = items.filter(item => {
const timestamp = item.json.Timestamp || '';
return timestamp.startsWith(today);
});
// Calculate total leads today
const totalLeads = todayLeads.length;
// Calculate average AI score
const scores = todayLeads.map(item => parseInt(item.json['AI Score']) || 0);
const avgScore = totalLeads > 0
? (scores.reduce((a, b) => a + b, 0) / totalLeads).toFixed(1)
: '0';
// Count leads by category
const byCategory = {};
todayLeads.forEach(item => {
const cat = item.json['AI Category'] || 'unknown';
byCategory[cat] = (byCategory[cat] || 0) + 1;
});
// Count leads by source
const bySource = {};
todayLeads.forEach(item => {
const source = item.json.Source || 'unknown';
bySource[source] = (bySource[source] || 0) + 1;
});
// Find top source
const topSource = Object.entries(bySource)
.sort((a, b) => b[1] - a[1])[0]?.[0] || 'none';
// Conversion funnel by pipeline stage
const byStatus = {};
todayLeads.forEach(item => {
const status = item.json.Status || 'unknown';
byStatus[status] = (byStatus[status] || 0) + 1;
});
// Return calculated metrics as a single output item
return [{
json: {
date: today,
totalLeads,
avgScore: parseFloat(avgScore),
byCategory,
bySource,
topSource,
byStatus,
summary: `Total: ${totalLeads} leads | Avg Score: ${avgScore} | Top Source: ${topSource}`
}
}];
What does this code do?
The Code node receives all rows from your Lead Pipeline sheet via $input.all(). It filters for rows with today's date, then calculates five metrics: total lead count, average AI score, leads grouped by category, leads grouped by source, and the conversion funnel showing how many leads sit in each pipeline stage.
The return format [{ json: { ... } }] is required by n8n. Every Code node must return an array of items where each item wraps its data inside a json key.
- Click Execute step on the Code node to test it.
- You should see a single output item with your calculated metrics. Values may be zero if no test data has today's timestamp.
Seeing an error about return format?
Make sure your code ends with return [{ json: { ... } }]. The Code node requires this specific array-of-objects structure.
Also confirm Mode is set to Run Once for All Items, not Run Once for Each Item.
Help me fix my Code node error in the analytics workflow.
Generate AI-powered insights
Raw numbers tell the story, but a busy SMB owner needs a one-paragraph briefing they can read over coffee. You will connect a Basic LLM Chain node with the OpenAI Chat Model to generate plain-English insights from the metrics.
- Click the + connector on the Code node.
- Search for Basic LLM Chain and select it.
- In the Basic LLM Chain settings, set Prompt to Define below.
- In the Prompt (User Message) field, paste the following prompt:
You are a business analytics assistant for an SMB. Analyze the following daily metrics and provide:
1. A plain-English summary of today's lead activity (2-3 sentences)
2. One specific, actionable recommendation for the business owner
3. Any patterns or concerns worth noting
Today's metrics:
- Date: {{ $json.date }}
- Total leads: {{ $json.totalLeads }}
- Average AI qualification score: {{ $json.avgScore }}/10
- Leads by category: {{ JSON.stringify($json.byCategory) }}
- Leads by source: {{ JSON.stringify($json.bySource) }}
- Top source: {{ $json.topSource }}
- Pipeline stages: {{ JSON.stringify($json.byStatus) }}
Keep it concise and actionable. Write for a non-technical business owner.
What is a Basic LLM Chain?
A Basic LLM Chain sends a prompt to a language model and returns the response. Unlike an AI Agent (which uses tools and makes decisions), a chain handles straightforward text generation tasks. That makes it perfect for summarizing data without needing vector search or tool access.
The {{ $json.totalLeads }} expressions are n8n's template syntax. They dynamically inject the Code node's output values into the prompt at runtime.
Now attach the OpenAI Chat Model sub-node to power the chain.
- On the Basic LLM Chain node, click the + button beneath the Chat Model connection along the bottom of the node.
- Search for OpenAI Chat Model and select it.
- Select your OpenAI credential from the Credential dropdown.
- Set Model to gpt-4o-mini.
- Close the OpenAI Chat Model settings.
Why gpt-4o-mini for analytics?
The gpt-4o-mini model is fast and affordable for summarization tasks. You do not need a larger model here because the input is structured metrics, not complex reasoning. This keeps the daily analytics cost well below one cent per run.
- Click Execute step on the Basic LLM Chain node to test it.
- You should see an AI-generated summary referencing your metrics. If no test data exists with today's date, the summary will report zero activity.
Getting an empty or error response?
Make sure you selected Define below for the Prompt setting, not Take from previous node automatically. The expressions like {{ $json.totalLeads }} reference the output from the previous Code node.
If the model returns nothing, verify your OpenAI credential is working by testing the sub-node directly.
Help me debug my Basic LLM Chain analytics prompt.
Write insights to the Owner Dashboard
The AI has generated a plain-English briefing. Now you will write it to the Daily Insights tab so the business owner has a running log of recommendations they can review any time.
- Click the + connector on the Basic LLM Chain node.
- Search for Google Sheets and select it.
- Set Operation to Append Row.
- Select your SMB AI Dashboard spreadsheet.
- Select the Daily Insights tab.
- Map the columns using expressions that reference the Code node output:
- Date: {{ $('Code').item.json.date }}.
- Total Leads: {{ $('Code').item.json.totalLeads }}.
- Avg Score: {{ $('Code').item.json.avgScore }}.
- Top Source: {{ $('Code').item.json.topSource }}.
- AI Recommendation: {{ $json.text }} (this pulls the Basic LLM Chain output).
Why reference two different nodes?
The $('Code').item.json syntax reaches back to your Code node's output for the numeric metrics. The $json.text shorthand references the immediate previous node (the Basic LLM Chain), which holds the AI-generated recommendation text.
Now format your Google Sheet to serve as a clean owner dashboard.
- Open your SMB AI Dashboard spreadsheet in Google Sheets.
- Navigate to the Daily Insights tab.
- In row 1, add the column headers: Date, Total Leads, Avg Score, Top Source, AI Recommendation.
- Select the Avg Score column (column C).
- Click Format in the menu bar, then select Conditional formatting.
- Add a rule: if the value is greater than or equal to 7, set the background to green.
- Add a second rule: if the value is less than 4, set the background to red.
- Click Done.
Keep the dashboard scannable
Green cells (score 7+) indicate days with high-quality leads. Red cells (score below 4) signal days where lead quality dropped. The owner can spot trends at a glance without reading individual rows.
Finally, activate your workflow and verify the complete chain.
- Back in n8n, toggle the Active switch in the top right of the workflow editor to activate the workflow.
- Click Execute Workflow to manually trigger a test run.
- Check the Daily Insights tab in your Google Sheet. You should see a new row with today's date, lead metrics, and an AI-generated recommendation.
No row appearing in Daily Insights?
Verify your Google Sheets credential has write access. Open the Google Sheets node and confirm the correct spreadsheet and tab are selected.
If the row appears but columns are empty, check that your expression references match the exact node names in your workflow. The name Code in $('Code') is case-sensitive and must match what n8n shows on the node title bar.
Help me fix my Google Sheets append in the analytics workflow.
Your analytics layer is live. Every day, the owner gets a fresh AI briefing without lifting a finger. Next up, you will connect all the layers together and run an end-to-end test with real simulated customer data.
Connect the Layers and Test End-to-End
You have built all seven layers of the AI infrastructure stack as separate workflows. Each one works on its own, but the real power comes from connecting them into a single system that handles a lead from first contact to owner dashboard.
In this step, you will wire the knowledge base into the communication hub so it loads automatically, then send test payloads through the entire system to prove every layer works together.
In this step, get ready to:
- Wire the knowledge base ingestion workflow into the AI Communication Hub as a sub-workflow.
- Send four test webhook payloads simulating different customer types.
- Verify the owner dashboard populates with accurate stats and AI insights.
Wire up the knowledge base to the communication hub
The In-Memory Vector Store persists only within a single execution context. That means when the AI Communication Hub runs on its own, it cannot automatically access the vector store that was populated by the ingestion workflow.
To solve this, you will add an Execute Sub-workflow node at the start of the AI Communication Hub that calls the ingestion workflow before processing any incoming lead. This ensures the knowledge base is always loaded and ready.
- Open the AI Communication Hub workflow in n8n.
- Click the + button on the canvas to add a new node.
- Search for Execute Sub-workflow and select it.
- In the node settings, set Source to Database and select From list.
- Choose the KB - Document Ingestion workflow from the list.
- Leave Wait for Sub-Workflow Completion turned on so the hub waits for the vector store to load before processing the lead.
Now you need to position this node correctly in the workflow so it runs before the AI Agent processes any data.
- Disconnect the connection between the Webhook node and the AI Agent node by clicking the connection line and pressing Delete.
- Connect the Webhook node output to the Execute Sub-workflow node input.
- Connect the Execute Sub-workflow node output to the AI Agent node input.
Why call the ingestion workflow every time?
The In-Memory Vector Store does not persist between separate workflow executions. Each time the AI Communication Hub is triggered by a new webhook, it starts a fresh execution context with an empty vector store.
By calling the ingestion sub-workflow first, you reload the embedded documents into memory before the AI Agent needs them. For a production deployment, you would swap the In-Memory Vector Store for a persistent option like Pinecone or Supabase.
- Open the KB - Document Ingestion workflow.
- Replace the Manual Trigger node with an Execute Sub-workflow Trigger node (search for it and add it as the first node).
- Set the Input data mode to Accept all data.
- Connect the Execute Sub-workflow Trigger output to the Google Drive node that lists your Knowledge Base folder.
- Save the workflow.
- Go back to the AI Communication Hub workflow and save it.
- Verify the flow now reads: Webhook > Execute Sub-workflow > AI Agent > Code > Set > Switch > (CRM paths) > Merge > Google Sheets > Respond to Webhook.
Sub-workflow not showing in the list?
Make sure the KB - Document Ingestion workflow is saved and has no errors. n8n cannot trigger a sub-workflow that has validation errors. Also confirm the Execute Sub-workflow Trigger node is the first node in the ingestion workflow.
Help me troubleshoot my sub-workflow connection in n8n
Test the complete flow with sample data
With all layers connected, it is time to simulate real customer interactions. You will send four different webhook payloads, each representing a different type of inquiry that a real business receives.
- Make sure the AI Communication Hub workflow is published (toggle it to Active in the top-right corner).
- Copy the Production URL from the Webhook node. It will look something like:
http://localhost:5678/webhook/smb-intake
Test URL vs Production URL
n8n provides two webhook URLs. The Test URL is valid for 120 seconds and shows data in the editor. The Production URL works only when the workflow is active (published). Use the Production URL for these tests since you want the full flow to execute.
Send the first test payload simulating a hot lead asking about premium services by running this command in your terminal:
curl -X POST [[WEBHOOK_URL="your n8n production webhook URL"]] \
-H "Content-Type: application/json" \
-d '{
"name": "Sarah Johnson",
"email": "sarah@techstartup.com",
"phone": "555-0101",
"message": "I need your premium service package for my team of 15. What are your enterprise pricing options? We want to start immediately.",
"source": "website_form"
}'
What does this payload simulate?
This is a high-intent lead. The message shows urgency ("start immediately"), mentions team size, and asks about premium pricing. The AI Agent should score this 7+ and route it to the "new_lead" path, creating a contact and deal in HubSpot's "Qualified" stage.
- Send the second test payload simulating a price shopper asking FAQ questions by running:
curl -X POST [[WEBHOOK_URL="your n8n production webhook URL"]] \
-H "Content-Type: application/json" \
-d '{
"name": "Mike Chen",
"email": "mike.chen@gmail.com",
"phone": "555-0202",
"message": "What are your business hours? Do you offer weekend appointments?",
"source": "chat_widget"
}'
- Send the third test payload simulating an appointment request by running:
curl -X POST [[WEBHOOK_URL="your n8n production webhook URL"]] \
-H "Content-Type: application/json" \
-d '{
"name": "Lisa Park",
"email": "lisa.park@company.org",
"phone": "555-0303",
"message": "I would like to book a consultation for next Tuesday afternoon. Can you fit me in?",
"source": "website_form"
}'
- Send the fourth test payload simulating a complaint by running:
curl -X POST [[WEBHOOK_URL="your n8n production webhook URL"]] \
-H "Content-Type: application/json" \
-d '{
"name": "David Brown",
"email": "d.brown@email.com",
"phone": "555-0404",
"message": "I had a terrible experience last week. Nobody showed up for my appointment and I wasted my entire afternoon waiting.",
"source": "email"
}'
Each curl command should return a JSON response containing the AI-generated message. This is what a frontend chat widget or API consumer would receive.
- Check that each response includes an ai_response field with a professional, contextual reply.
- Open HubSpot and verify that new contacts and deals were created.
- Confirm Sarah Johnson's deal is in the "Qualified" stage (score 7+).
- Confirm Lisa Park has a follow-up task created for the business owner.
- Open your Google Sheet and check the Lead Pipeline tab. You should see 4 new rows, one for each test payload.
Webhook returning an error or no response?
Make sure the workflow is toggled to Active. If it is not published, the Production URL will not respond. Also check that the sub-workflow (KB - Document Ingestion) has no errors, since the parent workflow cannot execute if the sub-workflow has issues.
Open the Executions tab in n8n to see what happened during the failed run. Look for red error nodes to pinpoint where the flow broke.
Help me debug my n8n webhook that is not returning responses
Verify the dashboard
The Analytics workflow normally runs on a daily schedule. For testing, you will trigger it manually to confirm it processes the test data and generates useful insights for the business owner.
- Open the Analytics - Daily Insights workflow in n8n.
- Click Test workflow (or press the play button) to manually execute it.
- Wait for all nodes to complete. The OpenAI node may take a few seconds to generate the AI insights.
- Open your Google Sheet and navigate to the Daily Insights tab.
- Confirm a new row was appended with today's date, total leads (4), average AI score, top source, and an AI-generated recommendation.
- Go back to the Lead Pipeline tab and verify all 4 interactions show correct scores and categories.
What should the AI recommendation look like?
The AI insight should be a plain-English summary that an SMB owner can act on without reading spreadsheets. For example, it might note that website forms are your top lead source and recommend investing in your web presence, or flag that a complaint came in and needs immediate attention.
Daily Insights tab is empty after running the analytics workflow?
Check the Google Sheets node configuration in the Analytics workflow. Make sure it is pointing to the correct spreadsheet and the Daily Insights tab name. Also confirm the Code node that calculates stats is receiving rows from the Lead Pipeline tab (click the node to inspect its output).
Help me figure out why my analytics workflow is not writing to the Daily Insights tab
Your full 7-layer AI infrastructure stack is now verified and operational. Every layer connects to the next: webhook intake flows to AI processing, routing sends leads to the CRM, and analytics distills everything into owner-facing intelligence. Next up, you will package this into a reusable template with the Secret Mission.
Secret mission
Build a Reactivation Campaign Workflow
Not every lead converts on the first touch. What if your AI system could automatically identify stale leads and craft personalized re-engagement messages using deep business context? Build a reactivation campaign that brings cold leads back to life.
Clean Up Your Resources
Clean Up Your Resources
Decide whether to keep your resources running, pause them to come back later, or delete them entirely.
This project uses self-hosted n8n and free-tier services, so there are no infrastructure costs. However, any active scheduled workflows will continue making OpenAI API calls, which incur small per-call charges.
Cost warning
The Analytics - Daily Insights workflow runs on a daily schedule and makes OpenAI API calls each time. If left active, this will slowly accumulate API costs (~$0.01-0.02/day). Deactivate or delete scheduled workflows if you are not actively using the system.
Resources you used:
- 4 n8n workflows (AI Communication Hub, KB - Document Ingestion, Analytics - Daily Insights, Reactivation Campaign).
- n8n credentials (OpenAI, Anthropic, Google OAuth, HubSpot App Token).
- Google Sheet: SMB AI Dashboard (with 3 tabs of project data).
- Google Drive folder: SMB Knowledge Base (with 3 sample documents).
- HubSpot Private App and test data (contacts, deals, tasks).
Keep everything running
No action needed. Choose this if you are still actively building or plan to clone the system for a client soon.
- Your workflows will remain active in n8n.
- The daily Analytics workflow will continue running on schedule and making OpenAI API calls.
- HubSpot test data will stay in your CRM.
- Google Sheets and Drive documents will stay in your account.
Pause - I'll come back to this later
Deactivate scheduled workflows to stop API calls while keeping everything intact for later.
- In n8n, open the Analytics - Daily Insights workflow.
- Toggle the workflow from Active to Inactive using the switch in the top-right corner.
- Do the same for the AI Communication Hub workflow to stop the webhook from accepting requests.
- If you built the Secret Mission, deactivate the Reactivation Campaign workflow as well.
- Your credentials, Google Sheets data, and HubSpot records remain untouched.
Delete - I don't want to use this again
Remove all project resources completely. Follow these steps to clean up everything.
Delete n8n workflows:
- In n8n, go to your workflow list.
- For each of the 4 project workflows (AI Communication Hub, KB - Document Ingestion, Analytics - Daily Insights, Reactivation Campaign), click the three-dot menu and select Delete.
Delete n8n credentials:
- In n8n, go to Credentials in the left sidebar.
- Select each credential you created for this project (OpenAI, Anthropic, Google, HubSpot).
- Click Delete on each one.
Delete the HubSpot Private App:
- In HubSpot, go to Settings.
- Select Integrations, then Private Apps.
- Click on your private app, then click Delete at the bottom of the page.
Delete HubSpot test data:
- In HubSpot, go to Contacts and select all test contacts you created.
- Click Delete.
- Go to Sales, then Deals, select all test deals, and delete them.
Delete Google resources:
- In Google Sheets, right-click the SMB AI Dashboard file and select Move to trash.
- In Google Drive, right-click the SMB Knowledge Base folder and select Move to trash.
- Empty your Google Drive trash to permanently remove these files.
That's a Wrap!
That's a Wrap!
Nice work! You have built a complete 7-layer AI infrastructure stack that transforms how SMBs handle their customer operations.
You've learned how to:
- Built a RAG-powered knowledge base that ingests business documents into a vector store, giving your AI agent deep context about the client's services, pricing, and policies.
- Created an AI communication agent that qualifies leads, answers FAQs, and routes inquiries to different CRM workflows automatically in real-time.
- Connected a full orchestration engine to HubSpot with automated pipeline management, AI-powered analytics, and a clean owner dashboard in Google Sheets.
- Secret Mission: Added a reactivation campaign workflow that identifies stale leads and generates personalized re-engagement messages using the knowledge base.
This is no longer a single automation. It is a complete business infrastructure system. Clone it, swap the knowledge base documents and CRM credentials, and deploy for your next client.
Ready to quiz yourself?