Use case
The Weekly Executive Report
Assemble the Monday report on a schedule, and stop with an error when a source is down instead of producing a report with a hole in it.
- Stack Cognipeer Flows + agent schedule trigger
- Pattern Flow · Reporting
- Read ~5 min
Overview
Every Monday, three people pull numbers from four systems and paste them into a deck. This flow calls each system, checks the answers, asks a model to write the narrative from the numbers, renders a PDF and mails it.
Enterprise module
Flows is the enterprise flows module. See Flows.
The shape of the flow
Start
|
v
HTTP request (sales API) --> HTTP request (support API) --> HTTP request (finance API)
|
v
Condition: all three answered with data? --false--> End (Finish as: Failed)
|true
v
LLM (narrative from the numbers) --> Create PDF --> Save file --> Send email --> EndBuild it
- Pull the numbers. One HTTP request step per source. Put credentials in Config items and choose them under Authentication (Bearer token, Basic or Custom header) with Secret; they never appear in the step text. Leave Fail on 4xx / 5xx on, set a Timeout, and give each step an Attempts retry for flaky sources.
- Fail fast, on purpose. Add a Condition that checks each response has the fields the report needs. On the false branch use End with Finish as Failed and an Error message naming the missing source. A failed run shows up in the runs list; a report with a quiet hole does not.
- Write the narrative from the numbers. An LLM step gets the checked numbers in its Prompt and instructions to describe only what the numbers show: no figures that are not in the input, week-over-week movement first, then risks.
- Produce the artefact. Create PDF (source Markdown), then Save file (content Base64) into a bucket, and Send email to the readers with the narrative in the body. Declare the file id as a flow output.
- Run it on a schedule. A flow has no schedule of its own. Expose it as a tool on a Smart Agent (Expose as tool on the flow) and add a
scheduletrigger to the agent, for example0 7 * * 1with your time zone and a prompt such as "Run the weekly report". Or call the Flows API from your own scheduler.
Pitfalls
- A test run is a real run. It calls the real systems and sends real email. While building, point Send email at a test mailbox.
- Do not let the model do arithmetic. Compute totals in the flow (a Transform or Run code step) and give the model the results.
- Check the failure path. Switch a source off once and confirm the run fails with your message.

