← Back to our workVA TECHSAVVY / WORKFLOW LIBRARY

N8N AI AGENT

Facebook support AI agent

57 workflow steps · 52 connections · Facebook + Messenger

Problem

Facebook comments and Messenger inquiries needed timely, knowledge-based replies while allowing a human specialist to take control when needed.

Solution

Built an n8n support system with AI replies, conversation controls, human handoff, Slack responses, pause and resume handling, and deduplication.

Outcome

A managed support workflow with AI responses and clear human conversation control.

For

Facebook pages and support teams.

Automation workflow · n8n
  1. Comment or messageFacebook + Messenger
  2. Skip duplicatesEach message once
  3. AI or human?Conversation control

Who replies

AI
  1. Read knowledgeBusiness document
  2. AI writes replyOpenAI + memory
  3. Reply sentBack to Facebook
Human
  1. Team notifiedSlack
  2. Reply from SlackSent to Facebook
  3. Hand back to AIWhen done

The actual build

Graph
AI Agent → Messenger (main, output 1)AI Agent → isHuman? (main, output 1)Filter → Set Message Mid (main, output 1)Switch → Human (main, output 1)Switch → AI (main, output 2)Switch → Status (main, output 3)Human → Human Reply (main, output 1)Conversation Control → isEmpty? (main, output 1)AI → AI Reply (main, output 1)Status → Status Reply (main, output 1)Schedule Trigger → Get row(s) (main, output 1)Get row(s) → Code in JavaScript (main, output 1)Code in JavaScript → Upsert row(s) (main, output 1)Upsert row(s) → Send a message1 (main, output 1)Notify Team → Extract Notify (main, output 1)New Message → isValid? (main, output 1)New Message → Comment or Messenger (main, output 2)Respond to New Message → Conversation Control (main, output 1)isHuman? → Auto Pause AI (main, output 1)isEmpty? → Send the reply from Previous Messages (main, output 1)isEmpty? → Get a document1 (main, output 2)isValid? → Valid Info (main, output 1)Extract Reply Data → Reply to Slack (main, output 1)Upsert row(s)1 → Reply to Slack1 (main, output 1)Upsert row(s)2 → (Send to Facebook) (main, output 1)Extract Done Data → Upsert row(s)1 (main, output 1)Extract Notify → Switch (main, output 1)Auto Pause AI → Send a message (main, output 1)Reply to Slack → Upsert row(s)2 (main, output 1)Reply to Message from Slack → Extract Reply Data (main, output 1)Done Go Back to AI → Extract Done Data (main, output 1)alreadyProcessed? → Upsert Mid (main, output 2)Simple Memory → AI Agent (ai_memory, output 1)Limit → AI Agent (main, output 1)Get a document1 → Limit (main, output 1)extract comment text + comment_id → Filter1 (main, output 1)Comment or Messenger → Filter (main, output 1)Comment or Messenger → extract comment text + comment_id (main, output 2)Get a document → Limit1 (main, output 1)AI Agent1 → Quick Debug (main, output 1)Simple Memory1 → AI Agent1 (ai_memory, output 1)Limit1 → AI Agent1 (main, output 1)Quick Debug → Comment (main, output 1)Set Message Mid → Deduplicate Lock(Messenger) (main, output 1)Upsert Mid → Respond to New Message (main, output 1)Set Processed Mid → alreadyProcessed? (main, output 1)Deduplicate Lock(Comment) → Get a document (main, output 1)Deduplicate Lock(Messenger) → Set Processed Mid (main, output 1)Edit Fields → Deduplicate Lock(Comment) (main, output 1)Filter1 → Edit Fields (main, output 1)OpenAI Chat Model → AI Agent1 (ai_languageModel, output 1)OpenAI Chat Model1 → AI Agent (ai_languageModel, output 1)AI AgentagentAI AgentFilterfilterFilterSend a messageslackSend a messageSwitchswitchSwitchHumandataTableHumanConversation Con…dataTableConversation ControlAIdataTableAIHuman ReplyhttpRequestHuman ReplyAI ReplyhttpRequestAI ReplyStatus ReplyhttpRequestStatus ReplyStatus dataTableStatus Schedule TriggerscheduleTriggerSchedule TriggerGet row(s)dataTableGet row(s)Code in JavaScri…codeCode in JavaScriptUpsert row(s)dataTableUpsert row(s)Send a message1slackSend a message1Notify TeamwebhookNotify TeamNew MessagewebhookNew MessageRespond to New M…respondToWebhookRespond to New MessageisHuman?ifisHuman?isEmpty?ifisEmpty?isValid?ifisValid?Valid InforespondToWebhookValid InfoExtract Reply Da…setExtract Reply Data(Send to Faceboo…httpRequest(Send to Facebook)Reply to SlackhttpRequestReply to SlackUpsert row(s)1dataTableUpsert row(s)1Reply to Slack1httpRequestReply to Slack1Upsert row(s)2dataTableUpsert row(s)2Extract Done DatasetExtract Done DataExtract NotifysetExtract NotifyAuto Pause AIdataTableAuto Pause AISend the reply f…slackSend the reply from Previous MessagesReply to Message…webhookReply to Message from SlackDone Go Back to …webhookDone Go Back to AIalreadyProcessed?ifalreadyProcessed?Simple MemorymemoryBufferWindowSimple MemoryLimitlimitLimitGet a document1googleDocsGet a document1extract comment …setextract comment text + comment_idComment or Messe…switchComment or MessengerMessengerhttpRequestMessengerCommenthttpRequestCommentGet a documentgoogleDocsGet a documentAI Agent1agentAI Agent1Simple Memory1memoryBufferWindowSimple Memory1Limit1limitLimit1Quick DebugsetQuick DebugSet Message MidsetSet Message MidUpsert MiddataTableUpsert MidSet Processed MiddataTableSet Processed MidDeduplicate Lock…codeDeduplicate Lock(Comment)Deduplicate Lock…codeDeduplicate Lock(Messenger)Edit FieldssetEdit FieldsFilter1filterFilter1OpenAI Chat ModellmChatOpenAiOpenAI Chat ModelOpenAI Chat Mode…lmChatOpenAiOpenAI Chat Model1

57 workflow steps · 52 connections. Teal lines show the main flow; purple lines connect AI models, memory, and tools. Drag to pan; use + to inspect the workflow.