Answer Facebook Messenger product questions with OpenAI and Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 20 nodes and runs on Facebook events. Along the way it connects Facebook, OpenAI Chat Model, Google Sheets and Facebook Graph API.
How it runs
Trigger: On Facebook events.
- Split Out: splits a list into separate items
- Split Out: splits a list into separate items
- Check Valid Customer Message (If): checks a condition and branches into true / false
- Configuration (Edit Fields (Set)): sets 7 fields: openai_model, model_temperature, match_confidence_threshold…
- Log Skipped Event to Google Sheets (Google Sheets): append
- AI – Extract Product & Customer Intent (AI Agent): runs an AI agent, with model: OpenAI Model — Intent Extraction; output parser: Structured Output Parser
- Fetch Inventory Records from Google Sheets (Google Sheets): uses Google Sheets
- Combine Intent + Inventory Data (Merge): merges the data from its input branches
- Aggregate: combines items into one
- Prepare Product Matching Payload (Edit Fields (Set)): sets 3 fields: product_query, customer_intent, inventory_list
…plus 5 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (11)
- Facebook Trigger
n8n-nodes-base.facebookTrigger - Split Out
n8n-nodes-base.splitOut - If
n8n-nodes-base.if - Edit Fields (Set)
n8n-nodes-base.set - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Merge
n8n-nodes-base.merge - Google Sheets
n8n-nodes-base.googleSheets - Aggregate
n8n-nodes-base.aggregate - Facebook Graph API
n8n-nodes-base.facebookGraphApi
From the author
Quick overview This workflow listens for new Facebook Messenger messages, uses OpenAI to extract the requested product and intent, checks the request against an inventory stored in Google Sheets, replies via the Facebook Graph API, and logs skipped events and…