Skip to main content

Edge Function: workflow-executor-worker

Trigger: pg_cron (every minute)
Auth: Service role (via util.invoke_edge_function)

Response Contract

Error Response


RPC: fw_enqueue_form_submission_automation

Purpose: User-callable enqueue path for form-submission automation (Path A fallback).

Signature

Parameters

Returns

UUID of the created fw_workflow_executions record, or NULL if no matching rules found.

RPC: fw_claim_queued_executions

Purpose: Fallback claim path when pgmq is unavailable. Uses FOR UPDATE SKIP LOCKED.

Signature

Parameters

Behavior

  1. Selects fw_workflow_executions with status IN ('queued', 'retry_pending') and next_retry_at <= now()
  2. Locks rows with FOR UPDATE SKIP LOCKED
  3. Updates status to running
  4. Returns claimed records

Queue Message Schema

workflow_execution_queue Message

workflow_dlq Message


Semaphore Columns (fw_module_settings)