> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quixa.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Scheduled Executions (Hangfire)

> Automate recurring workflow runs, nightly test regressions, and contract drift audits via Cron.

Quixa includes a production-grade, SQL Server-backed **Hangfire Execution Scheduler** that automatically executes workflows, regression suites, and contract drift checks on recurring schedules.

***

## 1. Setting Up a Schedule

1. Open any saved Flow or Suite on the canvas.
2. In the header toolbar, click the **Schedule** icon (`⏰`).
3. Configure the trigger:
   * **Schedule Frequency**: Choose standard presets (*Every 15 minutes*, *Hourly*, *Daily at Midnight*, *Weekly*) or specify a custom 5-field **Cron Expression** (e.g. `0 2 * * *` for 2:00 AM daily).
   * **Target Environment**: Select which environment configuration (`Staging`, `Prod`, `Sandbox`) should be injected at runtime.
   * **Enabled Toggle**: Activate or pause the schedule without deleting the configuration.

***

## 2. 3-Tier Enterprise Scheduling Architecture

Quixa provides unified cron scheduling across three critical operational tiers:

```mermaid theme={null}
graph TD
    Engine["Hangfire Recurring Cron Engine"]
    Engine --> T1["Tier 1: SpecTrum Drift Scans (Daily 07:00 UTC)"]
    Engine --> T2["Tier 2: Single Flows (DataGen & Uptime Probes)"]
    Engine --> T3["Tier 3: Flow Suites (Regression & E2E Pipelines)"]

    style Engine fill:#7c3aed,stroke:#a78bfa,stroke-width:2px,color:#fff
```

### Tier 1: SpecTrum Contract Drift Scans

* Automatically polls upstream microservice OpenAPI definitions on recurring intervals (e.g. `0 7 * * *` for daily 07:00 UTC).
* Detects breaking schema changes, missing endpoints, and payload mutations before squads begin work.

### Tier 2: Single Flow Execution (On-Demand DataGen)

* Periodically seeds test databases with fresh synthetic entities.
* Runs lightweight health probes and synthetic uptime heartbeats every 15 minutes (`*/15 * * * *`).

### Tier 3: Multi-Flow Regression Suites (Quixa Runner)

* Triggers comprehensive end-to-end regression suites nightly (e.g. `0 2 * * *`).
* Executes multi-domain dependency graphs, verifies latency SLAs, and publishes JUnit reports to CI/CD dashboards.

***

## 3. Reliability, Worker Pools & Live Log Monitoring

* **Durable Queue Workers**: Backed by SQL Server persistence, scheduled tasks survive server restarts and scale seamlessly across distributed worker pods.
* **Live Web Dashboard**: Inspect queue depths, active worker threads, and chronological execution traces directly from the Hangfire dashboard without needing SSH server access.
* **Audit Trail**: Every scheduled run records a complete `FlowExecution` record with `TriggerType: "scheduled"` for audit compliance.
* **Automated Failure Webhooks**: Dispatches incident payloads to Slack, Microsoft Teams, PagerDuty, or custom webhooks when scheduled runs fail.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.