Understanding Blocks

In Data-River, blocks are the fundamental building units of your workflows. These blocks represent different actions or logic, and they are visually connected to create powerful automation and processes.

This guide will walk you through the basics of Data-River blocks and how to use them.

What Are Blocks?

Blocks in Data-River are visual components that represent different tasks or logic in a workflow. Instead of writing complex code, you can simply drag and drop blocks, connect them, and define how they interact with one another. Each block has a specific function and can accept or pass on data to other blocks in the workflow.

Think of blocks as the steps in a process:

  1. Start Block: This block initializes the workflow.

  2. Input Block: This block takes input from the user or another data source.

  3. Output Block: This block outputs the results of the workflow.

  4. End Block: This block finalizes the workflow.


Types of Blocks

Here’s a breakdown of the key blocks available in Data-River:

1. Start Block

The Start Block marks the beginning of your workflow. All workflows in Data-River must start with this block. It signals the engine to begin execution and initiate the flow of data.

  • Purpose: Initialize the workflow.

  • Example: Starting an email automation process.

2. Input Block

The Input Block is used to gather data that will be passed through the workflow. This can be user input, data from external APIs, or any other data source.

  • Purpose: Collect data to be processed in the workflow.

  • Example: Collecting a user's name for a personalized email.

3. Output Block

The Output Block represents the final step of data processing in your workflow. This is where the results are displayed or sent to another system.

  • Purpose: Display or output the result of the workflow.

  • Example: Outputting the result of an API call or sending an email.

4. End Block

The End Block marks the completion of the workflow. Once this block is reached, the workflow is considered complete, and no further actions will be taken.

  • Purpose: End the workflow and signal the engine to stop.

  • Example: Signaling the completion of a notification process.


Connecting Blocks

To create a workflow, you need to connect blocks together. Data flows from one block to the next, allowing you to create complex processes without writing code.

  • Drag and Drop: You can easily drag blocks from the block library and drop them onto the canvas.

  • Connect: Connect blocks by clicking on the output of one block and dragging to the input of another.


Example Workflow

Let’s build a simple workflow that uses the four basic blocks:

  1. Start Block: This begins the workflow.

  2. Input Block: This collects user data, such as their name.

  3. Output Block: This outputs a message using the user’s name.

  4. End Block: This marks the end of the workflow.

In this workflow, the user inputs their name, the system processes it, and the output displays a personalized message. This flow is simple but demonstrates how you can use Data-River to automate tasks without needing to code.


Adding Custom Blocks

While Data-River comes with several built-in blocks, it’s designed to be fully extendable. Developers can create custom blocks by writing JavaScript classes. These custom blocks can be reused and shared in the marketplace.

  • Custom Logic: If your workflow needs custom logic or an external service integration, you can create a block to handle that.

  • Reusability: Once you’ve built a custom block, it can be reused across multiple workflows.


Best Practices for Working with Blocks

  1. Start Simple: Begin by creating simple workflows with the basic blocks (Start, Input, Output, End). As you get comfortable, you can add more complexity.

  2. Organize Your Workflow: Keep your workflows clean by arranging blocks logically. Use comments or descriptions in complex workflows.

  3. Test as You Go: Test your workflows frequently to ensure each block is working as expected before adding more complexity.


Conclusion

Blocks are the building blocks (pun intended!) of Data-River. By connecting and configuring them, you can create powerful workflows that automate everything from simple tasks to complex processes. As you get familiar with the basic blocks, you’ll be able to expand your workflows with custom blocks and more advanced features.

Happy workflow building!

Last updated