typebot.io
typebot.io copied to clipboard
Migrate chat API to a standalone server
Serverless environment is not suitable for Typebot's chat API as it can execute long running processes (AI stuff mostly).
There is for example an issue with the WhatsApp webhook retrying the request when the execution takes more than ~10 seconds. Resulting in duplicate messages sent.
A standalone server will allow us to send back a "OK" response to WhatsApp while still processing the blocks to send afterwards.
Make sure to test:
- [ ] CORS
- [ ] Streaming
- [ ] Rollbacks
- [ ] CI
- [ ] Monitoring
- [ ] No-downtime rescale
Blocked by https://github.com/coollabsio/coolify/issues/1784. Can't deploy a preview for now
https://github.com/coollabsio/coolify/issues/1791
Need to plug Grafana to monitor the server now.
I am going to gradually introduce it to production. First only consuming this API from a specific typebot of my own, then others.
I prefer doing it that way to make sure everything works smoothely in production