Phase 1 β€” AI Chatbot System | Maracade Technologies
πŸ€– PHASE 1

AI Chatbot System

Build a real AI customer support chatbot for Maracade Technologies using n8n, OpenAI, WhatsApp Cloud API, and Google Sheets. This visual lab lesson teaches you how to automate replies, answer customers instantly, and build your first AI agent system.

Course AI Agent Rental Company
Duration 2 Hours 45 Minutes
Difficulty Beginner Friendly
Subtitle AI Chatbot System
Lesson Progress

Lesson Overview

🎯

What You Will Learn

Learn how to connect AI with WhatsApp and automate customer support replies using OpenAI and n8n workflows.

🧰

Tools Needed

n8n, OpenAI API key, Meta Developer Account, WhatsApp Cloud API, and Google Sheets.

πŸ“š

Prerequisites

Basic computer knowledge and ability to use a browser. No coding experience required.

πŸš€

Final Outcome

A working AI chatbot that answers customers automatically through WhatsApp messages.

Prompt Engineering Guide

🧠

What Are Prompts?

Prompts are instructions you give to AI systems so they know how to behave and respond to users.

⚑

Why Prompts Matter

Better prompts create smarter AI replies, improve customer support quality, and reduce wrong answers.

πŸ“¦

Prompt Structure

A strong prompt contains role, rules, tone, product information, and response style instructions.

OpenAI System Prompt
You are a professional AI support agent for Maracade Technologies.

Rules:
- answer politely
- provide prices
- explain payment methods
- keep answers short
- suggest next action

WhatsApp Cloud API Setup

1

🧾 Create Meta Developer Account

Visit Meta for Developers and create a developer account using your Facebook account. This allows you to access WhatsApp Cloud API services.

Buttons to click:
β€’ Get Started
β€’ Continue
β€’ Verify Email

πŸ“· Meta Developer Dashboard Screenshot Placeholder
Tip: Use a real Facebook account because Meta may require verification later.
Common Mistake: Many beginners create a personal app instead of a business app.
2

πŸ“± Create Facebook App

Inside Meta Developer Dashboard click β€œCreate App” and select β€œBusiness” as the app type.

Required settings:
β€’ App Name
β€’ Contact Email
β€’ Business Type

πŸ“· Facebook App Creation Screenshot Placeholder
Tip: Use a clear app name like β€œMaracade AI Chatbot”.
Common Mistake: Choosing the wrong app category can block WhatsApp features.
3

πŸ’¬ Enable WhatsApp Cloud API

Open your app dashboard and add the WhatsApp product from the products section.

πŸ“· WhatsApp Product Setup Screenshot Placeholder
Tip: Meta provides a temporary test phone number for development.
Common Mistake: Forgetting to verify your phone number before testing.
4

πŸ”‘ Generate Access Token

Open the API Setup page and copy the temporary access token generated by Meta.

πŸ“· Access Token Screenshot Placeholder
Tip: Store the token safely because it is required in n8n.
Common Mistake: Expired temporary tokens cause authentication failures.
5

πŸ“ž Copy Phone Number ID

Locate your WhatsApp Phone Number ID inside API setup settings and copy it.

πŸ“· Phone Number ID Screenshot Placeholder
Tip: You will use this inside the HTTP Request URL in n8n.
Common Mistake: Confusing Business Account ID with Phone Number ID.
6

πŸ”Œ Connect Credentials Inside n8n

Inside n8n create credentials for OpenAI and HTTP Request authorization headers.

πŸ“· n8n Credentials Screenshot Placeholder
Tip: Use environment variables later for security.
Common Mistake: Typing Bearer token incorrectly inside Authorization header.

Meta Configuration Flow

Meta Developer ↓ Facebook App ↓ WhatsApp API ↓ Access Token ↓ n8n HTTP Request ↓ Customer Replies

Meta Developer

Main platform where you create apps and manage APIs.

Facebook App

Container that holds your WhatsApp Cloud API integration.

WhatsApp API

Service that sends and receives WhatsApp messages automatically.

Access Token

Secret authorization key used by n8n to connect with Meta servers.

n8n HTTP Request

Node that sends customer replies from AI directly into WhatsApp.

Customer Replies

Final automated messages delivered instantly to customers.

Step-by-Step Visual Lab

1

πŸ›  Create Workflow

Open n8n dashboard and click β€œNew Workflow”.

