> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Receive the report result as an event (automated)

> Get report.finished or report.partial from Reporter through Streaming Hub, then download the file or read what failed.

Learn that a report is ready from an event, instead of reading its status again and again.

## Participants

***

* **Your institution.** Your system that receives the event and calls the Reporter API.
* **Reporter.** Records the result of the report and publishes the event.
* **Streaming Hub.** Delivers the event to your subscription.

## Before you start

***

* Streaming Hub receives Reporter events in your environment.
* You have an active Streaming Hub subscription that receives `report.finished` and `report.partial` at major version `2`. See [Managing subscriptions](https://docs.lerian.studio/en/platform/streaming-hub/managing-subscriptions.md).

## Diagram

***

![Receive the report result as an event](https://mintcdn.com/lerian-49cb71fc/KypD0TIKUCqZ014J/images/en/d2/id-reporter-receive-the-report-result.svg?fit=max\&auto=format\&n=KypD0TIKUCqZ014J\&q=85\&s=0516ed4614f9079d951a18ff8c438064)

## What the system does on its own

***

| # | From | To | Message | Lerian API | What happens |
| - | - | - | - | - | - |
| 1 | Reporter | Reporter | Internal step | | Reporter stores the file and records the status `Finished` or `Partial`. |
| 2 | Reporter | Streaming Hub | Event | [`report.finished` or `report.partial`](https://docs.lerian.studio/en/reference/events/reporter) | Reporter publishes the event after it records the status. |
| 3 | Streaming Hub | Your institution | Event | [`report.finished` or `report.partial`](https://docs.lerian.studio/en/reference/events/reporter) | Streaming Hub delivers the event to your subscription. |
| 4 | Your institution | Reporter | Lerian API | [`GET /v1/reports/{id}/download`](https://docs.lerian.studio/en/reference/products/reporter/download-report) | For `report.finished`, download the file. The `report_id` field of the event is the `{id}`. |
| 5 | Reporter | Your institution | Response | | Reporter returns the file. |
| 6 | Your institution | Reporter | Lerian API | [`GET /v1/reports/{id}`](https://docs.lerian.studio/en/reference/products/reporter/check-report-status) | For `report.partial`, read the report. |
| 7 | Reporter | Your institution | Response | | Reporter returns the report. Its `metadata` names the data sources that failed. |

## Rules

***

* Through Streaming Hub, you receive an event when a report ends as `Finished` or `Partial`.
* You can receive the same event more than once. Drop a repeat by its event ID, as [Consuming events](https://docs.lerian.studio/en/platform/streaming-hub/consuming-events.md) describes.

## How you know it finished

***

You received `report.finished` and downloaded the file. Or you received `report.partial` and read the data sources that failed.

## What can go wrong

***

| Situation | What you see | What to do |
| - | - | - |
| No event arrives | No delivery for the report | Read the report status. The report can still be `Processing`, or it ended as `Error`. |

## Related

***

* [Generate and download a report](https://docs.lerian.studio/en/diagrams/lerian-products/reporter-generate-a-report.md)
* [Reporter events](https://docs.lerian.studio/en/reference/events/reporter.md)
* [Consuming events](https://docs.lerian.studio/en/platform/streaming-hub/consuming-events.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.