Assert
Assert checks that something you expect is true, and warns you or fails the workflow if it is not.
Screenshot placeholder
When to use it
Use it to guard a step. For example, check that a response was successful before you use its data. The palette describes it as "Validate condition".
Settings
| Field | What it does | Notes |
|---|---|---|
| Assertion expression | The condition to check | A Jinja2 boolean expression. It "must evaluate to true to pass". Placeholder {{ output.status }} == 200 |
| Failure message | Text shown when the check fails | Placeholder "Expected status 200" |
| Severity | What happens on failure | Warning (log & continue) or Error (fail workflow) (default) |
Inputs and outputs
- One input at the top and one output at the bottom.
- The code shown does not describe the exact output data.
Example
Illustrative. Assertion expression {{ output.status }} == 200, Failure message "Expected status 200", Severity Error (fail workflow). If the status is anything else, the run fails with that message.
Tips
- Write a Failure message that says what you expected. It is what you will read later.
- Use Warning (log & continue) while you learn what normal data looks like.
- To fail with your own error type, use Throw Error.