Inspect Workflow Node Definitions¶
List workflow nodes available in a workspace, obtain a target node ID and its preferred version, and read the node’s input and output configuration definition.
Task flow¶
Query the workspace node catalog to list node IDs, display names, and preferred versions.
Select the node ID matching the processing step you plan to author.
Query the detailed definition for that node ID to verify its input parameters, output fields, and version metadata.
Prerequisites¶
Complete the endpoint, personal access token, and workspace setup in Use the SDK.
List nodes and read a definition¶
The example below prints the node ID, display name, and preferred version for each entry in the catalog, then reads the full definition of the first node. When authoring a workflow, replace the first item with the node ID required for your task.
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(os.environ["WORKSPACE_ID"])
catalog = workspace.workflows().workitem_catalog()
for node in catalog.items:
print(node.node_id, node.display_name, node.preferred_version)
if not catalog.items:
raise SystemExit("No workflow nodes available")
node_id = catalog.items[0].node_id
detail = workspace.workflows().workitem_catalog_item(node_id)
print("Node definition:", detail.item)
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(os.Getenv("WORKSPACE_ID"))
if err != nil {
panic(err)
}
catalog, err := workspace.Workflows().WorkitemCatalog(ctx)
if err != nil {
panic(err)
}
for _, node := range catalog.GetItems() {
fmt.Println(node.GetNodeId(), node.GetDisplayName(), node.GetPreferredVersion())
}
if len(catalog.GetItems()) == 0 {
fmt.Println("No workflow nodes available")
return
}
detail, err := workspace.Workflows().WorkitemCatalogItem(ctx, catalog.GetItems()[0].GetNodeId())
if err != nil {
panic(err)
}
fmt.Println("Node definition:", detail.GetItem())
}