{
“name”: “Messenger”,
“nodes”: [
{
“parameters”: {
“multipleMethods”: true,
“path”: “c2b140b1-c1ec-44a3-9349-f51179ea6493”,
“responseMode”: “responseNode”,
“options”: {}
},
“type”: “n8n-nodes-base.webhook”,
“typeVersion”: 2.1,
“position”: [
-128,
0
],
“id”: “0c659bd6-f3a2-4ed7-bf62-39b5e07b14da”,
“name”: “Webhook”,
“webhookId”: “c2b140b1-c1ec-44a3-9349-f51179ea6493”
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“id”: “f7a87656-5cb2-42df-89d9-b81f1ae8bc7a”,
“leftValue”: “={{ $json.query[‘hub.mode’] }}”,
“rightValue”: “subscribe”,
“operator”: {
“type”: “string”,
“operation”: “equals”
}
},
{
“id”: “935d1d91-102a-40ae-8222-e0695bda09b2”,
“leftValue”: “={{ $json.query[‘hub.verify_token’] }}”,
“rightValue”: “PARR8”,
“operator”: {
“type”: “string”,
“operation”: “equals”
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.3,
“position”: [
-176,
-400
],
“id”: “7a09a2de-f5c2-4bc8-ad87-dfd39d8e4545”,
“name”: “If”
},
{
“parameters”: {
“respondWith”: “text”,
“responseBody”: “={{ $(‘Webhook’).item.json.query[‘hub.challenge’] }}”,
“options”: {}
},
“type”: “n8n-nodes-base.respondToWebhook”,
“typeVersion”: 1.5,
“position”: [
64,
-448
],
“id”: “57dee9f3-bd6a-48b2-a020-d8f8ff3c0b55”,
“name”: “Respond to Webhook”
},
{
“parameters”: {
“content”: “## Webhook Reponse\n\nPermanent\nDeveloper.facebook.com”,
“height”: 208,
“width”: 720
},
“type”: “n8n-nodes-base.stickyNote”,
“position”: [
-416,
-480
],
“typeVersion”: 1,
“id”: “3230464b-89cd-46a1-a08f-edc58b135dff”,
“name”: “Sticky Note”
},
{
“parameters”: {
“promptType”: “define”,
“text”: “={{ $json.body.entry[0].messaging[0].message.text }}”,
“options”: {
“systemMessage”: “You are a helpful assistant for a delivery services your job is to understand the message if its not in english you should convert it to english then get the ordered items and quantity and where to get the order”
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 3,
“position”: [
128,
-48
],
“id”: “6851f6d5-b0b2-40d1-b16b-2a7e003df656”,
“name”: “AI Agent”
},
{
“parameters”: {
“model”: {
“__rl”: true,
“mode”: “list”,
“value”: “gpt-4.1-mini”
},
“builtInTools”: {},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.3,
“position”: [
112,
176
],
“id”: “6209df1a-978c-4a97-a745-a8da09310907”,
“name”: “OpenAI Chat Model”,
“credentials”: {
“openAiApi”: {
“id”: “pn9QyaA4uZJLSySG”,
“name”: “n8n free OpenAI API credits”
}
}
},
{
“parameters”: {
“method”: “POST”,
“url”: “=https://graph.facebook.com/v24.0/{{ $(‘Webhook’).item.json.body.entry[0].messaging[0].recipient.id }}/messages”,
“sendQuery”: true,
“queryParameters”: {
“parameters”: [
{
“name”: “access_token”,
“value”: “=EAAMeCk4P3RwBQD3O5GE6Q3Rc7RoFYracMoIXgloeC9qrmWkaykENZAO1CZBQLMJkuD37rKbdDiCebwFHc4JqjYhaChSiJM02Vzm0tY5NBWV8jNTVOxqmmqtCunNujM2wGKLnpBgdFV4LZASXQDcb0UM6Pdum7wJGludPHqo3yVLeZChrHcQxfIO1xp5UZCoDM6oVit5bUFs2OPigQ8zCjWZCuylwZDZD”
}
]
},
“sendBody”: true,
“specifyBody”: “json”,
“jsonBody”: “={\n “recipient”: {\n “id”: “{{ $(‘Webhook’).item.json.body.entry[0].messaging[0].sender.id }}”\n },\n “messaging_type”: “RESPONSE”,\n “message”: {\n “text”: “{{ $json.output }}”\n }\n}”,
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.3,
“position”: [
688,
-128
],
“id”: “54fb40f0-bfde-4422-aeb7-8f4b8aa92f84”,
“name”: “HTTP Request”
},
{
“parameters”: {
“content”: “## PROCEDURES \nthis is where u set up the request for reply\n\n1. import curl from messenger https://developers.facebook.com/docs/messenger-platform/send-messages\\n\\n2 edit the url and body expression\n\n\nNOTE:\n\nTutorial source \n\nhttps://www.youtube.com/watch?v=ieFnSN2Gvs4”,
“height”: 496,
“width”: 576
},
“type”: “n8n-nodes-base.stickyNote”,
“position”: [
656,
-480
],
“typeVersion”: 1,
“id”: “07ff8e3e-de03-4332-a95e-3b728ce06402”,
“name”: “Sticky Note2”
},
{
“parameters”: {
“content”: “##SYSTEM MESSAGE\nAi Instruction Use Ai to Prompt \n\nand Be specific about the instruction then put a step by step procedure\n\nput a description if tools available or put on how the ai will use the tools \n”,
“height”: 432,
“width”: 448
},
“type”: “n8n-nodes-base.stickyNote”,
“position”: [
64,
-256
],
“typeVersion”: 1,
“id”: “57668e58-3d08-43d9-9f93-87184a5e00ab”,
“name”: “Sticky Note5”
}
],
“pinData”: {},
“connections”: {
“Webhook”: {
“main”: [
[
{
“node”: “If”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “AI Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“If”: {
“main”: [
[
{
“node”: “Respond to Webhook”,
“type”: “main”,
“index”: 0
}
]
]
},
“OpenAI Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “AI Agent”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“AI Agent”: {
“main”: [
[
{
“node”: “HTTP Request”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“active”: false,
“settings”: {
“executionOrder”: “v1”
},
“versionId”: “c10a7535-ec6b-4724-b8b5-aeb3eda5ba4f”,
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “014c209c49b0ec0ae997dbac8e4795d4e74fbce543a9dc5da0cd0b7f61c53cb1”
},
“id”: “PZIa8UG83nnKHtRE”,
“tags”:
}
Chat-Based Order Processing Workflow (Concept Overview)
I am designing a chat-based order automation workflow using n8n and AI with the following objectives:
-
Customer Interaction Channel
Customers initiate orders by sending messages to my Facebook Page Messenger. -
AI-Powered Message Processing
Incoming messages are received by the workflow and processed by an AI component that:-
Interprets unstructured chat messages
-
Extracts structured order information
-
-
Multilingual Support (Waray-Waray to English)
Since most customers will not use English, the AI will:-
Detect messages written in Waray-Waray (Philippine dialect)
-
Translate the content into English prior to processing
-
Use the translated text as the basis for order understanding and extraction
-
-
Order Data Extraction Requirements
The AI should extract and normalize the following details:-
Ordered Items
-
Item name
-
Quantity
-
-
Order Source
-
Vendor or store name
-
Support for multiple items from multiple sources within a single message
-
-
Delivery Location
- Barangay or specified delivery area
Example Input (Customer Message):
“Chicken 1pc from Jollibee and burger plain 2pcs from McDonald’s, deliver to Barangay E.”Expected Structured Output:
-
Ordered Item: Chicken, Quantity: 1 pc, Source: Jollibee
-
Ordered Item: Burger (Plain), Quantity: 2 pcs, Source: McDonald’s
-
Delivery Location: Barangay E
-
-
Workflow Goal (Initial Phase)
The primary goal of this first iteration is to reliably transform free-text chat messages into clean, structured order data that can later be:-
Stored in a database or Google Sheets
-
Used for order confirmation messages
-
Integrated with downstream fulfillment or delivery workflows
-
