import { Flow } from '@re-factor/sdk';
const documentProcessingFlow = {
name: 'document_processing',
description: 'Processes and analyzes documents',
version: '1.0.0',
steps: [{
name: 'extract_text',
type: 'tool',
config: {
tool: 'pdf_extractor',
input: '{{ document }}'
},
errorHandling: {
retry: true,
fallback: 'skip_document'
}
}, {
name: 'analyze_content',
type: 'prompt',
config: {
prompt: 'Analyze this text: {{ extract_text.output }}',
model: 'gpt-4'
}
}, {
name: 'generate_summary',
type: 'agent',
config: {
agent: 'content_summarizer',
input: '{{ analyze_content.output }}'
}
}],
state: {
type: 'memory',
config: {
persistence: false
}
},
monitoring: {
metrics: ['step_duration', 'error_rate'],
callbacks: {
onStepComplete: (step: string, result: any) => {
console.log(`Completed step: ${step}`);
}
}
}
};