> For the complete documentation index, see [llms.txt](https://docs.hos.accessacloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hos.accessacloud.com/atreemo-api/workflows/bi-extraction.md).

# BI extraction

Stateful and source-backed Atreemo BI extraction workflow

{% hint style="warning" %}
**Stateful workflow — not executed.** Fact reads may advance extraction state, while setup/reset calls change it. Obtain owner approval before any product call; GET does not prove safe replay.
{% endhint %}

## Agree the extract first

Identify the approved Atreemo instance, caller, fact table, start date, fields and destination. Agree retention, privacy controls, deduplication and interrupted-batch recovery. Do not mix an ad hoc test with another consumer's extraction state.

The public catalogue names facts for contacts, preferences, communications, loyalty, transactions, visits and other data. Use the existing operation/schema; do not expose source-only methods or invent export columns.

## 1. Initialise the starting point

`POST /api/BIDWHouse/Post` accepts `TableName` and `StartDate`.

```json
{
  "TableName": "TransactionsFact",
  "StartDate": "2024-01-01T00:00:00Z"
}
```

Both values are synthetic. The action stores state by authenticated `UserID`, table and date. Check lowercase `response` and `errors` before reading.

```json
{
  "response": true,
  "errors": []
}
```

Published prose says omission starts from the oldest record, but source marks `StartDate` required and the action checks it. Do not rely on omission (`BIDWHouseController.cs:30–33,45–123`; `Models/Api/BIDWHouse/BIDWHouse.cs:13–54`).

## 2. Read fact-specific batches

The following path shape would be appended to the Staging or Production resource base:

```http
GET /api/BIDWHouse/GetTransactionsFact?PageSize=5000&resetStartProcessDate=false
Authorization: Bearer <synthetic-access-token>
Accept: application/json
```

This is not a generic offset API. The controller forwards user, page size and reset flag. The documented default is 5,000 and public prose describes extension to 100,000, but the action does not establish every database-enforced maximum.

`GetTransactionsFact` uses uppercase `Response`, `Errors` and `TransactionsFacts`:

```json
{
  "Response": true,
  "Errors": [],
  "TransactionsFacts": []
}
```

An empty list is terminal only after checking HTTP and business success. Errors, missing payloads and timeouts are not completion (`BIDWHouseController.cs:126–220`).

## 3. Continue deliberately

Published guidance says to make successive fact calls until an empty list and not repeat setup for every batch. Procedure internals, transactional state advancement, replay and reset semantics were not inspected. A timeout after advancement is an unresolved recovery case, not permission to retry blindly.

Agree:

* extraction identity/state isolation and concurrent-consumer support;
* checkpoints and reconciliation after lost responses;
* supported reset/restart effects;
* stable keys, ordering and duplicate handling;
* batch sizes, privacy-safe evidence and objective latency/error thresholds.

Do not infer exactly-once processing, deletion propagation or safe reset from field names. Never enable `resetStartProcessDate` automatically after a failure.

## Freshness and schema limits

Published BI prose discusses daily updates and possible upstream delay; this is not a measured SLA. Confirm timing with the owner.

BI fact schemas differ from Selection exports. `Selection/GetSelectionResult_Ext` uses a one-based `OFFSET` and a format-dependent export table. Its `Result` rows remain open because column names/types depend on `FormatID` and database logic. Do not invent columns. See [Paging](broken://pages/1df82a06dedb9c9a6567fc85e2e486a4726dd2b7).

All citations refer to source commit `ea9cb106e13aa4b9b92c01d090118742b44dd470`. No extraction or upload occurred. The Release1.34-derived contract remains unvalidated against the current non-production Release1.35 environment. See [Testing and support](broken://pages/4ebb976c2c8353fb6080a8cf9f615312b52d4144).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hos.accessacloud.com/atreemo-api/workflows/bi-extraction.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
