Skip to content
Tools/Workspace & Portfolios/create_product

create_product

Create a sibling .upg product in the current workspace. Mints a canonical product id, writes the file, stamps integrity, registers in `workspace.json`. Pairs with `init_workspace` and `switch_product`.

Workspace & Portfoliosnon-atomic. File write + workspace.json patch + optional portfolio edge are separate mutations.

Arguments

namestringrequired

Product display title (required, non-empty).

slugstringoptional

Optional slug for the .upg filename. Defaults to a slug derived from `name`. Collisions append `-2`, `-3`, …

descriptionstringoptional

Optional product description

stagestringoptional

Product lifecycle stage. See UPGProductStage in @unified-product-graph/core.

portfolio_idstringoptional

Optional portfolio node id in the current store. When provided, a `portfolio_contains_product` edge is created in the current graph.

Returns

Shape
{ message,...result }

result carries id, title, slug, file_path, and the optional portfolio edge.

Examples

Live call against the Notion example graph.

Input

{
  "name": "example"
}

Output

{
  "message": "Created product: example",
  "id": "p_P9zFGBICvycswgnv",
  "file": "example.upg",
  "slug": "example",
  "title": "example",
  "workspace_path": ".upg/",
  "portfolio_attached": false
}

See Also