Product · Report generation
Templates with blocks, from data extracts to finished Word
ReportGenerationTemplate stores blocksJson, numberingStyle, and textStyle. Jobs copy the template, create tasks per block in topological order, and fill reportGenerationActiveResult as an editable draft per block. Word export can be partial before all blocks are finished.

Overview
Visible blocks and data blocks can depend on each other (including deep_research references).
Preview jobs (POST /report-generation/preview) + status let you validate a block in isolation or in a chain.
Worker (reportGenerationJob.js) runs the analysis service for AI-intensive blocks and updates result tables.
Word export
Report to .docx
GET /export/report-generation/word/:jobId builds .docx via the docx library: headings follow the job's numberingStyle; content can include Mermaid diagrams rendered to PNG (Puppeteer/Sharp in backend).
