Run Collection
run_collectionExecute requests from a Bruno collection and run their test scripts, optionally in isolated parallel groups with separate variables and cookies so one collection can run as multiple identities.
Instructions
Execute requests in a Bruno collection and run their test scripts. SUBSET: requests is an ORDERED list of .yml/.bru paths, absolute or relative to collectionPath; a directory expands recursively. Duplicates allowed, and run twice. Omit to run the whole collection. Pass requests OR groups, never both. GROUPS: one call, more than one identity or configuration. Each group owns its OWN variable store and cookie jar, so nothing a group sets — a bru.setVar, a session cookie — is visible to any other group. That is what makes running the same five requests as alice and as bob in one call safe. ITERATIONS: data or dataFile runs a group once per row, the row bound as variables. Each row is its own group — same name, own index, own iterationIndex — with that same isolation. Rows are independent: a failing row does not stop later rows. Ceiling 1000 rows per scope. PARALLELISM: parallel on the run fans groups out; parallel on a group fans that group's requests out. A group is serial unless it says otherwise, whatever the run does. seq no longer constrains execution — default order and reporting order only — so two requests in one parallel group run at the same moment and may contend on the store they share. startAfter holds a group until a named group has completed a given number of its requests, connecting a listener before a trigger fires; needs parallel on the run. Chains allowed; cycles, and gates that can never open, are refused before anything runs. If the group waited on ends early, the waiting group reports that as its error instead of starting. RESULTS are group-shaped: each groups[] entry carries its own summary, results, capturedVariableNames and capturedVariables; the top-level summary is the run. Run-wide warnings are top-level, so a captureVariables name is reported unset only when NO group set it. There is no top-level results array, not even with no groups. A crashed group reports error and counts as one failure. RESPONSE DATA: every result carries the response body (response_body, response_content_type, response_body_truncated) unless includeResponseBody is false; maxResponseBodyBytes caps it. Every result also carries response_headers, no test script needed; includeResponseHeaders false omits them, maxResponseHeaderBytes bounds one value, and includeResponseBody false bounds the body only, never the headers: credential-named values are masked, and set-cookie is a LIST — one entry per cookie — whose entries keep every attribute (HttpOnly, Secure, SameSite, Path, Max-Age) and withhold only the cookie value, so a cookie-flag or HSTS check is one call. A websocket result's response_headers hold its handshake response (the 101), the only place a session cookie or a negotiated sec-websocket-protocol is visible for that transport; a gRPC result reports metadata under grpc instead. ORDER: within a group, the order given; a directory expands by seq scoped to its own folder, subfolders before that folder's loose requests, ties by filename. An unparseable file is skipped when DISCOVERED (whole collection, or directory expansion): parseErrors counts them, parseFailures names each with its reason. A file you NAMED is not skipped: it fails the group that named it, reported as that group's error, and other groups still run. A named request that does not exist goes to that group's missingRequests and fails nothing. TRANSPORTS: http, graphql, grpc, websocket. Any other kind is refused per-request with status 0 and a named reason, leaving the rest of the group alone. A gRPC result carries grpc: status code (0 is OK and is NOT the refusal sentinel — status 0 with an error and no grpc detail is a refusal), method, redacted metadata. A websocket result carries websocket: transcript, stop_reason (count, timeout, bytes, closed, error) and truncated, true for the three that cut a session short. Frame contents are recorded only when websocket.includePayloads is on. ASSERTING ON A TRANSPORT: on a websocket result res.getBody() IS the transcript array and res.getStatus() is ALWAYS 0 — a session has no status, so a test on it asserts a constant and cannot fail. The outcome is res.getStopReason() (also res.stopReason and res.statusText, same string), res.getCloseCode() for the peer's close code (null when it sent none, ordinary for a session stopped by its own bound), and res.getSessionTruncated(). Each returns what that result's websocket detail reports. On a gRPC result res.getStatus() is the gRPC code, res.statusText the server details or code name, res.getBody() the parsed message. SIMULTANEITY IS PER CALL: groups plus parallel are the only way to make two things happen at the same moment. Two separate calls are not serialised by this server, and nothing here decides when the second starts: that is the client's scheduling, typically seconds apart. One identity listening while another triggers must be ONE call with parallel groups. Every result carries the path of the request file it came from. STOPPING EARLY: bail stops the run at the first request that fails or whose tests fail. Everything after comes back skipped: true, skipReason "bail", counted in summary.skipped and in neither passed nor failed; the run carries a bail object naming the reason, the request it stopped at and how many were skipped. Nothing cancels a request in flight, so under parallel the ones already started still finish and are reported normally. REPORT FILES: report also writes the run to disk — JUnit XML for CI, HTML for a person — at a path inside the collection; what was written comes back under reports. Outbound requests are SSRF-filtered: targets resolving to private, loopback, link-local or otherwise reserved addresses are refused unless the server operator has allowlisted them, and a refusal is reported per-request as an "SSRF blocked" error with status 0.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"collectionPath": "<collectionPath>"
},
"name": "run_collection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bail | No | Stop at the first request that errors or fails a test, instead of running the rest. Bruno's --bail. Requests not yet started come back as results with skipped:true, in the failing group and every group after it. Requests already in flight are NOT cancelled, so under parallel this skips the tail rather than the remainder, and the run warns that it did. A skipped request counts in summary.skipped and in neither passed nor failed. The result's bail field says where the run stopped. Default: false. | |
| data | No | Rows every group iterates over, as the group-level data but applied to all of them. A group that gives its own data or dataFile REPLACES this rather than adding to it, the same rule environment follows. With no groups given, the run is one group and these rows are its iterations. Mutually exclusive with dataFile. | |
| groups | No | Run the same collection under more than one identity or configuration in one call. Each group owns its OWN variable store and cookie jar: nothing a group sets is visible to any other group, in either direction, at any parallel setting. Groups are reported in the order given. The same request may appear in several groups. Cannot be combined with requests; omit both to run the whole collection as one group. | |
| report | No | Write the run to a file as well as returning it here. Name at least one format. Paths are CONFINED TO THE COLLECTION: a path resolving outside it is refused, with the reason as a run warning, because writing wherever a caller points is a far bigger authorization than running its requests. Missing parent directories inside the collection are created, and an existing report is overwritten. Each file written is reported under reports with its absolute path and size; a report that could not be written never fails the run, it adds a warning naming the format and the reason. A report holds what the results hold — response bodies included, response headers masked exactly as they are here — so it lands on disk with whatever the run saw. | |
| dataFile | No | A CSV inside the collection whose rows every group iterates over. Same rules as the group-level dataFile, and likewise replaced by a group that names its own rows. Ceiling of 1000 rows, because every row runs every request in the group and a spreadsheet passed by mistake is an outbound request storm; slice the file and run it in parts. | |
| parallel | No | Fan out. At the run level this runs the GROUPS concurrently; a group's own requests are serial unless that group sets its own parallel. With no groups given the run is one group, so parallel here runs every selected request concurrently. Reporting order is the listed order regardless. Default: false. | |
| requests | No | The requests to run, IN THE ORDER GIVEN. Each entry is a .yml or .bru request file, or a directory, which expands to every request under it, recursively. Absolute, or relative to collectionPath. Get paths from list_requests or get_collection_stats. Duplicates are allowed and run twice. Omit to run every request in the collection; an empty [] is a selection of nothing and runs nothing. Cannot be combined with groups; to run a subset per identity, put the paths in each group's own requests. An entry naming nothing is reported in missingRequests rather than failing the run. | |
| cookieJar | No | Keep cookies from each response and send them on later requests in the same run, so a login carries into the requests after it. Scoped to the group — nothing crosses from one group to another, at any parallel setting — held in memory, never written to disk, and matched by host/path/expiry, so a cookie set by one host is not sent to another. Precedence, per cookie name: a Cookie header the request writes itself WINS over the jar, which only adds names the request did not set. This diverges from Bruno's CLI, where the stored value wins the clash; a warning names any cookie whose stored value was dropped. Default: true. Set false to send only the Cookie headers a request writes itself. | |
| variables | No | Variables for this run only, as {name: value}. They override the environment file and work without one. Held in memory and never written to any file — this is the only correct way to supply a secret, because neither Bruno file format stores a secret value. Referenced as {{name}} in urls, headers, bodies and auth. A request-level vars:pre-request entry or a bru.setVar in a script still overrides these, matching Bruno's --env-var precedence. | |
| websocket | No | Bounds for every websocket request in this call; there is no per-request form. Omit for the defaults below. A session always ends on one of these bounds or on the peer closing, and nothing is held open past the call. Each transcript entry carries its frame type ("text", "binary", "ping", "pong" or "close"), the authored title of a message the session sent, and on a close frame the close_code the peer gave — 1000 an ordinary goodbye, 1006 a peer that vanished, 1008 a refusal, 1011 a server error. Control frames do not count toward maxMessages. A binary frame's payload is base64; bytes is the true wire size for every kind. A subprotocol is not a bound and is not set here: author it as a Sec-WebSocket-Protocol header on the request, comma-separated for more than one. It is negotiated at the handshake, and the one the server agreed to comes back in that result's response_headers. | |
| environment | No | Environment name to use (e.g. "dev", "staging"). Get available names from get_collection_stats. | |
| collectionPath | Yes | Absolute path to collection root directory. Use the path returned by list_collections. | |
| collectionRoot | No | The collection that collectionPath belongs to, when running a subfolder of one: environments and the collection- and folder-level scripts are resolved from here. Must be collectionPath itself or an ancestor of it — a root that does not contain the collection is rejected. | |
| maxConcurrency | No | Ceiling on requests in flight across the whole run. Omit to derive one from this machine's cores and memory, held below capacity. 0 lifts it entirely, at your own risk. Applies to THIS run and is given back when it ends, so it neither re-caps another run already in flight nor outlives the call that asked for it. A ceiling below the number of requests you meant to run at once silently serialises them. | |
| captureVariables | No | Names of variables set by bru.setVar during the run whose values you want back, e.g. ["token"]. This is the only way to see one: without it the value exists only inside the run. Every name a script set is listed in capturedVariableNames on every run, so run once to see what is there. Values come back only for names you list here, verbatim. Nothing is captured from the environment file or from variables you supplied, only what a script set. | |
| includeResponseBody | No | Include the response body of each request in the results. Default: true. | |
| maxResponseBodyBytes | No | Maximum response body size (bytes) to return per request; longer bodies are truncated and response_body_truncated is set. Default: 10240. | |
| includeResponseHeaders | No | Include the response headers of each request in the results, credential values masked. Default: true. Turn it OFF for a run whose results you read in bulk: the same headers repeat per result and a few dozen requests can spend more output on them than on what you asked about. A test script is unaffected: res.getHeader() always reads the real headers. | |
| maxResponseHeaderBytes | No | Maximum size (bytes) of one header VALUE to return; a longer value is cut and response_headers_truncated is set on that result. Default: 2048. Per value, not per map, so it never changes which headers are reported. set-cookie is a list and each cookie is capped on its own. |