diff --git a/canary-checker/docs/reference/1-http.mdx b/canary-checker/docs/reference/1-http.mdx index 43f21f9d..15269002 100644 --- a/canary-checker/docs/reference/1-http.mdx +++ b/canary-checker/docs/reference/1-http.mdx @@ -138,6 +138,27 @@ Eg: In the following spec, the var `db`, defined in `env`, is available as `{{.d +### Referencing Outputs from Dependent Checks + +When using `dependsOn` to create dependencies between checks, you can access outputs from other checks by name. This enables request chaining for multi-step workflows. + +| Variable | Description | Scheme | +| -------- | ----------- | ------ | +| `outputs..json` | Parsed JSON response body from the named check | `map[string]any` | +| `outputs..code` | HTTP response status code from the named check | `int` | +| `outputs..headers` | Response headers from the named check | `map[string][]string` | +| `outputs..body` | Raw response body from the named check | `string` | + +
+ +
+```yaml title="http-depends-on.yaml" file=/modules/canary-checker/fixtures/minimal/http_depends_on_pass.yaml +``` + +In this example, the `get-profile` check depends on the `login` check and uses the token from the login response via `$(.outputs.login.json.token)`. +
+
+ See Escaping variables ## Metrics