Library / AI Agents & Assistants
AI Agents & Assistants
Sell clothing on Facebook Messenger with Gemini, Stripe, and an admin app
When an API call/webhook arrives, it runs an AI agent with Google Gemini using Postgres, Data Table, Google Drive, Stripe.
What it does
### How it works An AI sales agent for a clothing shop on Facebook Messenger, plus its own admin website, all in this one workflow. 1. Customers message your Page. The workflow answers Meta's webhook, ignores duplicates and groups quick messages. 2. A Gemini agent with chat memory answers from your products (exact lookup and search by meaning), manages the cart and saves delivery details step by step. 3. After the customer confirms, it re-prices the cart and sends a Stripe Pay Now button. 4. Stripe confirms the payment: the order is marked Paid, stock goes down and the customer is told. 5. Questions the agent cannot answer wait in the admin Inbox. Failures appear on the Problems page. ### Setup (do it in this order) 1. In n8n: create three credentials: Google Gemini, Postgres (Supabase) and Google Drive. 2. In n8n: select them on the nodes that show a warning, then Publish. 3. In your browser: open /webhook/shop-admin, press "Create database and first login" and choose your own login. 4. In the admin website, open Setup guide, then Settings: connect the Meta app and Facebook Page, then Stripe (test mode first). 5. In the admin website: add Products, press Re-sync all, set the Store information on the Assistant page and try Test chat. 6. In Messenger: send a test order from a tester account. ### Customization Edit the store name, tone and shop information on the Assistant page. ### Walkthrough video (2 min) https://drive.google.com/file/d/1HchY8S2IfqyadX-hvK1-ZiTB1pnUUkCl/view?usp=sharing
The steps
- Meta Webhook Trigger
- Verify Webhook Handshake
- Confirm Webhook Subscription
- Acknowledge Event (200 OK)
- Filter Page Events
- Split the page record
- split out each message
- Is Real Customer Message
- Process Each Message Separately
- When Called By This Workflow
- Message Context
- Find Processed Message
- Is New Message
- Remember Message ID
306 steps in total.
Similar automations
RAG & Knowledge BasesRun a RAG Messenger chatbot with Facebook, Google Drive, Supabase, OpenAI and OpenRouter36 stepsSocial Media PublishingReceive and send WhatsApp, Instagram and Messenger messages through Fiwano4 stepsImage, Video & AudioGenerate AI Virtual Try-On Images for WooCommerce Clothing13 stepsBuilding Blocks & UtilitiesCreate, Update and Get a G Suite Admin User4 steps