Skip to main content

Assert

Controlled node

Overview​

Route execution when a value passes or reports an error.

Assert checks a value and chooses pass or error. Use it after a node that returns an error object as data, rather than stopping the workflow itself.

Assert routes execution; it is not a breakpoint and does not catch exceptions thrown by an earlier node.

Inputs​

InputTypeDescription
runEventChecks the supplied value.
valueDataThe result or condition to check.

Properties​

PropertyTypeDescriptionDefault
failOnlyOnErrorBooleanFail only for an explicit error object when enabled.false

Fail Only On Error is off by default.

  • Off: explicit error objects and values treated as false take the error path.
  • On: only explicit error objects take the error path. Values such as 0, false, "" and null may pass.

An explicit error object has an error field with a value treated as true, such as {"error":"Request failed"}. Merely having that field is not sufficient: {"error":false}, {"error":null} and {"error":""} pass.

With the option off, false, 0, an empty string, null and missing values fail. Text equal to "false", "null" or "undefined" also fails, ignoring case and surrounding spaces.

Lists and objects without an active error field pass, including empty lists and objects. This is not a schema validator or a check that a list contains rows.

Outputs​

OutputTypeDescription
passEventContinues when the check passes.
errorEventRuns your error-handling branch when the check fails.

There is no data output socket. Connect the original value directly to any later node that needs it. In the editor, the panel shows the failure message, or a passing status.

Example​

  1. Connect Query Batch Data's data to value.
  2. Connect its done event to run.
  3. Enable Fail Only On Error to distinguish a query failure from a worker with no rows.
  4. Connect error to a logging or failure-handling action.
  5. On pass, separately check for null before iterating over the returned rows.

To deliberately fail the run after validation, connect error to Throw.