Knowledge Objects in actions
Actions can read and write Knowledge Object instances through theKnowledgeObject client, exposed by the action SDK. It calls the same governed instance operations as the REST API — validation, options, filters, and versioning all apply — and runs as the action’s user, on the action’s project.
Instances are addressed by their opaque
_key (returned by get, list, and create). Operations run on the main branch by default; pass branch= to target another branch.Constructing a client
name— the object’s name (e.g."Employee").branch— (optional) branch to read/write on. Defaults to the project’s main branch.
Methods
get
_key. Pass add_relationships=True to also resolve the object’s relationship fields (one level deep) under an _relationships key.
list
.items (a list of instance dicts) and .total_count. Pages are fetched lazily as you iterate.
filters— a list of{"column", "operator", "value"}objects, combined with AND. Operators:equal,not_equal,contains,not_contains,greater_than,less_than.fields— restrict the columns returned (the meta fields_keyand_versionare always included).
update
_key; returns the full updated instance. Primary key fields cannot be changed.
delete
_key.
batch_upsert
Full example
Next steps
- Actions — writing and deploying actions.
- Instance API — the REST equivalent of these operations.
- YAML Reference — defining objects and their fields.