Skip to main content

Execution Flow

Every 2501-runner run call goes through these phases: Pre-flight — validates the full environment: DB connectivity, org/tenant/user IDs, gateway or engine API reachability, Ansible availability. Scenario Discovery — scans the scenarios directory, loads all scenario.json files, resolves the -s argument against available keys and tags. Per-Scenario Loop — for each matched scenario (and each iteration when -i > 1):
  • Provision: resolve host and agent from the DB, flush agent memory
  • Prepare: run restore.yml silently, then run prepare.yml (abort if it fails)
  • Execute: dispatch the scenario through the selected entry point, poll for completion
  • Validate: evaluate all validation rules, run validate.yml if declared
  • Restore: run restore.yml to reset the host (non-fatal if fails)
Report — prints a summary table, persists a ScenarioReport to the DB, exits 0 or 1.

Options


Entry Points

The --from flag controls how each scenario is dispatched. --from gateway (default) — creates a ticket in ServiceNow. Exercises the full integration: gateway → job → agent → ticket resolution. Requires --gateway servicenow and SERVICENOW_* env vars.
--from ticket — POSTs directly to the engine’s internal ticket endpoint. Requires ENGINE_API_URL and ENGINE_API_KEY env vars.

Environment Variables


Common Patterns