Workspace Nodes

Applies to: ChengOS v0.2.0+ | Last verified: 2026-09-25 | Source: crates/cheng-nodes/src/nodes/builtin/workspace

Two nodes that answer "where am I working". workspace/context resolves the current workspace and hands its identity to downstream nodes, which is what workspace-scoped tools bind against. workspace/knowledge_base selects, lists, or creates a knowledge base inside that workspace and emits the id the RAG nodes expect. Wire these first when a graph mixes workspace tools with retrieval; everything downstream depends on the ids they produce.

Workspace Context — workspace/context

Reads the current runtime workspace ID injected by the executor. Use this when a downstream node needs to consume the active workspace explicitly.

Inputs

FieldTypeRequiredDefaultDescription
workspaceIdstring——Runtime workspace identifier (auto-injected)

Outputs

FieldTypeDescription
hasWorkspacebooleanTrue iff a workspace was actually present in the runtime context.
workspaceIdstringThe resolved workspace ID, or empty string when the executor did not inject one (e.g. the workflow was triggered outside of any workspace).

Knowledge Base — workspace/knowledge_base

Select, list, or create knowledge bases in a workspace

Inputs

FieldTypeRequiredDefaultDescription
modeenum—selectselect: Select existing KB; list: List all KBs in workspace; create: Create new KB. Control: select. Options: select, list, create
kb_idstring—nullKnowledge base to select (select mode). Control: dynamic-select
namestring—nullNew knowledge base name (create mode)
descriptionstring—nullKnowledge base description (create mode, optional)
embedding_modelstring—nullEmbedding model name (create mode, optional)

Outputs

FieldTypeDescription
successbooleanWhether the operation succeeded.
workspace_idstringWorkspace ID (for direct connection)
kb_idstringKnowledge base ID (for direct connection)
knowledge_baseobjectSingle knowledge base info (select/create modes).
knowledge_basesarrayList of knowledge bases (list mode).
errorstringError message if the operation failed.

Next steps