Flow
Flows are are what users create or edit on Foretale. You can think of each flow as an app.
A collection of nodes
A flow in Foretale is a linear collection of more than one node . The collection of nodes becomes a flow when they are joined together in a chain and a message is injected into the chain by the first node.
As the message (referred to using the cadence msg
) passes along the flow, it triggers every node it encounters into performing their respective functionalities.
When msg
reaches the end of the flow it is terminated and the flow stops until a new msg
is injected at the beginning again.
important
For a flow to operate a message must be injected into the flow.
Normally either a sensor node or inject
node must be used to inject a message.
If no message is injected into a flow then information never passes along the flow to the various node, and as such no functionality ever occurs.
Injecting an initial message
A message is initially injected into a flow by either an
inject
node or a
sensor node
.
An inject
node injects a unix time-stamp message into the flow.
A flows msg
has various properties such as a payload. This is refered to as msg.payload
.
Typically nodes within a flow will add or modify data to the msg.payload
.
Alternatively they might extract data from the msg.payload
and use it to perform another task.
Note that a msg
has multiple properties, however the msg.payload
is typically the most used.
Complexity
A flow can be as simple or a complicated as desired, the only limits on flow creation are one’s imagination and the nodes available to a user within FlowStudio!