About Flows
Introduction
Flows logic operate as structured sequences, meticulously designed to orchestrate a series of tasks or operations in a specific order. At the heart of every flow are its steps. Each step is like a command, telling the flow what action to do next. These actions can range from basic tasks, like adding an item to a list, to more advanced ones, like checking conditions or looping through data. By stringing these steps together in a flow, you can create a clear and adaptable sequence of operations.
Additionally, flows exhibit a unique versatility, evident in their ability to invoke other flows or even call upon logic blocks, promoting reusability. Above all, they are crafted to perform operations seamlessly, ensuring there are no unintended disruptions or "side effects" to your system's overall state.
Properties of Flows
Every flow has certain details or properties that describe it. These properties give us information about the flow, like its name, where it's used, and what it does. Let's look at these properties:
| Property | Required | Description |
|---|---|---|
| Name | Yes | The name of the new flow. |
| Project | Yes | The project to which the flow belongs. |
| Description | No | The optional description of the flow. |
| Is Action | No | Indicates whether the flow is marked as an action. |
| Input | No | The input parameters to be used in the flow. |
| Data | No | Data that can be added from an entity or queried from a table. |
| Outputs | No | The output's that the flow will return upon its termination |
Flow Steps
Within a flow, the steps are the heart of the operation. They dictate the sequence and actions that the flow undertakes, ensuring every task is executed in the desired order. Each step has a designated type and name, which determines its specific functionality within the flow.
Flow logic offer a variety of step types, catering to a wide range of tasks, from data manipulation and logic evaluations to interactions with other flows and logic blocks. For a deeper dive into each step type, refer to the table below:
| Step Type | Description |
|---|---|
| Add Item To Collection | Allows you to add a new item into an existing list or collection. |
| Assign Variable | Lets you assign a specific value to a certain variable |
| Associate Multiple Relationship | Establishes multiple relationships between entities in a single step. |
| Associate Relationship | Creates a linkage between two entities, denoting a relationship. |
| Condition | Evaluates a specific expression and directs the flow based on its result. |
| Delete Entity | Removes an entity from the crm using its ID. |
| Disassociate Multiple Relationship | Removes multiple established relationships between entities at once. |
| Disassociate Relationship | Deletes a previously established relationship between two entities. |
| Execute Multiple Requests | Execute multiple entity-related actions in a batch, encompassing creation, update, and deletion operations. |
| Get Entities By Relationship | Fetches an entity based on its relationship with another entity. |
| Get Entity By ID | Retrieves an entity using its unique identifier. |
| Execute Query | Facilitates running a specific query against an entity to fetch or manipulate data, based on various conditions and criteria. |
| Halt | Stops the flow or process immediately. Useful for handling errors or specific conditions. |
| Iterator | Processes each item in a collection one by one. |
| Loop | Repeats a set of actions until a particular condition is met. |
| New Variable | Create a new variable with a specific type. |
| Raise Error | Triggers an error condition, usually to handle unexpected scenarios. |
| Remove Item From Collection | Deletes a specific item from a list or collection. |
| Run Logic Block | Executes a predefined flowOn block. |
| Run Logic Flow | Executes a predefined flowOn flow. |
| Save Entity | Saves or updates an entity instance in the crm. |
| Set Entity Properties | Assigns or modifies the attributes or properties of an entity. |
| Set Output | Used to set a value, to one or more of the available output variables. |
| Switch | Used to evaluate a specific operand and direct the flow based on its value. |
Understanding Scoping in Flows
In flow design, "scoping" determines the accessibility and lifespan of variables. Properly understanding and managing scopes ensures smooth operation and prevents data conflicts.
Global Scope
- Variables and actions created outside any specific section (like loops or conditions) are available everywhere in the flow.
- Think of them as "shared utilities" you can use in any part of your flow.
Local Scope
- Variables and actions created inside a specific section (like inside a loop, condition, iterator...) are only available in that section.
- If there's a nested section (a loop inside another loop, for example), anything you set up in the inner section is only known there. The outer sections even the sibling's won't know about them.
- If you have a variable with the same name in the global area and inside a section, they are treated as two separate things.
With a clear understanding of how scoping works in flows, we're well-equipped to ensure our processes run smoothly without unexpected hiccups keeping the flow logic clean, organized, and error-free.
What's Next
Having grasped the flows, their role and the concept of scoping inside them, it's now time to delve deeper into each step and truly understand their intricacies. In the upcoming section, we'll dive into each step type, exploring their properties.