supabase / workflows

Apache License 2.0
134 stars 5 forks source link

XState V5 [currently Alpha] #3

Open guy-borderless opened 1 year ago

guy-borderless commented 1 year ago

Feature request

The next version of xstate (V5) seems geared towards server environments, so it might be an ergonomic (and OSS) approach to supabase workflows. Some things I'd like to put in my shopping cart:

  1. ensured edge functions compatibility
  2. actor.send() resolution to a machine stored in supabase
  3. viewing a workflow persisted to a JSONB field in supabase ui using the xstate visualizer
  4. cron / delayed transitions built-in
  5. automatic logging / events table I can subscribe to / subscribing to specific machine events from the supabase client
kiwicopple commented 1 year ago

server environments

interesting. Do you know if they will be building a multi-tenant runtime? (eg, serve multiple customers with a single server)

That's our typical constraint at supabase - it's very hard to host a server per customer now

guy-borderless commented 1 year ago

multi-tenant runtime

So I suppose normally splitting schemas is enough, not in your case right?

kiwicopple commented 1 year ago

that's a start (generally it would be a different database for security reasons though, and with supabase that config would live inside their database)

the trick here is that the server needs to hold open a connection to thousands of databases, and Node isn't great for that sort of thing (compared to, say, elixir). Then you get spiky workloads, noisy neighbors, excecution isolation, etc.

it's not impossible, but we'd need to make sure it's an explicit goal of XState (which I doubt many people will be asking for)

guy-borderless commented 1 year ago

This is an interesting integration of Xstate and temporal https://github.com/Devessier/temporal-electronic-signature