Skip to main content
A blueprint_run records a single execution of the Blueprint Analyzer — Well’s multi-phase web-navigation agent (Claude Opus) that autonomously browses a target URL to accomplish a natural-language goal. Each run belongs to exactly one workspace and progresses through a lifecycle (queued → running → persisting → completed | failed | abandoned). The run is the audit spine for the analysis session: it captures the high-level intent (goal, target_url), the agent’s final synthesized output (result_blueprint), and — on failure — structured error diagnostics (error_type, error_message, failed_at_step, error_context). Individual navigation actions are stored as child BlueprintStep records linked by a one-to-many relationship.

API operations

Data model

Attributes

Relationships

System-computed

  • blueprint_run_id is generated by Postgres gen_random_uuid() on insert; unique constraint enforced at the DB level.
  • created_at is set by the MikroORM onCreate lifecycle hook on first flush; never updated.
  • updated_at is set by both onCreate and onUpdate lifecycle hooks; refreshed on every write to the record.
  • status defaults to running at the DB level; the controller may set it to queued when enqueuing before agent dispatch. BlueprintStorageService drives transitions: running → persisting at start of persist, then persisting → completed on success or persisting → failed on error.
  • step_count is incremented atomically by BlueprintStorageService.persistStep (not derived from the child collection) so it is consistent even when child rows are soft-deleted.
  • completed_at is written by BlueprintStorageService when the run reaches completed or failed status. It is never set for abandoned runs.
  • result_blueprint is written from aiResponse.blueprint by BlueprintStorageService only on the final successful step (terminal completed transition).
  • failed_at_step and error_context are written together by BlueprintStorageService when the agent reports a terminal error; error_context captures the raw aiResponse payload for replay.
  • Both partial indexes (idx_blueprint_runs_workspace_status on (workspace_pk, status) and idx_blueprint_runs_created_at_desc on (created_at DESC)) filter WHERE deleted_at IS NULL, so they apply only to active rows.
  • Cascade deletes flow from workspace → blueprint_runs → blueprint_steps via FK ON DELETE CASCADE chains.

Example

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