@eidentic/workflow
v0.2.0
Published
Durable workflow orchestration for Eidentic — composable steps, parallel execution, retries, branching, agent integration, and persistent run registry.
Downloads
1,386
Maintainers
Readme
@eidentic/workflow
Durable workflow orchestration for Eidentic — composable step primitives, parallel
execution, fan-out/fan-in, retries with back-off, branching, timeouts, an agent-step
adapter, and a persistent WorkflowRunRegistry for tracking run history. Used by
@eidentic/server to expose workflow runs over HTTP.
Install
pnpm add @eidentic/workflowUsage
import { step, chain, parallel, retry } from "@eidentic/workflow";
// Define steps as typed async functions
const fetchData = step(
"fetch-data",
async (input: { url: string }) => {
const res = await fetch(input.url);
return res.json() as unknown;
},
);
const processData = step(
"process-data",
async (data: unknown) => ({ result: JSON.stringify(data).length }),
);
// Compose with chain, retry, parallel
const pipeline = chain(
retry(fetchData, { maxAttempts: 3 }),
processData,
);
// Run the pipeline
const result = await pipeline({ url: "https://example.com/api" }, { traces: [] });
console.log(result); // { result: 42 }
// Parallel fan-out
const tasks = parallel([fetchData, fetchData]);Links
Apache-2.0
