Skip to content

Workflow monitors (multi-step API)

A regular HTTP monitor sends a request to a single URL. But a real API health check often requires a sequence: first log in, obtain a token, then call a protected endpoint with that token. A Workflow monitor performs exactly such a chain — up to 20 HTTP steps in a row, passing values from one step’s response into subsequent requests.

Steps are executed strictly in order. If any step fails (timeout, wrong HTTP status, response body missing expected substring, JSONPath assert mismatch, or an extractor didn’t find a value) — the chain stops, the monitor goes down and an alert is sent indicating the failed step.

Each step (WorkflowStep) is one HTTP request with its own checks and extractable variables:

FieldTypePurpose
namestringhuman-readable step name (appears in the alert) — required
methodstringGET / POST / PUT / PATCH / DELETE / HEADrequired
urlstringrequest URL; supports {{var}}required
headersstringJSON object {"Header":"Value"}; values support {{var}}
bodystringrequest body; supports {{var}}
expectedStatusint0 = any 2xx; otherwise exact status in [100, 599]
bodyContainsstringsubstring that must be present in the response body
assertJsonPathstringJSONPath to check a value in the body (see below)
assertValuestringexpected value for assertJsonPath (required if assertJsonPath is set)
extractorsarraylist of variables extracted from this step’s response

The steps themselves are stored in the monitor’s steps field as a JSON array serialized to a string.

Each extractor is a pair {name, jsonPath}:

  • name — the variable name under which the result becomes available in subsequent steps;
  • jsonPath — the path to the value in the JSON response.

The extracted value is substituted into url, headers, and body of later steps using the syntax {{name}}. Unknown placeholders remain as-is.

JSONPath is simple: $.token, $.user.id, array indices via dot — $.items.0.id. The root $ is optional.

Example: login → token → protected endpoint

Section titled “Example: login → token → protected endpoint”
[
{
"name": "Login",
"method": "POST",
"url": "https://api.example.com/auth/login",
"headers": "{\"Content-Type\":\"application/json\"}",
"body": "{\"email\":\"bot@example.com\",\"password\":\"s3cret\"}",
"expectedStatus": 200,
"extractors": [
{"name": "token", "jsonPath": "$.access_token"},
{"name": "userId", "jsonPath": "$.user.id"}
]
},
{
"name": "Профиль пользователя",
"method": "GET",
"url": "https://api.example.com/users/{{userId}}",
"headers": "{\"Authorization\":\"Bearer {{token}}\"}",
"expectedStatus": 200,
"assertJsonPath": "$.status",
"assertValue": "active"
}
]

The first step logs in and extracts token and userId. The second substitutes both into the URL and the Authorization header, expects 200 and checks that $.status == "active".

FieldDefaultConstraints
appidthe application where the alert will be sent — required
namemonitor name, 1..200 characters — required
stepsJSON array of steps: 1..20 items — required
intervalSechow often to check, 60..86400 sec — required
timeoutSec15timeout per step, maximum 60 sec
alertMessagealert message text, 1..2000 characters — required
alertTitleemptyalert title
alertMessageMarkdownfalsetreat alertMessage as Markdown
alertPriority0alert priority, 0..10
notifyOnChangefalsesend notification when any extracted value changed since the last successful run

With notifyOnChange: true the monitor remembers the last extracted values (extractors) and sends a notification when any of them changed. Useful to watch not only availability but also that some field in the API response didn’t “drift” (e.g., build version, price, stock level).

To avoid describing an HTTP request manually, there’s POST /workflow-monitor/build-step: you write what the step should do, in natural language — an LLM picks method, URL, headers, body, checks and extractors, after which the candidate is actually executed for verification.

Previously confirmed steps are passed in steps — they are replayed to accumulate variables and give the model an example of the previous step’s response (this helps it choose the correct JSONPath).

Окно терминала
curl -X POST "$NOTIFLY_URL/workflow-monitor/build-step" \
-H "X-Notifly-Key: C-xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"description": "получить профиль текущего пользователя с Bearer-токеном из прошлого шага",
"steps": [ /* уже подтверждённые шаги */ ],
"timeoutSec": 15
}'

In the response:

FieldPurpose
stepthe proposed WorkflowStep (method, URL, headers, body, checks, extractors)
labelshort name of the step
reasonexplanation why the model chose this request
verifiedtrue if the candidate was executed successfully
statusCodeHTTP status of the candidate’s response
sampleBodya fragment of the response body
extractedVarsvariables actually extracted by this step
availableVarsvariables available at this step (from previous ones)
notefilled if verification failed — with the error text

Before saving the monitor, run the whole chain via POST /workflow-monitor/test:

Окно терминала
curl -X POST "$NOTIFLY_URL/workflow-monitor/test" \
-H "X-Notifly-Key: C-xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"steps": [ /* массив шагов */ ], "timeoutSec": 15}'

Response:

{ "ok": true, "vars": {"token": "ey...", "userId": "42"} }

On success ok: true and vars — the final set of accumulated variables. On failure:

{ "ok": false, "failedStep": 1, "error": "HTTP 401 (expected 200)" }

failedStep — index of the failed step (zero-based), error — reason: wrong status, missing substring/JSONPath, assert-value mismatch, or network timeout.

POST /workflow-monitor/:id/pause stops checks (the next check is postponed far into the future), …/resume — places the monitor in the queue for an immediate check. Cosmetic edits (name, alert text) do not reschedule the check; changing steps, interval, timeout or notifyOnChange — reschedules to “now”.

Method and pathAuthorizationPurpose
GET /workflow-monitorclient-tokenlist of monitors
POST /workflow-monitorclient-token (write)create a monitor
PUT /workflow-monitor/:idclient-token (write)update
DELETE /workflow-monitor/:idclient-token (write)delete
POST /workflow-monitor/:id/pauseclient-token (write)pause checks
POST /workflow-monitor/:id/resumeclient-token (write)resume checks
POST /workflow-monitor/build-stepclient-token (write)AI selection and verification of a single step
POST /workflow-monitor/testclient-token (write)run the chain without saving

All endpoints are also available under the MCP code (M…): read — by any MCP code, write — by a code with scope write. You can manage monitors via the assistant, and from the admin UI.