@doclo/flows
v0.1.11
Published
Flow orchestration and execution engine for document processing pipelines
Readme
@doclo/flows
Flow builder and execution engine for document processing pipelines.
Installation
pnpm add @doclo/flowsUsage
import { createFlow, parse, extract } from '@doclo/flows';
import { createVLMProvider } from '@doclo/providers-llm';
const provider = createVLMProvider({
provider: 'google',
model: 'gemini-2.5-flash',
apiKey: process.env.GOOGLE_API_KEY!
});
const schema = {
type: 'object',
properties: {
invoiceNumber: { type: 'string' },
total: { type: 'number' }
}
};
const flow = createFlow()
.step('parse', parse({ provider }))
.step('extract', extract({ provider, schema }))
.build();
const result = await flow.run({ base64: documentBase64 });
console.log(result.output);Flow Methods
createFlow()
.step(id, node) // Add a sequential step
.conditional(id, fn) // Add conditional branching
.forEach(id, childFlowFn) // Process arrays in parallel
.output({ name, source }) // Mark explicit output
.build() // Build executable flowAvailable Nodes
Re-exported from @doclo/nodes:
parse- Extract text from documentssplit- Split multi-doc PDFs into segmentscategorize- Classify documents into categoriesextract- Extract structured data using schemachunk- Split text into chunkscombine- Merge resultstrigger- Execute another flow
License
MIT
