typebot.io icon indicating copy to clipboard operation
typebot.io copied to clipboard

Migrate chat API to a standalone server

Open baptisteArno opened this issue 1 year ago • 4 comments

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.

baptisteArno avatar Jan 15 '24 08:01 baptisteArno

Make sure to test:

  • [ ] CORS
  • [ ] Streaming
  • [ ] Rollbacks
  • [ ] WhatsApp
  • [ ] CI
  • [ ] Monitoring
  • [ ] No-downtime rescale

baptisteArno avatar Feb 26 '24 14:02 baptisteArno

Blocked by https://github.com/coollabsio/coolify/issues/1784. Can't deploy a preview for now

baptisteArno avatar Feb 26 '24 17:02 baptisteArno

https://github.com/coollabsio/coolify/issues/1791

baptisteArno avatar Feb 29 '24 10:02 baptisteArno

Need to plug Grafana to monitor the server now.

baptisteArno avatar Mar 04 '24 17:03 baptisteArno

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

baptisteArno avatar Mar 20 '24 07:03 baptisteArno