Skip to content

convex/runsActions.ts

Purpose

Internal action to sync a single run to the durable Postgres store via signed webhook.

Public Surface

  • internalSyncToPg({ runId }): fetches run, signs body with RUNFORGE_SYNC_SIGN, POSTs to RUNFORGE_SYNC_URL, marks run synced on 200 OK.

Behavior & Invariants

  • No‑op if run not found or env missing.
  • HMAC SHA‑256 signature in X-RF-Signature header.

Dependencies

  • Depends on: api.runs.getById, internal.runs.markSynced.
  • Used by: runs.ingestRun, runs.ingestRuns via scheduler.

Error Handling

  • Ignores network errors; does not retry explicitly.

Configuration & Flags

  • RUNFORGE_SYNC_URL, RUNFORGE_SYNC_SIGN must be set.

TODO / Technical Debt

  • Add retry/backoff and DLQ for failures.