Skip to main content
BlueprintPersistenceError is a structured diagnostic sink for failures that occur during blueprint run persistence — replacing silent logger.error catches in BlueprintStorageService.persistStep and the runInBackground helper. Each row records the phase of the blueprint pipeline that failed, the associated run ID, the workspace context (nullable for pre-auth failures), and the full error detail including message, type, stack, and an arbitrary JSON payload. Rows are pruned opportunistically after 30 days (~1-in-20 writes trigger cleanup), mirroring the connector_sync_diagnostics retention pattern. The entity is append-only and owned entirely by the system — no user-facing PATCH route exists.
Internal object. Not currently exposed on the public REST API. The operations below describe the intended contract.

API operations

Data model

Attributes

Relationships

System-computed

  • error_id: generated by gen_random_uuid() at the database level on insert; never supplied by callers
  • created_at: set by MikroORM onCreate hook (also defaulted to now() in the DDL); no updated_at column exists — the entity is append-only
  • deleted_at: managed by application-level retention logic inside BlueprintPersistenceErrorService.write(), which prunes rows older than 30 days on approximately 1-in-20 writes; no scheduled job is required
  • Retention sampling: the ~1/20 probabilistic pruning is designed to avoid a dedicated cron; the window may allow rows to survive slightly beyond 30 days
  • Workspace nullability: workspace_pk is nullable by design to capture pre-auth failures; Hasura user-role select_permissions filter by workspace.workspace_id, making null-workspace rows admin-only

Example

Source: apps/api/src/database/entities/BlueprintPersistenceError.ts · domain: automation · tier: Activity