Workflow and Low-code. A perfect match?
Tags: workflow, softwaredevelopment, camunda, lowcode
Published: 2021-09-20 10:21:42

---
title: Workflow and Low-code. A perfect match?
published: true
date: 2021-08-17 11:47:18 UTC
tags: workflow,SoftwareDevelopment,Camunda,Lowcode
canonical_url: https://linx.software/workflow-meets-low-code-a-perfect-match/
---
We recently discovered open-source workflow engine [Camunda](https://camunda.com/) after one of our customers mentioned using it with our low-code product, [Linx](https://linx.software). After looking through Camunda’s documentation, I realized that it could be a perfect partner for Linx.

Workflow (or Business Process Management) software generally covers three areas:
**1. Workflow engine.** The engine keeps state and decides what must happen next.
**2. User task management.** The user interface and logic that governs task allocation to users and how they interact with those tasks.
**3. Automated task execution.** The mechanism to interact with other technologies.

These may be connectors to APIs or hooks into one or more programming languages.

Camunda covers all these areas and has a comprehensive [REST API](https://linx.software/the-ultimate-guide-to-building-a-low-code-rest-api-how-to-guide/). You can run it as a standalone service and hook up a custom user task interface and automated task execution to the API.

Automated tasks are usually programmed in a language the workflow engine supports. In Camunda’s case, it’s Java or, by using the REST API, the language of your choice. Another way to develop automated tasks is to use a [low-code tool](https://linx.software/linx-compared-to-other-low-code-platforms/) — this is where I thought the two would work well together.

## Hypotheses
In theory, using a workflow engine to orchestrate business processes built with a low-code tool should give us the best of both worlds.

We design the workflow with a BPMN modeling tool and create the task automation using low-code. When doing the modeling, we concentrate on the business problem, and when implementing the automated tasks, we focus on the technical aspects but without having to code.

The separation of the orchestration (workflow engine) and task automation (low-code) has some other advantages:

**1. Maintenance.** We can make changes on one without impacting the other one.
**2. Flexibility.** We can mix execution technologies e.g. use low-code where we can and code where we have to. Or have multiple, even different, workflow engines. Whatever works for the scenario.
**3. Performance.** We can scale the area that requires it e.g. if the workflow engine struggles we scale that, and if any of the execution tasks need resources we scale that.
**4. Testing.** We can test process logic and task execution separately.

And some downsides:
**1. Headaches.** More than one technology to maintain.
**2. Complexity.** It might not always be obvious how the different pieces fit together, making it more challenging to maintain.

## Test
Lots of our customers still use files as part of their system integration flows. Files from System A are used to update System B. There are usually tens to hundreds of formats, all with different rules to apply. A common way to do this is to import the file into a staging database, enrich the data, validate the data, and then update the target.

So to test the idea of using Linx with Camunda, I decided to build a generic file import process. We add new file imports by adding the task automation in Linx. The workflow itself stays the same.

The generic file import process looks like this:

![workflow import process](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g4ohpn14akzcurt0t3gi.png)

All the Service Tasks (those with the gears) are also External Tasks. They are executed outside of Camunda, in this case by Linx.

My initial architecture had Camunda calling a [Microservice](https://linx.software/apis-vs-microservices/) hosted by Linx to execute the tasks.

![Linx workflow](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/foukwm1a203rvg09f00l.png)

1. Linx calls the Camunda API to start a new process instance.
2. Camunda call the Linx Task API when it processes an External Task. It waits when it reaches a User Task.
3. User Interface calls the Linx UI API when the user completes a User Task. Linx notifies Camunda that the task is complete.

But after figuring out that I would have to write code and do some configuration of my Camunda instance to be able to call external APIs, I decided to try a different tact and ended up with this:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/07hm35v4xq410ajll4cr.png)

1. Linx calls the Camunda API to start a new process instance.
2. Linx polls Camunda for External Tasks, executes them, and notifies Camunda that the task is complete.
3. User Interface calls the Linx UI API when the user completes a User Task. Linx notifies Camunda that the task is complete.


Linx polls Camunda for work and executes it instead of Camunda calling into Linx.

The process of building it was easier than expected.

– Design the workflow with Camunda Modeler.

– Create a function in Linx for each Service Task in Camunda. These functions should be idempotent as they might be called more than once for the same workflow instance if something goes wrong between Camunda and Linx.

– Create a Timer Service in Linx to poll Camunda for tasks.

– Add a function in Linx to match the Task Id with its related Linx function.

## Result
I quite like how this turned out. Combining a proper workflow engine with a developer-friendly low-code tool gives us the best of both worlds. It’s overkill for simple processes, but the added complexity should be worth it when they get elaborate.

The project is available on [Github](https://github.com/linx-software/file-import-process).

**Resources**
[Linx documentation](https://linx.software/docs/)
[Camunda documentation](https://docs.camunda.org/)












The post [Workflow meets Low-code. A perfect match?](https://linx.software/workflow-meets-low-code-a-perfect-match/) appeared first on [Linx](https://linx.software).