Docs
Sign in

Assert

Assert checks that something you expect is true, and warns you or fails the workflow if it is not.

Screenshot to add: The Assert settings panel with Assertion expression, Failure message and Severity.

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

FieldWhat it doesNotes
Assertion expressionThe condition to checkA Jinja2 boolean expression. It "must evaluate to true to pass". Placeholder {{ output.status }} == 200
Failure messageText shown when the check failsPlaceholder "Expected status 200"
SeverityWhat happens on failureWarning (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.