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

# Prevision as a data source

> Bring data from Prevision to Nekt.

Prevision is a platform for integrated project management in civil construction, focusing on optimizing deadlines and costs. It facilitates collaboration between all stages of a project, from planning to execution, providing tools for detailed monitoring and analysis.

<img height="50" src="https://mintlify.s3.us-west-1.amazonaws.com/nekt/assets/logo/logo-prevision.png" />

## Configuring Prevision as a Source

In the [Sources](https://app.nekt.ai/sources) tab, click on the "Add source" button located on the top right of your screen. Then, select the Prevision option from the list of connectors.

Click **Next** and you'll be prompted to add your access.

### 1. Add account access

You'll need your Prevision API Token for this connection. Once you have it, add the account access, then click **Next**.

The following configurations are available:

* **API token**: The API token used to authenticate against the API service. Check how to get it [here](https://documenter.getpostman.com/view/5656281/2s9YCBsoav#autenticacao:~:text=ao%20GraphQL.-,Autentica%C3%A7%C3%A3o,-Sua%20empresa%20possui). This field is required.
* **Start date**: Records created or updated after the start date will be extracted from the source. Format: `YYYY-MM-DD`. This field is required.

Once you're done, click **Next**.

### 2. Select streams

Choose which data streams you want to sync - you can select all streams or pick specific ones that matter most to you.

> Tip: The stream can be found more easily by typing its name.

Select the streams and click **Next**.

### 3. Configure data streams

Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, a name for each table (which will effectively contain the fetched data) and the type of sync.

* **Layer**: choose between the existing layers on your catalog. This is where you will find your new extracted tables as the extraction runs successfully.
* **Folder**: a folder can be created inside the selected layer to group all tables being created from this new data source.
* **Table name**: we suggest a name, but feel free to customize it. You have the option to add a **prefix** to all tables at once and make this process faster!
* **Sync Type**: you can choose between INCREMENTAL and FULL\_TABLE.
  * Incremental: every time the extraction happens, we'll get only the new data - which is good if, for example, you want to keep every record ever fetched.
  * Full table: every time the extraction happens, we'll get the current state of the data - which is good if, for example, you don't want to have deleted data in your catalog.

Once you are done configuring, click **Next**.

### 4. Configure data source

Describe your data source for easy identification within your organization, not exceeding 140 characters.

To define your [Trigger](https://docs.nekt.com/runs/scheduling-and-triggers), consider how often you want data to be extracted from this source. This decision usually depends on how frequently you need the new table data updated (every day, once a week, or only at specific times).

Optionally, you can define some additional settings:

* Configure **Delta Log Retention** and determine for how long we should store old states of this table as it gets updated. Read more about this resource [here](https://docs.nekt.com/get-started/core-concepts/resource-control).
* Determine when to execute an **Additional [Full Sync](https://docs.nekt.com/get-started/core-concepts/types-of-sync#additional-full-sync)**. This will complement the incremental data extractions, ensuring that your data is completely synchronized with your source every once in a while.

Once you are ready, click **Next** to finalize the setup.

### 5. Check your new source

You can view your new source on the [Sources](https://app.nekt.ai/sources) page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.

<Warning>For you to be able to see it on your [Catalog](https://app.nekt.ai/catalog), you need at least one successful source run.</Warning>

# Streams and Fields

Below you'll find all available data streams from Prevision and their corresponding fields:

<AccordionGroup>
  <Accordion title="Projects">
    Stream for fetching project information.

    | Field   | Type   | Description                            |
    | :------ | :----- | :------------------------------------- |
    | `id`    | String | The unique identifier for the project. |
    | `name`  | String | The name of the project.               |
    | `area`  | String | The area of the project.               |
    | `phase` | String | The phase of the project.              |
  </Accordion>

  <Accordion title="Activities">
    Stream for fetching activity information for a specific project.

    | Field                         | Type             | Description                                                                                                                                                                     |
    | :---------------------------- | :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    | `id`                          | String           | The unique identifier for the activity.                                                                                                                                         |
    | `part`                        | String           | The part of the activity.                                                                                                                                                       |
    | `wbsCode`                     | String           | The WBS code of the activity.                                                                                                                                                   |
    | `percentageCompleted`         | Number           | The percentage completed of the activity.                                                                                                                                       |
    | `expectedPercentageCompleted` | Number           | The expected percentage completed of the activity.                                                                                                                              |
    | `startAt`                     | DateTime         | The start date of the activity.                                                                                                                                                 |
    | `endAt`                       | DateTime         | The end date of the activity.                                                                                                                                                   |
    | `duration`                    | Number           | The duration of the activity in days.                                                                                                                                           |
    | `service`                     | Object           | The service associated with the activity, containing a `name` (String).                                                                                                         |
    | `floor`                       | Object           | The floor associated with the activity, containing a `name` (String).                                                                                                           |
    | `jobs`                        | Array of Objects | A list of jobs associated with the activity, each containing `id`, `name`, `wbsCode`, `percentageCompleted`, `expectedPercentageCompleted`, `startAt`, `endAt`, and `duration`. |
  </Accordion>

  <Accordion title="Budget Reports Page">
    Stream for fetching budget reports for a specific project.

    | Field  | Type   | Description                                  |
    | :----- | :----- | :------------------------------------------- |
    | `id`   | String | The unique identifier for the budget report. |
    | `name` | String | The name of the budget report.               |
  </Accordion>

  <Accordion title="Last Measurement Data">
    Stream for fetching the last measurement data for a specific project.

    | Field                         | Type   | Description                                                                                                                                     |
    | :---------------------------- | :----- | :---------------------------------------------------------------------------------------------------------------------------------------------- |
    | `workType`                    | String | The type of work (e.g., `ActivityDeadlineMeasurement`).                                                                                         |
    | `percentageCompleted`         | Number | The percentage completed for this work.                                                                                                         |
    | `basePercentageCompleted`     | Number | The base percentage completed for this work.                                                                                                    |
    | `expectedPercentageCompleted` | Number | The expected percentage completed for this work.                                                                                                |
    | `work`                        | Object | Contains detailed information about the work item.                                                                                              |
    | `work.id`                     | String | The unique identifier for the work item.                                                                                                        |
    | `work.workDuration`           | Number | The duration of the work.                                                                                                                       |
    | `work.duration`               | Number | The duration.                                                                                                                                   |
    | `work.measurementUnit`        | Object | The measurement unit, containing `type` and `symbol`.                                                                                           |
    | `work.service`                | Object | The service associated with the work, containing `id` and `name`.                                                                               |
    | `work.jobMeasuresPage`        | Object | A paginated list of job measures.                                                                                                               |
    | `work.jobMeasuresPage.nodes`  | Array  | A list of job measure nodes, each containing `measuredIn`, `basePercentageCompleted`, `percentageCompleted`, and `expectedPercentageCompleted`. |
  </Accordion>

  <Accordion title="Last Measurement Task Data">
    Stream for fetching the last measurement task data for a specific project.

    | Field                         | Type   | Description                                                       |
    | :---------------------------- | :----- | :---------------------------------------------------------------- |
    | `workType`                    | String | The type of work (e.g., `ActivityDeadlineMeasurement`).           |
    | `percentageCompleted`         | Number | The percentage completed for this work.                           |
    | `basePercentageCompleted`     | Number | The base percentage completed for this work.                      |
    | `expectedPercentageCompleted` | Number | The expected percentage completed for this work.                  |
    | `work`                        | Object | Contains detailed information about the work item.                |
    | `work.id`                     | String | The unique identifier for the work item.                          |
    | `work.name`                   | String | The name of the work.                                             |
    | `work.part`                   | String | The part of the work.                                             |
    | `work.service`                | Object | The service associated with the work, containing `id` and `name`. |
    | `work.floor`                  | Object | The floor associated with the work, containing `id` and `name`.   |
  </Accordion>

  <Accordion title="Physical Schedule Table Query">
    Stream for fetching the physical schedule table for a specific project.

    | Field               | Type    | Description                                  |
    | :------------------ | :------ | :------------------------------------------- |
    | `code`              | String  | Activity code.                               |
    | `description`       | String  | Activity description.                        |
    | `level`             | Integer | Activity level in hierarchy.                 |
    | `duration`          | Integer | Activity duration in days.                   |
    | `start_at`          | String  | Activity start date.                         |
    | `end_at`            | String  | Activity end date.                           |
    | `baseline_start_at` | String  | Baseline start date.                         |
    | `baseline_end_at`   | String  | Baseline end date.                           |
    | `base_points`       | String  | Base points for each date (JSON string).     |
    | `expected_points`   | String  | Expected points for each date (JSON string). |
    | `realized_points`   | String  | Realized points for each date (JSON string). |
  </Accordion>

  <Accordion title="Schedule Activities">
    Stream for fetching schedule activities for a specific project.

    | Field                         | Type             | Description                                                                                                                             |
    | :---------------------------- | :--------------- | :-------------------------------------------------------------------------------------------------------------------------------------- |
    | `id`                          | String           | The unique identifier for the activity.                                                                                                 |
    | `endAt`                       | DateTime         | The end date of the activity.                                                                                                           |
    | `deletedAt`                   | DateTime         | The deletion date of the activity.                                                                                                      |
    | `startAt`                     | DateTime         | The start date of the activity.                                                                                                         |
    | `wbsCode`                     | String           | The WBS code of the activity.                                                                                                           |
    | `workDuration`                | Number           | The work duration of the activity.                                                                                                      |
    | `part`                        | String           | The part of the activity.                                                                                                               |
    | `service`                     | Object           | The service associated with the activity, containing `id`, `name`, `position`, `startAt`, `endAt`, and `createdAt`.                     |
    | `floor`                       | Object           | The floor associated with the activity, containing `id`, `name`, and `replicationGroup`.                                                |
    | `jobs`                        | Array of Objects | A list of jobs associated with the activity, each with its own detailed properties.                                                     |
    | `workPackageResponsiblesPage` | Object           | A paginated list of responsible contractors for the activity.                                                                           |
    | `measurementUnit`             | Object           | The measurement unit for the activity, containing detailed properties like `id`, `name`, `type`, `symbol`, `quantity`, and `checklist`. |
  </Accordion>
</AccordionGroup>

## Skills for agents

<Snippet file="agent-skills-intro.mdx" />

<Card title="Download Prevision skills file" icon="wand-magic-sparkles" href="/sources/prevision.md">
  Prevision connector documentation as plain markdown, for use in AI agent contexts.
</Card>
