--- id: 'schedule-functions' title: 'Scheduling Edge Functions' description: 'Schedule Edge Functions with pg_cron.' ---
The hosted Supabase Platform supports the [`pg_cron` extension](/docs/guides/database/extensions/pgcron), a simple cron-based job scheduler for PostgreSQL that runs inside the database. In combination with the [`pg_net` extension](/docs/guides/database/extensions/pgnet), this allows us to invoke Edge Functions periodically on a set schedule. ## Examples ### Invoke an Edge Function every minute Make a POST request to a Supabase Edge Function every minute: ```sql select cron.schedule( 'invoke-function-every-minute', '* * * * *', -- every minute $$ select net.http_post( url:='https://project-ref.supabase.co/functions/v1/function-name', headers:='{"Content-Type": "application/json", "Authorization": "Bearer YOUR_ANON_KEY"}'::jsonb, body:=concat('{"time": "', now(), '"}')::jsonb ) as request_id; $$ ); ``` ## Resources - [`pg_net` extension](/docs/guides/database/extensions/pgnet) - [`pg_cron` extension](/docs/guides/database/extensions/pgcron)