# View file processing lineage

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

View its associated workflow processes, build artifacts, and process topology from the Catalog file.

```text
GET https://moi.matrixorigin.cn/newmoi/lineage/catalog-files/{file_id}/overview
```

## Preparation before calling

First [query the file product](../../resource-center/catalog/list-file-artifacts.md), and then call this interface only when the `data.has_artifact` in the response is `true`. Prepare a personal access token with access to the target workspace, the target workspace ID, and the catalog file ID.

`file_id` must be a Catalog file that has been processed by the workflow and registered with the DataAsset. Raw files that are simply uploaded or mounted to a Volume but have not been processed will not automatically generate a processing link.

## Request parameters

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">
  <div class="mo-api-field"><dt><code>file_id</code><span class="mo-api-field__type">string</span><span class="mo-api-field__required">Required</span></dt><dd>Catalog file ID.</dd></div>
</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Request example</p>
```

```bash
curl "https://moi.matrixorigin.cn/newmoi/lineage/catalog-files/$FILE_ID/overview" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

:::
::::

## Successful response

`data` returns file entry, associated products, workflow calls and processing topology. Save the `artifact_id` and `node_id` within; the file name or node display name cannot replace these IDs.


The response fields are as follows.

In field paths, `[]` denotes each item in an array. For example, `items[].name` is the `name` field of each item in the `items` array.

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">
  <div class="mo-api-field"><dt><code>code</code><span class="mo-api-field__type">string</span></dt><dd>OK when successful.</dd></div>
  <div class="mo-api-field"><dt><code>msg</code><span class="mo-api-field__type">string</span></dt><dd>OK when successful.</dd></div>
  <div class="mo-api-field"><dt><code>data.artifact.artifact_id</code><span class="mo-api-field__type">string</span></dt><dd>Product ID.</dd></div>
  <div class="mo-api-field"><dt><code>data.artifact.root_asset_id</code><span class="mo-api-field__type">string</span></dt><dd>Root data asset ID.</dd></div>
  <div class="mo-api-field"><dt><code>data.artifact.case_id</code><span class="mo-api-field__type">string</span></dt><dd>Association case ID.</dd></div>
  <div class="mo-api-field"><dt><code>data.artifact.raw_file_id</code><span class="mo-api-field__type">string</span></dt><dd>Raw file ID; returned only if present.</dd></div>
  <div class="mo-api-field"><dt><code>data.artifact.parsed_file_id</code><span class="mo-api-field__type">string</span></dt><dd>Parsed file ID; returned only if present.</dd></div>
  <div class="mo-api-field"><dt><code>data.artifact.parsed_file_available</code><span class="mo-api-field__type">boolean</span></dt><dd>Whether the parsed file is available.</dd></div>
  <div class="mo-api-field"><dt><code>data.workflow.workflow_id</code><span class="mo-api-field__type">string</span></dt><dd>Workflow ID; only returned if there is a value.</dd></div>
  <div class="mo-api-field"><dt><code>data.workflow.workflow_version_id</code><span class="mo-api-field__type">string</span></dt><dd>Workflow version ID; returned only if there is a value.</dd></div>
  <div class="mo-api-field"><dt><code>data.workflow_invocation.input</code><span class="mo-api-field__type">object</span></dt><dd>Workflow call input; only returned if there is a value.</dd></div>
  <div class="mo-api-field"><dt><code>data.workflow_invocation.vars</code><span class="mo-api-field__type">object</span></dt><dd>Workflow call variables; only returned if there is a value.</dd></div>
  <div class="mo-api-field"><dt><code>data.topology.nodes[]</code><span class="mo-api-field__type">array</span></dt><dd>Processing nodes in the topology.</dd></div>
  <div class="mo-api-field"><dt><code>data.topology.edges[]</code><span class="mo-api-field__type">array</span></dt><dd>Processing edges in the topology.</dd></div>
  <div class="mo-api-field"><dt><code>data.topology.producer_node_id</code><span class="mo-api-field__type">string</span></dt><dd>The node ID that produced the current product; only returned if there is a value.</dd></div>
  <div class="mo-api-field"><dt><code>data.entry.catalog_file_id</code><span class="mo-api-field__type">string</span></dt><dd>Catalog file ID; returned only if there is a value.</dd></div>
</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Successful response example</p>
```

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "artifact": {
      "artifact_id": "art-001",
      "root_asset_id": "asset-001",
      "case_id": "case-001",
      "parsed_file_available": true
    },
    "workflow": {
      "workflow_id": "wf-001",
      "workflow_version_id": "ver-001"
    },
    "workflow_invocation": {
      "input": {},
      "vars": {}
    },
    "topology": {
      "nodes": [
        {
          "node_id": "node-001",
          "label": "解析文件"
        }
      ],
      "edges": [],
      "producer_node_id": "node-001"
    },
    "entry": {
      "catalog_file_id": "file-001"
    }
  }
}
```

:::
::::

## Error response

::::{div} mo-api-split
:::{div} mo-api-split-main

```{raw} html
<dl class="mo-api-fields">
  <div class="mo-api-field"><dt><code>code</code><span class="mo-api-field__type">string</span></dt><dd>Error code.</dd></div>
  <div class="mo-api-field"><dt><code>msg</code><span class="mo-api-field__type">string</span></dt><dd>Readable error message.</dd></div>
  <div class="mo-api-field"><dt><code>data</code><span class="mo-api-field__type">null</span></dt><dd>`null` in an error response.</dd></div>
</dl>
```

:::
:::{div} mo-api-split-aside

```{raw} html
<p class="mo-api-example-label">Error response example</p>
```

```json
{
  "code": "ErrNotFound",
  "msg": "资源不存在",
  "data": null
}
```

:::
::::

## Follow-up operations

[View processing result lineage](get-artifact-lineage.md).
