<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged bpmn</title>
<link>https://coderlegion.com/tag/bpmn</link>
<description>Powered by Question2Answer</description>
<item>
<title>BPMN as Code: From a Text-Based Model to a Working Microservices Sagas</title>
<link>https://coderlegion.com/32482/bpmn-as-code-from-a-text-based-model-to-a-working-microservices-sagas</link>
<description>&lt;p&gt;&lt;strong&gt;Contents&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#issues-with-conventional-bpmn-tools&quot;&gt;Issues With Conventional BPMN Tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#discovering-mermaid-bpmn&quot;&gt;Discovering Mermaid-BPMN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#making-it-practical&quot;&gt;Making It Practical&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#a-real-world-example-modeling-a-payment-saga&quot;&gt;A Real-World Example: Modeling a Payment Saga&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#from-bpmn-source-to-an-executable-saga&quot;&gt;From BPMN Source to an Executable Saga&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#conclusions&quot;&gt;Conclusions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;I've used Documentation as Code for years when designing backends and entire applications. Most of my diagrams are written in PlantUML, with their source stored alongside other design documents. It suits me much better than drawing everything by hand.&lt;/p&gt;
&lt;p&gt;Then I had to model a microservices Saga for Camunda. The process involved parallel checks, deadlines, human decisions and compensation. I wanted to write BPMN the same way I wrote UML, but couldn't find a toolchain I was comfortable using. Eventually I found Mermaid-BPMN and built a workbench around it.&lt;/p&gt;
&lt;h3 id=&quot;issues-with-conventional-bpmn-tools&quot;&gt;Issues With Conventional BPMN Tools&lt;/h3&gt;
&lt;p&gt;I tried the obvious options. I find arranging shapes in draw.io or Camunda Modeler slow, particularly when a process keeps changing. I'd rather edit source and immediately see what the diagram looks like.&lt;/p&gt;
&lt;p&gt;BPMN XML is source too, technically. But it is cumbersome to write from scratch and not much better to edit by hand. I also looked at other BPMN DSLs. Their diagrams didn't look right to me.&lt;/p&gt;
&lt;p&gt;I wanted readable source and conventional BPMN diagrams, including horizontal pools and lanes. I also wanted a live editor on my own host and a CLI for generating SVGs from local files. Although my implementation used Camunda, I didn't want the modeling tools tied to one process engine.&lt;/p&gt;
&lt;p&gt;And the diagrams had to be readable by people besides developers: architects, product owners, business analysts and anyone reviewing the process.&lt;/p&gt;
&lt;h3 id=&quot;discovering-mermaid-bpmn&quot;&gt;Discovering Mermaid-BPMN&lt;/h3&gt;
&lt;p&gt;After I inspected a few other tools, I came across the great &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/derari/mermaid-bpmn&quot;&gt;derari/mermaid-bpmn&lt;/a&gt;, an external Mermaid plugin with its own BPMN DSL, rich and comprehensive. It supports vertical and horizontal BPMN directions, activities, pools and lanes, gateways, events and annotations. There was also a basic live-editor example.&lt;/p&gt;
&lt;p&gt;I liked the language and the diagrams it generated. The DSL, parser, renderer and original editor are all the original author's work. I started with that project and added what I needed for day-to-day use. The result is &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/84-mermaid-bpmn-workbench/workbench&quot;&gt;Mermaid BPMN Workbench&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;making-it-practical&quot;&gt;Making It Practical&lt;/h3&gt;
&lt;p&gt;First, I packaged the editor for deployment with Docker. It builds to static files served by Nginx, so I can run it on my own host without keeping the development server running. The &lt;a rel=&quot;nofollow&quot; href=&quot;https://hub.docker.com/repository/docker/valentineshidev/mermaid-bpmn-workbench-web-editor&quot;&gt;image is available on Docker Hub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I then worked on the editor itself. With a large process diagram, I need to zoom in, move around and quickly return to the full view. So I added pan, zoom and fit controls. I added source-pane width presets and font-size controls, too. The source and these settings are saved in the browser and restored after a reload. There is also a clear-source button and an option to open the full SVG in a separate tab.&lt;/p&gt;
&lt;p&gt;One detail took a little care. Pan and zoom change the SVG displayed in the editor. Exporting that modified SVG could give you the part you were looking at rather than the complete diagram. I keep a clean snapshot for downloads and the Open SVG action.&lt;/p&gt;
&lt;p&gt;I also needed SVGs for documentation, without opening the browser editor each time. I built a &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.npmjs.com/package/mermaid-bpmn-cli&quot;&gt;Mermaid-BPMN CLI&lt;/a&gt; for that. It generates an svg with this one-liner.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-sh&quot;&gt;npx mermaid-bpmn-cli --browser /path/to/chrome payment-process.mmd
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It writes &lt;code&gt;payment-process.svg&lt;/code&gt; next to the source. Currently it requires Node.js 22.12 or later and an installed Chrome or Chromium executable; you have to pass the browser path explicitly. I have used the CLI in my project's documentation workflow since that. It simplifies the workflow a lot. Also can be used in automated CI workflows for Documentation-as-Code.&lt;/p&gt;
&lt;h3 id=&quot;a-real-world-example-modeling-a-payment-saga&quot;&gt;A Real-World Example: Modeling a Payment Saga&lt;/h3&gt;
&lt;p&gt;The process that prompted all this was a payment Saga (here is the link to the &lt;a rel=&quot;nofollow&quot; href=&quot;https://gist.github.com/WhereJuly/8dfcc0018efe0c9bbc5e01c807ab3889&quot;&gt;anonymized source&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;It starts by debiting the payer, then runs anti-fraud and compliance/restriction checks in parallel. The results can lead to approval, denial, manual review or suspicious-payment handling.&lt;/p&gt;
&lt;p&gt;The checks have a 30-second deadline. If they don't finish in time, the process refunds the payer. Manual review has a 20-minute deadline, with the same default outcome if nobody makes a decision. We chose these defaults because processing an erroneous payment would cost considerably more than rejecting a valid one. I put that reasoning in annotations next to the relevant paths.&lt;/p&gt;
&lt;details&gt;
&lt;summary&gt;The Diagram&lt;/summary&gt;

![The Diagram](./images/payment-saga.svg)
    
&lt;/details&gt;
&lt;p&gt;The transfer to the payee is marked as an irreversible pivot point. Earlier failures are handled by compensation: an automatic refund and a rollback of payment status. Suspicious payments also trigger a security notification in parallel with the refund, with the paths joining before the final outcome.&lt;/p&gt;
&lt;p&gt;This is the kind of process I wanted to keep in a text file: branches, timers, compensation, and the business reasons for some of the decisions. I can change the source, review the diff and regenerate the diagram.&lt;/p&gt;
&lt;h3 id=&quot;from-bpmn-source-to-an-executable-saga&quot;&gt;From BPMN Source to an Executable Saga&lt;/h3&gt;
&lt;p&gt;I also took the Saga through implementation. The microservices were deployed, the Saga coordinated them, and I tested the cases in the implemented process.&lt;/p&gt;
&lt;p&gt;For the engine, I needed BPMN XML. I had an AI agent translate the DSL, reviewed the result myself, manually validated it and used Camunda Modeler for static debugging before deployment. I was glad to have the Modeler for that part, even though I didn't want to use it for writing the original model.&lt;/p&gt;
&lt;p&gt;This translation step isn't a Workbench feature. The workbench gives me the source editor and SVG generation; translation, engine validation, deployment and testing are steps in my project. I checked that the executable process preserved the deadlines, branches and compensation behavior in the model.&lt;/p&gt;
&lt;h3 id=&quot;conclusions&quot;&gt;Conclusions&lt;/h3&gt;
&lt;p&gt;I believe, this tooling is useful for any modeler - architects, developers, business analyst and product owners - all who has to model and align the business processes with the stakeholders conveniently and quickly.&lt;/p&gt;
&lt;p&gt;You can &lt;a rel=&quot;nofollow&quot; href=&quot;https://bpmn.valentineshi.dev/8e32d454e/&quot;&gt;try my hosted editor&lt;/a&gt;. The &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/84-mermaid-bpmn-workbench/workbench&quot;&gt;Workbench repository&lt;/a&gt; includes &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/84-mermaid-bpmn-workbench/workbench/tree/master/web-editor/examples&quot;&gt;deployment instructions&lt;/a&gt;, and the &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.npmjs.com/package/mermaid-bpmn-cli&quot;&gt;CLI is on npm&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Also, it were not be possible without the Mermaid-BPMN &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/derari/mermaid-bpmn&quot;&gt;implementation&lt;/a&gt; project by Derari.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/32482/bpmn-as-code-from-a-text-based-model-to-a-working-microservices-sagas</guid>
<pubDate>Mon, 26 Oct 2026 08:43:45 +0000</pubDate>
</item>
<item>
<title>What even is orchestration?</title>
<link>https://coderlegion.com/11918/what-even-is-orchestration</link>
<description>&lt;p&gt;I accidentally ended up in the process automation and orchestration space when I started my career, and somehow even more accidentally I'm still there. As Taylor Swift says, &quot;help, I'm still at the restaurant.&quot;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://media0.giphy.com/media/v1.Y2lkPTc5MGI3NjExY3VpenFmYmR0cDl6ZnV5cXp5YXFvc290NnpxcTk3aGRtNm9jeDEyZSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/zhyjappep7O1bj2bsL/giphy.gif&quot; alt=&quot;Taylor Swift waving to the crowd at the beginning of the Eras Tour&quot;&gt;&lt;/p&gt;
&lt;p&gt;Being in the enterprise software space this long, I feel like the pendulum has swung back and forth between &quot;buy a full suite platform, it has everything you need&quot; and &quot;avoid vendor lock-in&quot; and something in between. AI has certainly left it's mark, but hasn't changed things all that dramatically.&lt;/p&gt;
&lt;p&gt;You'll find people and companies saying you need a specialized purpose-built platform with a very specific set of use cases or personas or one that's agnostic and fits any and all needs.&lt;/p&gt;
&lt;p&gt;It's no different in the process automation and orchestration space. &lt;/p&gt;
&lt;p&gt;All of this to say, we still have the same problem - this separation in ownership and responsibilities from the thing we want to improve and how it's actually going to be improved. You often here this positioned as &quot;the business&quot; and &quot;the development team&quot;. &quot;The business&quot; gets pitched as this non-technical group of diagram drawing, process optimizing suits while &quot;the development team&quot; adds the code and system integrations to make the diagram actually work, but doesn't &lt;em&gt;own&lt;/em&gt; the process.&lt;/p&gt;
&lt;p&gt;I still look back on my early career days and remember our business partner asking if she could just give me a Visio diagram and could I turn that into BPMN for her because the standards were too technical. BPMN... as in the standards that were supposed to be the literal language that filled this &quot;gap&quot; between &quot;the business&quot; and &quot;the development team&quot;... was too technical. Interesting. &lt;/p&gt;
&lt;p&gt;I have this hypothesis that people in tech generally understand process automation and why it's beneficial, but only certain areas and roles within tech seem to really resonate with the term &quot;orchestration&quot;. So maybe let's talk about that a bit and give you a few examples of where orchestration really shines. Then you can tell me your definition. &lt;/p&gt;
&lt;h3 id=&quot;ok-so-what-is-orchestration-&quot;&gt;Ok, so what is orchestration?&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://media3.giphy.com/media/v1.Y2lkPTc5MGI3NjExeTNybXV3NDBxZnd3cDhoNnVqMWkyZXU5ZDYyYmZ2MTlqenRkdDFlNSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/3ohhwBL1q1I66srvAA/giphy.gif&quot; alt=&quot;A broad zoom in on a conductor of a string orchestra&quot;&gt;&lt;/p&gt;
&lt;p&gt;You would think it's overdone, but the analogy of a conductor with an orchestra really fits here. You have a bunch of different instruments kind of doing their own thing, but together, with the help of a conductor, making a beautiful coherent piece of music happen. They get clues on when to speed up, slow down, or when to play with more or less intensity. &lt;/p&gt;
&lt;p&gt;But I can see how that doesn't translate super well to tech.&lt;/p&gt;
&lt;p&gt;Let's get some help from the internets. &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Orchestration is the coordinated execution of multiple IT automation tasks or processes. Orchestration is usually applied across multiple computer systems, applications, and services to ensure that deployment, configuration management, and other processes are performed in the proper sequence.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;Via RedHat&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Orchestration is the coordination and management of multiple computer systems, applications and/or services, stringing together multiple tasks in order to execute a larger workflow or process. More specifically, orchestration is the coordinated execution of multiple IT automation tasks or processes across multiple computer systems, applications and services. These processes can consist of multiple tasks that are automated and can involve multiple systems.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;Via Databricks&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Orchestration is the process of coordinating distributed software components and systems so that they execute seamlessly as an automated, repeatable process.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;Via Orkes&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;These definitions read a lot like the DevOps definitions - multiple systems, coordination, working together with automation, etc.&lt;/p&gt;
&lt;p&gt;Basically, anytime you want to do something complex and chain together a sequence of tasks or coordinate and manage multiple systems, applications, or services either ad-hoc, scheduled, or when &lt;em&gt;something&lt;/em&gt; happens &lt;em&gt;somewhere&lt;/em&gt; you probably want to do it in a clear and reusable way with orchestration. Got it? So clear!&lt;/p&gt;
&lt;p&gt;You'll see orchestration and automation together quite often, but it's typically positioned around the involvement of humans where automation is helping humans, without intervention, complete a single task. Orchestration tends to be more complex, but may involve humans (human-in-the-loop). To what extent humans participate depends. &lt;/p&gt;
&lt;h3 id=&quot;i-think-i-get-it-but-i-need-examples-&quot;&gt;I think I get it, but I need examples...&lt;/h3&gt;
&lt;p&gt;Let's try to make this a little more tangible. &lt;/p&gt;
&lt;h4 id=&quot;data-orchestration&quot;&gt;Data Orchestration&lt;/h4&gt;
&lt;p&gt;You have data everywhere, in multiple disparate systems, and now you want to do something with it. Very everything, everywhere, all at once. This is where you see data pipelines, ETL, etc. come into play. You don't necessarily want to merge all the data together into one big database, but you do want to coordinate across the systems to, say, use the data to make informed decisions. &lt;/p&gt;
&lt;h4 id=&quot;business-orchestration&quot;&gt;Business Orchestration&lt;/h4&gt;
&lt;p&gt;This tends to be where process automation and orchestration live in the traditional IT, HR, and finance workflows. My favorite example in this space is a two-step approval process, because it involved a human-in-the-loop aspect (maybe even two!), but many people have seen this at work or in their personal life. &lt;/p&gt;
&lt;p&gt;If you know what &quot;signature authority&quot; is you've definitely been a part of a process like this, and the larger the organization, the more systems might be involved to make decisions.&lt;/p&gt;
&lt;p&gt;You may encounter a set of rules that fast track you through the process (like my &quot;signature authority&quot; was once $100, which was basically desk trinkets) and anything more than that was escalated to my manager until his &quot;signature authority&quot; limit was hit and then it escalated to his manager. So this system needs to know the org chart, the individuals' &quot;signature authority&quot;, the price of the items to be purchased, etc. All of that info is definitely in different databases, if not completely different systems.  &lt;/p&gt;
&lt;h4 id=&quot;ai-orchestration&quot;&gt;AI Orchestration&lt;/h4&gt;
&lt;p&gt;This is relatively new and gets us into murky territory as well. Agent orchestration, multi-agent systems (MAS), AI pipelines can all fall into this bucket of AI orchestration. MAS for me is really the foundation for where we are at now with AI agents and potentially having them do coordinated work together.&lt;/p&gt;
&lt;p&gt;The agents need data, then with that data they do something with other agents, and something complex happens. &lt;/p&gt;
&lt;p&gt;I'm intentionally being a bit handwavy here because I don't have a great real world example of this yet, just a lot of marketing blogs around specialized agents working together to complete a common goal. &lt;/p&gt;
&lt;h3 id=&quot;but-when-do-you-need-an-orchestrator-&quot;&gt;But when do you need an orchestrator?&lt;/h3&gt;
&lt;p&gt;It depends, of course. &lt;/p&gt;
&lt;p&gt;Some organizations will start building some stitched together, homegrown solution and ultimately hit a point where there is a maintenance or scale issue. Others will realize they want to do something beyond CRON and scheduled jobs, something more real-time and event-based where they need listeners or webhooks.&lt;/p&gt;
&lt;p&gt;Others still will realize they need to do a mix of scheduled, event-based, and manual executions with responsibilities spanning across technical and non-technical roles, and this is usually when they start investigating platforms to handle some of this. &lt;/p&gt;
&lt;h3 id=&quot;so-how-do-you-define-orchestration-&quot;&gt;So, how do you define orchestration?&lt;/h3&gt;
&lt;p&gt;Hopefully, I've given you a bit to think about and start to formulate your own opinion on orchestration. &lt;/p&gt;
&lt;p&gt;What's your definition of orchestration? Are you doing orchestration within your organization? And how did you evaluate your options? &lt;/p&gt;
&lt;h3 id=&quot;sources-amp-further-reading&quot;&gt;Sources &amp;amp; further reading&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.redhat.com/en/topics/automation/what-is-orchestration&quot;&gt;https://www.redhat.com/en/topics/automation/what-is-orchestration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.databricks.com/glossary/orchestration&quot;&gt;https://www.databricks.com/glossary/orchestration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://www.prefect.io/blog/what-i-talk-about-when-i-talk-about-orchestration&quot;&gt;https://www.prefect.io/blog/what-i-talk-about-when-i-talk-about-orchestration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://kestra.io/blogs/orchestration-differences&quot;&gt;https://kestra.io/blogs/orchestration-differences&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://orkes.io/blog/what-is-orchestration/&quot;&gt;https://orkes.io/blog/what-is-orchestration/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/11918/what-even-is-orchestration</guid>
<pubDate>Thu, 19 Feb 2026 20:41:09 +0000</pubDate>
</item>
</channel>
</rss>