Skip to content
NEWMarketplace and your team: sell what you build, and get plans and changes that are tested before you see them. See what is new

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

  1. Meta Webhook Trigger
  2. Verify Webhook Handshake
  3. Confirm Webhook Subscription
  4. Acknowledge Event (200 OK)
  5. Filter Page Events
  6. Split the page record
  7. split out each message
  8. Is Real Customer Message
  9. Process Each Message Separately
  10. When Called By This Workflow
  11. Message Context
  12. Find Processed Message
  13. Is New Message
  14. Remember Message ID

306 steps in total.

Similar automations