🧱Program Components
Last updated
Last updated
Nodes are the building blocks that compose the graph/program. Each node encapsulates a functionality and executes it when it is reached during the execution flow. See what is a node? section for more detailed information.
Edges are the links between consecutive nodes in the graph. An edge between node A and node B means "execute node A, then proceed to node B". Inside MindTrade program graphs, most of the nodes will have exactly one ingoing edge and one outgoing edge, with the following exceptions:
Start Node: start nodes will always have no ingoing edges and one outgoing edge. This is because they represent the starting point of the execution, so no node will ever be executed before the Start Node.
Conditional node: conditional nodes are the only type of node that always have two outgoing edges. The reason is that conditional nodes control the execution flow based on the evaluation of a condition: if the condition is true, the execution will follow the first outgoing edge; otherwise, it will follow the second outgoing edge.
Output Node: output nodes will always have one ingoing edge and no outgoing edge. This is because they represent the termination of the execution, so no node will ever be executed after the Output Node.
Final nodes: when an Output Node is not present, any node can be placed at the end of the graph and it will mark the termination of the execution. Thus, it will have no outgoing edges.
Cycles: cycles are allowed in graphs. A cycle is present when a node has an outgoing edge that points to a previous node; this capability is useful to be able to repeat the same actions multiple times (e.g. until a certain condition is met). This entails that any node can have more than one ingoing edge.