Automation User Guide

This guide explains how to use Monitors, Webhooks, and Cron Jobs in the BioCortex Web UI and API.

Overview

FeaturePurpose
MonitorsScheduled literature or genomics checks (PubMed, Google Scholar, ClinVar, UCSC) with results saved to the workspace.
WebhooksTrigger analysis from external systems (e.g. lab equipment, CI/CD) via HTTP POST.
Cron JobsArbitrary scheduled tasks (custom task template + cron expression).
All are available in the Web UI under Automation (tabs: Monitors, Webhooks, Cron Jobs).

Monitors

What they do

  • PubMed — Search for recent articles; get titles, authors, PMIDs, summaries.
  • Google Scholar — Recent papers by query; citation counts, years.
  • ClinVar — Pathogenic/likely-pathogenic variants for a gene (e.g. UCSC, hg38).

How to add (Web UI)

  1. Go to Automation → Monitors.
  2. Click Add Monitor (or equivalent).
  3. Choose type (PubMed / Google Scholar / ClinVar).
  4. Enter search query (e.g. gene name or topic).
  5. Set schedule (e.g. “Daily at 8 AM” or cron expression).
  6. Save. The cron scheduler will run the task and store results.

Backend

Monitors are implemented as cron jobs with metadata (e.g. monitor_type: pubmed, google_scholar, clinvar). The Automation UI filters cron jobs by this metadata to show the “Monitors” list. Creation uses the same cron API with a task template tailored to the monitor type.

Webhooks

What they do

Allow external systems to trigger a BioCortex analysis with a predefined task template (and optional payload).

How to configure (Web UI)

  1. Go to Automation → Webhooks.
  2. View or add webhook endpoints (e.g. experiment_done).
  3. Configure: task template (natural language prompt), description.
  4. Use the shown URL and (if required) secret for POST requests from your system.

API

  • Trigger: POST /api/v1/webhooks/{name} — body can include payload (e.g. file paths, experiment id). Backend runs the configured task with the agent.
  • List: GET /api/v1/webhooks
  • Configure: POST /api/v1/webhooks/{name}/configure — set task template, description.
  • Calls: GET /api/v1/webhooks/{name}/calls — list recent invocations (for debugging).

Cron Jobs

What they do

Run any BioCortex task on a schedule (cron expression). Use for custom recurring analyses (e.g. weekly QC, daily literature digest).

How to add (Web UI)

  1. Go to Automation → Cron Jobs.
  2. Add job: name, task description (natural language), cron expression (e.g. 0 8 * * * for daily at 8 AM), optional enable/disable.
  3. Save. The global cron scheduler must be running (start from UI or API).

API

  • List: GET /api/v1/cron/jobs
  • Create: POST /api/v1/cron/jobs — body: name, task, cron, enabled.
  • Get/Delete/Enable/Disable: GET/DELETE /api/v1/cron/jobs/{id}, POST .../enable, POST .../disable
  • Scheduler: POST /api/v1/cron/start, POST /api/v1/cron/stop

Dependencies

  • Browser tools (for PubMed, Scholar, ClinVar): playwright, playwright install chromium.
  • Cron: Backend uses a persistent scheduler (e.g. APScheduler); state is stored so jobs survive restarts.

Next Steps