Skip to main content
Feature: PF-82 Business Process Registry Last Updated: 2026-03-17

Scheduled Jobs

PF-82 registers three pg_cron schedules. If pg_cron is unavailable, these operations can be triggered manually via SQL or the Supabase dashboard.

1. Daily Process Discovery

  • Schedule: 0 2 * * * (02:00 UTC daily)
  • Function: pf_discover_business_processes(org_id)
  • Purpose: Scans fw_automation_rules and fw_workflow_definitions to discover new business processes and update existing ones.
  • Manual trigger:

2. Health Refresh (Every 5 Minutes)

  • Schedule: */5 * * * *
  • Function: pf_refresh_process_health(org_id)
  • Purpose: Recalculates composite health scores for all active business processes using the 4-component formula (Success Rate, SLA Compliance, Latency, DLQ Rate).
  • Manual trigger:

3. Daily Metric Snapshots

  • Schedule: 55 23 * * * (23:55 UTC daily)
  • Function: pf_snapshot_process_metrics()
  • Purpose: Captures daily snapshots of process health and execution metrics for trend analysis.
  • Manual trigger:

Fallback: Dashboard-Based Scheduling

If pg_cron is not installed:
  1. Supabase Dashboard → Database → Extensions — Enable pg_cron
  2. Re-run the migration or manually create the schedules:

Monitoring

  • Check cron.job_run_details for execution history
  • Process health changes are logged to pf_notifications for org admins
  • Edge function pf-refresh-health logs to Supabase function logs with correlation IDs