πŸ“·Workflow Creation Screenshot
Tip: Rename the workflow immediately.
2

🌐 Add Webhook Node

Add a Webhook node to receive WhatsApp messages from Meta.

Webhook Path Example
/whatsapp-ai-webhook
πŸ“·Webhook Node Screenshot
3

πŸ€– Add OpenAI Chat Node

Connect OpenAI Chat Model node after the webhook.

πŸ“·OpenAI Node Screenshot
Tip: Use GPT-4o-mini for cheaper testing.
4

πŸ” Configure Credentials

Paste your OpenAI API key and Meta access token into n8n credentials.

πŸ“·Credentials Screenshot
5

πŸ“Š Feed AI With Product Data

Connect Google Sheets node so the AI can read products and prices.

πŸ“·Google Sheets Screenshot
Tip: Create columns for Product, Price, and Payment Method.
6

πŸ“¨ Add HTTP Request Node

Use HTTP Request node to send messages back to WhatsApp customers.

πŸ“·HTTP Request Screenshot
7

βš™ Configure WhatsApp Request

Add Meta API URL and Authorization header.

WhatsApp API URL
https://graph.facebook.com/v19.0/PHONE_NUMBER_ID/messages
πŸ“·WhatsApp Request Screenshot
8

πŸ§ͺ Test Chatbot

Send a WhatsApp message to your test number and verify AI responses.

πŸ“·Testing Screenshot
Tip: Test greetings, product requests, and payment questions.

Code Lab Section

WhatsApp API Request Example
{
  "messaging_product": "whatsapp",
  "to": "25261XXXXXXX",
  "type": "text",
  "text": {
    "body": "Hello πŸ‘‹ Smart Watch is available."
  }
}
OpenAI Prompt Example
{
  "role": "system",
  "content": "You are an AI support agent for Maracade Technologies."
}
Webhook Payload Example
{
  "from": "25261XXXXXXX",
  "message": "Do you have Smart Watch?"
}
JSON Product Example
{
  "product":"Smart Watch",
  "price":"25",
  "payment":"EVC Plus"
}
HTTP Request Body Example
{
  "headers": {
    "Authorization": "Bearer YOUR_TOKEN"
  }
}

Live Test Conversation

Do you have Smart Watch?
Hello πŸ‘‹

Yes Smart Watch is available.

Price: $25

Payment:
β€’ EVC Plus
β€’ Sahal

Workflow Structure

Webhook Trigger ↓ OpenAI Chat Node ↓ Google Sheets Product Data ↓ IF Node ↓ WhatsApp API Node ↓ Customer Reply

Webhook Trigger

Receives messages from WhatsApp customers.

OpenAI Chat Node

Processes customer questions using AI.

Google Sheets

Stores product names, prices, and payment methods.

IF Node

Checks conditions before sending replies.

WhatsApp API Node

Sends the final AI-generated reply to the customer.

Customer Reply

User receives automated support instantly.

Knowledge Check

1. What does the Webhook node do?

Receives incoming customer messages
Creates Facebook accounts
Designs websites

2. Why is the Access Token important?

It authorizes API communication
It creates Google Sheets
It changes WhatsApp colors

3. Which node sends WhatsApp replies?

IF Node
HTTP Request Node
Webhook Node
Quiz Score: 0/3

Common Errors & Fixes

❌ Invalid Token

Your access token expired or was copied incorrectly.

Fix:
β€’ Generate new token
β€’ Re-copy carefully
β€’ Add Bearer before token

❌ Webhook Failure

Meta cannot reach your webhook URL.

Fix:
β€’ Activate workflow
β€’ Use public URL
β€’ Verify webhook URL

❌ Wrong API URL

Incorrect Meta endpoint used.

Fix:
β€’ Verify version number
β€’ Use Phone Number ID

❌ OpenAI Credential Issue

OpenAI API key missing or invalid.

Fix:
β€’ Re-add API key
β€’ Test account balance

❌ WhatsApp Permission Error

Business verification or permissions missing.

Fix:
β€’ Complete Meta verification
β€’ Enable permissions

Lesson Complete

You completed Phase 1 of the AI Agent Rental Company course.

πŸŽ‰ Congratulations!

You successfully finished the AI Chatbot System lab lesson for Maracade Technologies.

Next Lesson Preview

Phase 2 β€” AI Product Database & Smart Product Search System