Automation User Guide
This guide explains how to use Monitors, Webhooks, and Cron Jobs in the BioCortex Web UI and API.Overview
| Feature | Purpose |
|---|---|
| Monitors | Scheduled literature or genomics checks (PubMed, Google Scholar, ClinVar, UCSC) with results saved to the workspace. |
| Webhooks | Trigger analysis from external systems (e.g. lab equipment, CI/CD) via HTTP POST. |
| Cron Jobs | Arbitrary scheduled tasks (custom task template + cron expression). |
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)
- Go to Automation → Monitors.
- Click Add Monitor (or equivalent).
- Choose type (PubMed / Google Scholar / ClinVar).
- Enter search query (e.g. gene name or topic).
- Set schedule (e.g. “Daily at 8 AM” or cron expression).
- 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)
- Go to Automation → Webhooks.
- View or add webhook endpoints (e.g.
experiment_done). - Configure: task template (natural language prompt), description.
- 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)
- Go to Automation → Cron Jobs.
- Add job: name, task description (natural language), cron expression (e.g.
0 8 * * *for daily at 8 AM), optional enable/disable. - 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
- Browser and Automation — Browser tools and how they relate to monitors.
- Quick Test Guide — Verify browser, webhook, and cron.