SupabaseS
Supabase2mo ago
tomi

[URGENT] supabase queue + cron

Hi I’m building an app that needs to process analysis for multiple users. I want to use Supabase Queues + Cron to handle this efficiently.

[A] Here’s my setup:

  1. I have an Edge Function that processes analysis for a single user (takes ~30s max due to OpenAI calls)
  2. I need to process 1000s of users daily
  3. I want to use Supabase Queues to ensure users and process them in batches
  4. I want to use Supabase Cron to trigger the processing every few minutes.
[B] Questions:

  1. Is this the right approach for batch processing with Supabase Queues?
  2. What’s the recommended batch size to stay under the 60s Edge Function timeout?
  3. For local development, should I use the official PGMQ or create a simple database table?
  4. Any best practices for handling OpenAI API timeouts in queue processing?
Was this page helpful?