2. Understanding Aiflo Code

Aiflo programs are like assembly lines, where each step in the process is represented by a "node." These nodes are written in a simple, human-readable format called JSON.

Think of it like this:

    [
        { ... node1 ... }, 
        { ... node2 ... }, 
        { ... node3 ... }, 
        ... 
    ]

Each node either holds some data (like a number or a piece of text) or performs an action (like sending an email or processing a payment).

2.1 Node Types

Every node has a "type" that tells Aiflo what it should do. For example, a text node holds text, a template node formats text, and a bucket node interacts with cloud storage.

    { "type": "text", ... }     

2.2 Naming Nodes

To make your Aiflo program work, you need to give names to some of the nodes. This allows nodes to send information to each other.

    { "name": "my_text_node", "type": "text", ... } 

2.3 Giving Nodes Values

You can also give nodes initial values. For example, you might give a text node the value "Hello, world!".

    { "name": "greeting", "type": "text", "value": "Hello, world!", ... } 

2.4 Connecting Nodes

The real power of Aiflo comes from connecting nodes together. This is done using the then attribute.

    { 
        "name": "greeting", 
        "type": "text", 
        "value": "Hello, world!", 
        "then": [ { "target": "display" } ] 
    }

In this example, the greeting node sends its value ("Hello, world!") to another node named "display".

2.5 Sending Specific Data

You can even choose to send only specific parts of a node's data using attributes like name, value, fields, index, and indexes. This allows for precise control over the flow of information in your Aiflo program.