π Building a Production Facebook Messenger β AI Pipeline with MyZubster & Zorgax
We just shipped a new integration in the MyZubster open-source ecosystem: Zorgax, our AI copilot, can now receive and answer messages directly through Facebook Messenger.
The production flow is:
Messenger β Meta Webhook β MyZubster API β Zorgax β Meta Send API β Messenger
Getting the webhook to return 200 was only part of the job.
One interesting production issue appeared after the webhook was already receiving Messenger events correctly: Meta received its 200 OK, but the asynchronous Zorgax processing that followed could be interrupted in the serverless environment.
The solution was to keep Meta's acknowledgement fast while explicitly keeping the background work alive with Vercel's waitUntil().
We also implemented and verified:
Meta webhook challenge verification
X-Hub-Signature-256 request validation
secure environment-based App Secret and Page Access Token handling
Messenger event processing
MongoDB connectivity
Zorgax AI processing
Meta Send API responses
multilingual conversations
production deployment on Vercel
The final production trace now looks like:
POST /api/meta/messenger/webhook β 200
Connected to MongoDB
[meta-messenger] {"event":"message_handled","mode":"zorgax"}
And, most importantly, the response actually makes the full trip back to the Messenger conversation. π―
The code is open source
The serverless/background-processing fix was shipped in:
PR #1007 β fix(messenger): keep Zorgax reply alive after webhook ack
Read PR #1007 on GitHub
Explore the MyZubster repository
Visit MyZubster
This was a good reminder that βthe webhook returned 200β doesn't necessarily mean the workflow completedβespecially when asynchronous AI work happens after the HTTP response in a serverless environment.
Now Zorgax has another gateway into the MyZubster ecosystem, and the implementation is available for other developers to inspect, improve, and build on.
Open source. Production tested. Community built.