Flows

Flows provide a means to articulate the communication dynamics between nodes and are constructed by describing them under the flows parameter. Each flow necessitates a dedicated mapping under this parameter, identified by the flow name for clarity and organization. When generating flows in the final diagram, Desgram automatically manages the efficient routing of these flows, navigating them along the connections between nodes and networks.

Parameters

From and To

Parameter nameValue typeValue
fromstring or listone or more explicitely-defined or implicitely-defined nodes
tostring or listone or more explicitely-defined or implicitely-defined nodes

To define a flow, it's imperative to include the from and to parameters, signifying the source and destination node(s) of the flow. While you can enlist multiple source and destination nodes by utilizing lists for the respective from and to parameters, it's essential to note that having both parameters as lists for both source and destination is not supported.

TIP

You can employ multiple destination nodes to represent fan-out communications, such as load balancing. Conversely, multiple source nodes can be utilized to depict fan-in communications, resembling scenarios like subscriptions to a message broker.

Example

yaml
networks:
  frontend:
    nodes: [Website, LB]
  backend:
    nodes: [LB, API 1, API 2, Cache]

flows:
  HTTPS:                    #direct flow: one source, one destination
    from: Website
    to: LB
  HTTP:                     #fan-out flow: one source, multiple destinations
    from: LB
    to: [API 1, API 2]
  Redis:                    #fan-in flow: multiple sources, one destination
    from: [API 1, API 2]
    to: Cache