Zàf Mohammed
Zàf Mohammed

Reputation: 117

I don't get workflow, workflow automation or workflow orchestration

Why do we need special software like Uber's Cadence or Camunda or Activiti? If it's just a sequence of tasks then why can't we just code it? I've trying to read Camunda and Cadence's docs and just can't get into it. My company wants to use. The senior dev who thought about it can't/won't seem to explain why or where he wants to use it.

And I find their code / way of setting up workflows very unintuitive. Somebody please help.

The project is developed using Java and Spring Boot.

Upvotes: 7

Views: 2407

Answers (2)

rob2universe
rob2universe

Reputation: 7583

It could take a book to answer the question. A few aspects:

  • Communication between business and IT
    You cannot show code to the business, but people understand BPMN diagrams. At least the basics set of symbols is quite intuitive (http://bpmn.io/ or https://www.omg.org/spec/BPMN/2.0/About-BPMN/#documents) . Where Would you start explaining the logic of your coded workflow to a business analyst? And how do you translate the feedback regarding the business rules into code?
    If requirements are not well translated into the target system then you get additional iterations and effort. BPMN diagrams can be interpreted by a process engine, so there is no mismatch between the operational process discussed with business and the process executed.

  • Flexibility / separation of concerns
    A process model reflects the business logic and allows you to separate it from the code. By not burying it in the code the business logic becomes easier to understand (see previous paragraph) and change. It can also be versioned independently. The lifecycle of business rules, process logic and other (e.g. integration) code is frequently very different. Faster changes to IT systems means improved business agility.

  • Transparency
    The workflow engine ootb monitors the status and collects all the (frequently mandatory) audit data. Where are we in a specific process execution? Why is it not progressing? Who performed which step and when? How long did it take? Which data was changed?
    Based on this data you can generate reports (average processing time of your bank account opening process over the last 12 months?) and analytics (risk to lose the customer given certain circumstances?)

  • Standardized features which you would have to program
    Would you develop you own database? No, then why would you develop your own workflow management? State management, work assignment (user, roles, groups), permission concept on tasks and data, logging of audit information, error handling, thread management, retries, standard reports,....

I could go on, but this should give you an idea. Further reads could be:

https://thenewstack.io/5-workflow-automation-use-cases-you-might-not-have-considered/

https://blog.bernd-ruecker.com/the-microservice-workflow-automation-cheat-sheet-fc0a80dc25aa

https://www.ecosia.org/search?q=why+workflow+engines

Upvotes: 8

Maxim Fateev
Maxim Fateev

Reputation: 6870

What do you mean by "just code it"? Ok let' look at the following code:

String r1 = task1(someArg);
String r2 = task2(r1);
if (r2.equals("foo")) {
   sleep(Duration.ofHours(5));
   task3(r2);
} else {
   task4(r2);
}

Now go and "just code" it to be scalable and fault-tolerant (for example against process failures while task2 is being executed) and be robust for long downtimes of any of those task implementations. I bet your code will a buggy mess of callbacks and database calls.

Temporal Workflow allows writing such code and makes it fault-tolerant without any large modifications.

Upvotes: 10

Related Questions