Embedded workflow engine
Stabilize
AvailableOrchestration wi nae server tae rin.
Stabilize is a Python library that rins workflows inside yer ain application. There is nae orchestrator service tae deploy, secure or keep available. It implements the 43 control-flow patterns catalogued by van der Aalst an colleagues, frae a plain sequence tae a race atween a reviewer an an escalation timer. It is built for wark that haunds aff tae AI agents. Because it records ilka step as an event, a workflow resumes whaur it stopped efter a crash.
Wha it is for. Teams that wants dependable, repeatable warkflows inside an existin application, without bringin in anither service tae run.
- Status
- Available
- Pairt o
- Open soorce
- Licence
- Open soorce, Apache 2.0
- Product site
- stabilize.readthedocs.io/en/latest
- Tags
- EmbeddedWarkflow paternsCrash recoveryPython library
Technical specification
Writ for a technical assessor. A raw wi nae measured value is quat.
Splits an joins
- Joins
- Wait for ilka incomin branch (the defaut), for the branches an OR-split chusit, for the first tae finish, or for a set nummer o thaim. A multi-merge rins ance for ilka branch that arrives, yin rin at a time.
- Condeetions
- Ilka branch o an OR-split haes a condeetion ower the stage’s context an ootputs. Condeetions use comparesons, and, or, not, in, an nested lookups. Stabilize parses ilka condeetion an accepts anerly that fixed set o operators. A condeetion canna rin arbitrary code.
- Branch prunin
- A branch that nae split chusit is skipt alang wi ilka stage ahin it. A join whas branches wur a' skipt is skipt forbye, an the workflow disnae pass through it.
Races, yates an locks
- Deferred choice
- Stages in yin gruop race. The gruop is decidit whan the first member starts, or whan the first yin finishes. A losin stage is skipt, an yin that is aaready rinnin is cancelled wi its clean-up hook.
- Milstanes
- A stage can be alloued anerly whiles anither stage is in a gien status. For exemplar, a route chynge is accepted anerly till the ticket haes been issued.
- Mutual exclusion
- Stages that share a lock name daena rin at the same time. A blocked stage gaes back on the queue till the hauder finishes.
- Concurrency leemit
- A pipeline can cap hoo monie o its rins execute at aince. Rins ower the cap bide in a buffered state an start whan a slot frees.
Signals an cancellation
- Pruse an resume
- A task suspends till a named signal arrives. Whan it resumes, it reads the signal’s name an data.
- Transient or persistent
- A transient signal is drapt gin the stage isnae waitin for it. A persistent signal is held till the stage suspends, up tae 1,000 per stage bi defaut. A signal that arrives at a fou buffer gaes tae the dead-letter queue. It can be inspected an replayed frae thar.
- Finished stages
- A signal sent tae a stage that haes feenished is refused an logged. A comman redds oot buffers left behin bi earlier versions an can report whit it wud redd afore it chynges onythin.
- Cancellin
- Cancel the yin stage, a hale workflow, or onie stage tagged wi a named region. A cancelled task rins its ain clean-up hook.
Loops, retries an sub-workflows
- Jumps
- A task can sen the workflow tae onie stage, forrit or back. Onie stage may jump 10 times bi defaut, an the limit can be chynged for a workflow. The workflow keeps a historie o its jumps.
- Structured loops
- While an repeat-until loops hae a maximum nummer o passes. A condeetion that names a value naethin provides fails the stage at yince. A nested loop gets its fou budget agane on ilka pass o the ooter loop.
- Retries at keeps progress
- A task that hits a temporary error can say whan tae try agane an hain hoo faur it got. The neist attempt sterts frae that point.
- Sub-workflows
- A stage can stert a bairn workflow an wait on it, up tae 10 levels deep bi defaut. The bairn is stored an stertit in the yin transaction. A message delivered agane efter a crash finnds the bairn that areadys exists. An optional timeout boonds the hale bairn run, an cancellin the parent cancels the bairn.
Multiple instances
- Hoo monie
- A fixed nummer, a nummer read frae the workflow’s data at run time, or the yin instance for ilka item in a leet. The join can wait on aw o them, for a set nummer o them, or no wait at aw.
- Eikit at run time
- Instances can be eikit while the parent stage is runnin. The caw returns yince the instance is stored, or names the raison it wis refused.
- Stages roon a stage
- A stage type can eik stages that rin afore it, efter it, or whan it fails. Thir cairry setup, clean-up, validation an rollback.
Whit it daes
-
Rins inside yer application
Ye import it like onie ither library. There is nae separate orchestrator tae deploy or keep rinnin.
-
The 43 workflow patterns
It implements the control-flow catalogue o van der Aalst an colleagues. An unco sequencing need is usually yin settin on a stage.
-
Joins that wait for the richt branches
A join can wait for ivery branch, for only the branches a split chose, for the first tae finish, or for three o five.
-
Unchosen branches stay aff
Whan a split disnae choose a branch, that branch an the stages ahin it are skipped. A stage that a chosen branch reaches forbye still runs yince.
-
Races atween fowk an timers
Pit a reviewer an a 30-minute escalation timer intil ane group. Whichever feenishes first wins, an Stabilize ca's aff the ither an rins its reddin-up.
-
Signals that bide on the stage
A stage can stan ower till an approval or a file comes in. A persistent signal sent oot aerly is hauden till the stage is ready, up tae 1,000 per stage bi defaut.
-
Loops wi a budget
While an repeat-until loops cairy their values frae yin pass tae the neist. A loop that reaches its leemit lats the workflow gang on an tells later stages it ran oot.
-
Wark that fans oot at rin time
Rin ane instance per reviewer, per item in a leet, or per coont red at rin time. A planner can eke instances while it is aye rinnin, an the join bides for thaim forbye.
Documentation an access details is on the product site, stabilize.readthedocs.io/en/latest. For a pilot, an integration or procurement questions, contact us.