shar

module
v1.1.2209 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT

README

Simple Hyperscale Activity Router

What is SHAR?

SHAR is a workflow engine powered by message queue. It is capable of loading and executing BPMN workflow XML. It aims to be small, simple and have a tiny footprint.

To achieve scalability, the workflow transition, and activity calls are sent as immutable messages encapsulating their state. SHAR uses a nats.io backend by default to facilitate redundancy and high throughput whilst still being able to run on low-power hardware.

SHAR is 100% written in go, so takes advantage of the speed and size of a native executable.

Why is SHAR?

Most BPMN engines are heavyweight and rely on proprietary storage and retry logic. SHAR concentrates on being a workflow engine and lets reliable message queuing do the heavy lifting.

The developers of BPMN engines put a lot of work into making the persistence, scalability, resilience and retry logic for their products. Messaging platforms such as nats.io have already tackled these challenges, and their dedicated solutions are usually more performant.

There is a tendency to write the engines in Java, which in turn requires a JVM to run. Many give Go developers a native client to run workflows, but the engines remain a black box only extensible through Java.

How do I use SHAR?

Check out out quickstart guide. And our documentation.

Prerequesits

Install the packages to build and run the SHAR-server, SHAR-telemetry or examples on this box :-

golang make protobuf-compiler protoc-gen-go docker (optional)

Building

to build use :-

make configure
make

Running from cmdline

You then need to start the shar-server and the shar-telemetry

build/telemetry/shar-telemetry
build/server/shar 

Running as a docker image

We suggest using the docker loopback address host.docker.internal to reach NATS running on the same docker node/swarm, the localhost address 127.0.0.1 (default) will be local to the container so fails. If the address doesn't resolve, it will be something like 172.17.0.1 or 172.18.0.1.

make docker
docker run -d -e NATS_URL=nats://host.docker.internal:4222 shar
docker run -d -e JAEGER_URL=http://host.docker.internal:14268/api/traces -e NATS_URL=nats://host.docker.internal:4222 shar-telemetry

The SHAR BPMN editor

The SHAR BPMN editor is a web application that can be used to create and edit BPMN workflows.

Build CLI tool

cd cli/cmd/shar
go build

Running the server from the CLI tool with a built in nats server on port 4222

shar serve all --server 127.0.0.1:4222

Using CLI tool

You can view the workflows already registered, check connectivity, build examples and register service tasks.

shar --help

Directories

Path Synopsis
cli
cmd/shar command
api
base62
Package base62 implements base62 encoding.
Package base62 implements base62 encoding.
version
Code generated by build process.
Code generated by build process.
zen
protodoc command
rerouter
cmd/rerouter command
api
cmd/shar command
telemetry
utilities
upgradetest command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL