run_full_comparison orchestrator
Queue pages for background comparison — full pipeline or manual subset re-run
Overview
Queue pages in a cloning job for comparison. A global background worker processes pages one at a time, ordered by backlink importance (most important first). The queue is database-backed, so it survives server restarts. Pages already queued are deduplicated automatically. Supports three modes: 'new' (default — only uncompared pages, triggers post-scan enrichment cascade), 'all' (reset and rerun every page, also triggers cascade), and 'manual' (re-queue without firing the cascade — useful for refreshing a subset of pages without re-running shared-element / nav / design-system / media extraction).
How It Works
- Marks eligible pages as 'pending' in the database queue.
- A global background worker claims pages one at a time using database locking (FOR UPDATE SKIP LOCKED).
- Pages are processed in order of backlink rank (highest first).
- Each page is compared using Zyte JS rendering + DataForSEO enrichment.
- Failed pages are retried up to 3 times before being marked as errors.
- Issues are synced to the database for stateful tracking.
- Queue state persists across server restarts — stuck pages are automatically recovered.
- Mode 'manual' marks pages with manually_queued=TRUE so the post-scan cascade (deduplication, behaviors, navigation, design system, media extraction, component styles) does NOT re-fire when they finish.
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
job_id |
string |
required | Cloning job ID from discover_all_pages |
mode |
string |
optional | 'new' (default) compares only uncompared pages and triggers the post-scan cascade. 'all' resets and reruns every page (also triggers the cascade). 'manual' re-queues pages without firing any post-scan enrichments. |
min_importance |
number |
optional | Only valid with mode='manual'. Numeric backlink-rank threshold; only pages with backlink_rank > min_importance are re-queued. Mutually exclusive with max_match_score. |
max_match_score |
number |
optional | Only valid with mode='manual'. Pages whose latest overall match_score is strictly below this threshold (0–100) are re-queued. Only previously-compared pages are included — never-compared pages are excluded. Mutually exclusive with min_importance. |
What You Get Back
- Pages queued count
- job_id — the cloning job that was queued
- mode used (new, all, or manual)
- next_action — guidance to use get_migration_status to track progress
Example Use Case
After discovering 200 pages and building your React clone, call run_full_comparison. It returns immediately with a count of pages queued. Then poll get_migration_status to track background progress as the worker processes each page. After fixes are applied, use mode='all' to rerun every page and verify improvements. For a targeted refresh of high-importance pages without re-running post-scan enrichments, use mode='manual' and min_importance=50.
