Graph Models
WorkflowNode, NodeLabel, FileRef, Team, User, and TeamMembership — the graph and team data models.
from optixlog.management import (
WorkflowNode,
NodeLabel,
FileRef,
Team,
User,
TeamMembership,
)WorkflowNode
A workflow node in the project graph. Represents a discrete step or artifact in a workflow (e.g. a simulation run, a measurement, a layout file). Fields that require an include option to be populated are None by default.
Signature
@dataclass(frozen=True)
class WorkflowNode:
id: str
display_name: str
label_ref: EntityRef | None
properties: dict[str, str] | None
attachments: list[FileRef] | None
parent_refs: list[EntityRef] | None
child_refs: list[EntityRef] | None
created_by_ref: EntityRef | None
created_at: datetime
updated_at: datetime | NoneFields
Prop
Type
Example
node = Management(client).project("proj_grating_7f3a").workflow_nodes.get(
"node_abc123",
include=["label", "properties", "parents", "children"],
)
print(node.display_name)
print(node.properties)
for ref in (node.parent_refs or []):
print(f" parent: {ref.id}")NodeLabel
A workflow node type label registered in the project's schema (e.g. "SimulationNode", "MeasurementNode").
Signature
@dataclass(frozen=True)
class NodeLabel:
id: str
name: str
documentation_id: str | None
documentation: Documentation | None = NoneFields
Prop
Type
Example
for label in Management(client).project("proj_grating_7f3a").workflow_nodes.labels.iter():
print(label.id, label.name)Documentation
A named pointer to an uploaded file that documents a node label or workflow schema. The graph models this as NodeLabel -[:DOCUMENTED_BY]-> Documentation -[:STORED_AS]-> File, so a documentation reference always resolves to a real, file-backed entity.
Signature
@dataclass(frozen=True)
class Documentation:
id: str
title: str
file: DocumentationFile | None
created_at: datetime
updated_at: datetime
@dataclass(frozen=True)
class DocumentationFile:
id: str
name: str
mime: str
size: strFields
Prop
Type
FileRef
A reference to a file attachment on a workflow node.
Signature
@dataclass(frozen=True)
class FileRef:
id: str
name: str
uri: str
mime: str
size: str
role: str | None = None
slot: str | None = NoneFields
Prop
Type
Team
A team within a project, with a bound memberships collection.
Not a dataclass
Team is not a @dataclass. It uses a plain class with an explicit __init__ because it carries a client-bound TeamMembershipCollection alongside an optional member_count. Dataclass field ordering rules (required fields after optional fields) would prevent this combination. The fields are immutable by convention.
Signature
class Team:
id: str
name: str
icon: str | None
description: str | None
category: str | None
notes: str | None
created_at: datetime
updated_at: datetime
member_count: int | None
memberships: TeamMembershipCollection
def __init__(
self,
*,
id: str,
name: str,
icon: str | None,
description: str | None,
category: str | None,
notes: str | None,
created_at: datetime,
updated_at: datetime,
memberships: TeamMembershipCollection,
member_count: int | None = None,
) -> None: ...Fields
Prop
Type
Example
team = Management(client).project("proj_grating_7f3a").teams.get(
"team_xyz", include=["counts"]
)
print(team.name, team.member_count)
for ms in team.memberships.iter():
print(ms.user_ref.id, ms.role)User
A user account on the OptixLog platform.
Signature
@dataclass(frozen=True)
class User:
id: str
email: str
name: str
auth_user_id: str | None
email_verified: bool | None
last_sign_in_at: datetime | None
avatar_url: str | None
created_at: datetime
updated_at: datetimeFields
Prop
Type
TeamMembership
A single user's membership in a team, with an optional hydrated User and Team when requested via include.
Signature
@dataclass(frozen=True)
class TeamMembership:
user_ref: EntityRef
team_ref: EntityRef
role: str
joined_at: datetime
user: User | None = None
team: Team | None = NoneFields
Prop
Type
Example
ms = Management(client).project("proj_grating_7f3a").teams \
.get("team_xyz").memberships \
.get(user_id="user_abc", include=["user"])
print(ms.role)
if ms.user:
print(ms.user.email)