# View Workflow Artifacts and Data Lineage

Use the AI Studio SDK to read overviews, nodes, and output chunks of existing artifacts, and create new rerun records for specific nodes when needed. This page does not deploy or launch workflows; refer to [Run and track workflows](运行并跟踪工作流.md) for those operations.

(sdk-ai-studio-workflow-lineage-flow)=
## Task workflow

First provide a verified artifact ID to read the artifact overview. The overview or other verified resource responses supply node IDs; then query that node's details or output chunks. Creating a node rerun does not overwrite the original run; it returns a new rerun record.

```text
Artifact ID
   │
   ▼
Read artifact overview and nodes
   │
   ▼
Node ID, node details, or output chunks
   │
   └── Create new node rerun record
```

(sdk-ai-studio-workflow-lineage-prepare)=
## Prerequisites

| Required item | How to obtain | Role on this page |
| --- | --- | --- |
| Authenticated client | Created during initial setup. | Access AI Studio resources. |
| Workspace ID | Obtained from workspace creation, listing, or operator selection. | Define resource scope. |
| Artifact ID | Obtained from verified resource outputs or operator selection. | Select the artifact to inspect. |
| Node ID | Obtained from artifact overviews, node lists, or other verified results. | Select the node to inspect or rerun. |

(sdk-ai-studio-workflow-lineage-read)=
## Read artifacts and nodes

The following example reads the artifact overview and details of a specified node. Node IDs must come from verified resource outputs; do not infer them from display names.

:::::{tab-set}
:sync-group: sdk-language

::::{tab-item} Python
:sync: python

```python
import os

import moi_product_sdk as sdk

client = sdk.new_with_personal_access_token(
    os.environ["PRODUCT_API_BASE_URL"],
    os.environ["PRODUCT_API_KEY"],
)
workspace = client.workspace("<workspace-id>")
artifact = workspace.artifact("<artifact-id>")
overview = artifact.overview()
node = artifact.node("<node-id>")
node_info = node.info()

print(overview)
print(node_info)
```

::::

::::{tab-item} Go
:sync: go

```go
package main

import (
	"context"
	"fmt"
	"os"

	sdk "github.com/matrixorigin/matrixflow/sdk/go-sdk"
)

func main() {
	ctx := context.Background()
	client, err := sdk.NewWithPersonalAccessToken(
		os.Getenv("PRODUCT_API_BASE_URL"),
		os.Getenv("PRODUCT_API_KEY"),
	)
	if err != nil {
		panic(err)
	}
	workspace, err := client.Workspace("<workspace-id>")
	if err != nil {
		panic(err)
	}
	artifact, err := workspace.Artifact("<artifact-id>")
	if err != nil {
		panic(err)
	}
	overview, err := artifact.Overview(ctx)
	if err != nil {
		panic(err)
	}
	node, err := artifact.Node("<node-id>")
	if err != nil {
		panic(err)
	}
	nodeInfo, err := node.Info(ctx)
	if err != nil {
		panic(err)
	}
	fmt.Println(overview)
	fmt.Println(nodeInfo)
}
```

::::

:::::

(sdk-ai-studio-workflow-lineage-rerun)=
## Create a node rerun

Use the node reference from the previous step to trigger a rerun. The returned record indicates that the rerun was created; check execution workflows for subsequent status and outputs.

:::::{tab-set}
:sync-group: sdk-language

::::{tab-item} Python
:sync: python

```python
rerun = node.rerun()
print(rerun)
```

::::

::::{tab-item} Go
:sync: go

```go
rerun, err := node.Rerun(ctx)
if err != nil {
	panic(err)
}
fmt.Println(rerun)
```

::::

:::::

(sdk-ai-studio-workflow-lineage-next)=
## Next steps

- [Run and track workflows](运行并跟踪工作流.md)
- [Publish and invoke WorkItem API services](WorkItem API 服务.md)
