Skip to main content
The end-to-end path, on one page: define a simulation in your repo, apply it, run it, and read the pass/fail. Config as code defines the resources; running is a separate, deliberate step (so applying never places a surprise call).
You need the CLI (npm install -g @roarkanalytics/cli) and a Roark API key with config:apply and permission to start simulations and read results. Set it once: export ROARK_API_BEARER_TOKEN="<key>".

1. Define an agent and a plan

The minimum to run something: an agent to call and a simulation plan that says which flows to run against it and which metrics grade the result. This plan runs a built-in (system) flow, so there’s no persona or flow to author first.
Swap the system flow for your own customer flows and personas once you want to test your own scenarios. roark simulation template list prints every built-in flow slug.

2. Apply it

Create the resources (preview first, then apply):
This creates the agent and the plan. It does not run anything yet.

3. Run it

Running is a separate command. It takes the plan’s id, not its config name, so look the id up once (or copy it from the plan’s page in the dashboard):
roark simulation run returns a job id (the run). It places the calls, grades each against the plan’s metrics, and the result settles when every call has been scored.
Prefer not to leave your pipeline? The GitHub Action starts the run and waits for it in one step, and the Node SDK exposes the same via client.simulation.run({ planId }).

4. Read the result

You get the per-check pass/fail against the plan’s success criteria, plus a link to the full report in the dashboard. Roark decides pass vs. fail, so the CLI, the dashboard, and your CI pipeline never disagree.

5. Gate CI on it

For a pipeline, skip the manual run and let the GitHub Action start the run, wait, and fail the build when a check falls short:
.github/workflows/agent-regression.yml
See CI/CD for the full action reference.

Or: run it on a schedule

To run without a trigger at all, add a schedule to the plan and apply, the plan runs itself on the cadence you set.

Simulation plans reference

Every field a plan takes: agents, flows, metrics, direction, scheduling, and knowledge checks.