We use cookies to personalize your experience.Learn More

Blog / Features

Simplify your workflows with logic blocks

Use conditionals, loops, and functions to build your complex business logic in just a few steps.

Tanisha Chouhan

Mon May 01 20234 min read

On this page:

The way we construct applications and automate processes has been completely transformed by no-code development.  Canonic is one platform that stands out for allowing users to build robust applications and workflows without writing code.

We recently launched support for logic blocks in workflows. You can now add different types of logic nodes such as conditionals, loops, and outputs.

Let's dig deeper into some of the logic blocks that we support.

Types of Logic Blocks on Canonic

Canonic provides a variety of logic block types to meet various automation demands.

Conditional Blocks

Users can create rules and conditions to control the workflow's direction based on particular criteria by using the Conditional node.

For example, you can send a different email based on the outcome of a previous node.

Loop Blocks

Users can complete tasks iteratively without repeating instructions by using the Loop node. When doing repetitive tasks or processing several data points, this functionality comes in handy.

For example, you can loop over all recently signed up users to send them a welcome email or message.

Output Blocks

The Output node in Canonic's workflow builder enables users to observe and alter data as it moves through the process. Users can set outputs to the workflow from anywhere in the graph.  

Function Blocks

Users can use function nodes to add custom code to their workflows. You can make API calls, and database queries and alter and transform data coming in from other nodes.

Getting Started with Logic Blocks

Logic blocks are a core part of the workflow experience. When you add a node to your workflow, you can now select the type of node. Depending on the node type, different configuration options are present.

Adding logic blocks

Let's set up a quick demo of how logic blocks work. Create a new workflow in your project. After that, let's add a few nodes. Create the + below the main workflow node to add a new node.

Mark this node as a function node. Inside the function code, let's return an array of numbers.

module.exports = function() {
	return { items: [1,2,3] }

Now, let's loop over these numbers by adding a loop node. Set the property to loop over to 1.items. This will make the node loop over all the items in the 1st node (the function node that we set).

Inside the loop let's add a conditional node to check if the number is greater than 1. In order to do this, in the conditional node configuration, create 2 branches. Set the names to whatever you like.

For the condition, for the first one, set it to data > 1 and for the second one, set it to data <= 1.

Inside the data > 1 branch, create an output node. Set the output key to myOutput. Inside the code let's return true  data > 1 and false for data <= 1

module.exports = function(params) {
  return `${params.parent.data} is less than 1`

Finally, create an output node right at the end to output the data from the loop.


Time to test our workflow! Let's open the testing panel and hit run on the workflow to see our workflow execute. As you can see the output of the workflow is the following:

Hopefully, that gives you an idea of the power of these nodes. They're especially powerful when combined with different services such as Slack, Jira, and more.

Build like a pro with Canonic

Discover Logic Blocks' simplicity and strength on Canonic and realize the full potential of workflow automation. Give yourself the capacity to automate jobs, simplify processes, and increase levels of productivity. With Canonic, embrace the future of automation and take workflow automation to new heights.

With Canonic's Logic Blocks, you can begin developing your logic-driven workflows right away and take advantage of all the possibilities.

Start Today

Did you find what you were looking for?
What went wrong?
Want to discuss?We have a thriving Discordcommunity that can help you. →

Enough said, let's start building

Start using canonic's fullstack solution to build internal tools for free