Discovery

Inspect agents, workflows, and entity schemas at runtime.

If you cannot run codegen yet, discover schemas at runtime and build forms from them. Prefer codegen once you have a stable deployment and API key.

List what the deployment offers

discovery.ts
const features = await lunnoa.discovery.enabledFeatures();const agents = await lunnoa.agents.list({ expansion: ['description'] });const workflows = await lunnoa.workflows.list({  expansion: ['description', 'isActive'],});const entityTypes = await lunnoa.entityTypes.list({  expansion: ['attributeSchema', 'stateSchema'],});

Call discovery.enabledFeatures() early so you can hide areas the deployment's edition or infrastructure does not support.

Use the schemas

  • attributeSchema.sections[].fields[] defines each entity field (id, label, type, required). Build forms and tables from this.
  • stateSchema.states[] / transitions[] is the entity state machine. Prefer entities.getStateTransitions(id) for transitions valid now.
  • Manual-trigger input fields live on workflows.get(id, { expansion: ['triggerNode'] })triggerNode.value.customInputConfig.

Field types commonly include text, number, currency, date, boolean, and dropdown (with config.options). Always request the expansions you need: responses are minimal by default.

Next

  • Entities: create and update records from those schemas
  • Workflows: read trigger input config and run workflows
  • Codegen: replace runtime discovery with typed accessors