flomise
v0.0.6
Published
An Async Workflow Engine
Readme
flomise
Flow + Promise: an async workflow engine.
- Sub-workflow
- Concurrency control
- Retry policy
- Execution monitor
Installation
npm i flomiseUsage
// Define workflow
const hello = workflow('hello')
.input((message: string, count: number) => message + ':' + count)
.action(async (_ctx, message, count) =>
Array.from({ length: count }, (_, i) => (i > 0 ? ',' + message : message)).join('')
);
// Execute workflow
const engine = createEngine();
const result = await engine.run({}, hello, 'world', 3);
// result: 'world,world,world'// Define workflows
const echo = workflow('echo')
.input((message: string) => message)
.action(async (_ctx, message) => `echo "${message}"`);
const hello = workflow('hello', {})
.input((message: string, count: number) => message + ':' + count)
.action(async (ctx, message, count) => {
const echoed = await ctx.run(echo, message);
return Array.from({ length: count }, (_, i) => (i > 0 ? ',' + echoed : echoed)).join('');
});
// Execute workflow
const engine = createEngine();
const result = await engine.run({}, hello, 'world', 3);
// result: echo "world",echo "world",echo "world"License
MIT License © 2026 XLor
