Ports

A connection defines an execution flow between states.

A connection exists between one of the "Out" ports of one state (on the right), and an "In" port of another state (on the left).

Every state (except the "root" one) has exactly 1 "in" port.

Every state (except the "root" one) has exactly 2 "out" ports:

  1. success (or 'true') port - During execution time, if the state's logic executes successfully, then all the states connected via the Success port will be triggered.

  2. failure (or 'false') port - During execution time, if the state's logic execution raises an unexpected error, or is executed unsuccessfully, then any state connected to the "Failure" port will be triggered.

Success and Failure ports

In the example above, the state "state_1" has 2 connections;

1 Connection from the "Success Out Port" to "State 2"

1 Connection from the "Failure Out Port" to "State 3".

During execution time, if "state_1" executes successfully, then the connection to "State 2" will be activated, and so "State 2" will be invoked next (whereas "State 3" won't).

If during execution time "state_1" fails, then the other connection, from the Failure out port to "State 3" will be activated, and so "State 3" will be invoked (whereas "State 2" won't).

You can treat the red "Failure" output port as an "Else" port. If the logic succeeded - the green "Success" port will be used. Else - the red "Failure" port will be used.

Success/Failure ports in context

A "success" port will be used during execution if the state logic executed successfully. A "Failure" port will be used otherwise. The definition of "success" may vary between different types of states;

API state - Will be considered "Successful" if the HTTP response code of the remote endpoint is >= 200 and < 400; Any other response code (or timeouts, unexpected errors, etc) will result in Failure.

Serverless Function - Will be considered "Successful" if no unhandled exception was raised during execution, and if the execution has not timed out.

Condition - Will be considered successful if the recursive evaluation of condition results in a truthy response.

‚Äč