@elsium-ai/workflows 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# @elsium-ai/workflows
|
|
2
|
+
|
|
3
|
+
Multi-step workflow pipelines and DAG execution for [ElsiumAI](https://github.com/elsium-ai/elsium-ai).
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@elsium-ai/workflows)
|
|
6
|
+
[](https://github.com/elsium-ai/elsium-ai/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @elsium-ai/workflows @elsium-ai/core
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## What's Inside
|
|
15
|
+
|
|
16
|
+
- **Sequential Steps** — Chain operations with automatic data passing
|
|
17
|
+
- **Parallel Execution** — Run independent steps concurrently
|
|
18
|
+
- **Branching** — Conditional workflow paths based on runtime results
|
|
19
|
+
- **Retries** — Per-step retry policies with backoff
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { defineWorkflow, step } from '@elsium-ai/workflows'
|
|
25
|
+
|
|
26
|
+
const pipeline = defineWorkflow('analyze', [
|
|
27
|
+
step('fetch', async (input) => {
|
|
28
|
+
return await fetchData(input.url)
|
|
29
|
+
}),
|
|
30
|
+
step('process', async (data) => {
|
|
31
|
+
return await processData(data)
|
|
32
|
+
}),
|
|
33
|
+
step('summarize', async (processed) => {
|
|
34
|
+
return await llm.complete({
|
|
35
|
+
messages: [{ role: 'user', content: `Summarize: ${processed}` }],
|
|
36
|
+
})
|
|
37
|
+
}),
|
|
38
|
+
])
|
|
39
|
+
|
|
40
|
+
const result = await pipeline.run({ url: 'https://example.com' })
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Part of ElsiumAI
|
|
44
|
+
|
|
45
|
+
This package is the workflow layer of the [ElsiumAI](https://github.com/elsium-ai/elsium-ai) framework. See the [full documentation](https://github.com/elsium-ai/elsium-ai) for guides and examples.
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
[MIT](https://github.com/elsium-ai/elsium-ai/blob/main/LICENSE)
|