Tenant
A tenant identifies the customer, workspace, deployment, or test environment that a runtime is executing for. Flow AI uses tenant identity to scope runtime-owned state such as...
A tenant identifies the customer, workspace, deployment, or test environment that a runtime is executing for. Flow AI uses tenant identity to scope runtime-owned state such as plans, references, approvals, events, and data access.
Use define_tenant(...) to create the
TenantIdentity passed into
define_runtime(...). Choose tenant ids from trusted application state such as
auth, workspace configuration, or deployment config. Do not use tenant identity
as hidden prompt context; put business instructions in prompts, tools, or
retrieved configuration instead.
For the full mental model, see the Tenants concept.
define_tenant
define_tenant(tenant: 'str | Mapping[str, Any] | TenantIdentity | None' = None, /, version: 'str | None' = None, *, resource_id: 'str | None' = None, **kwargs: 'Any') -> 'TenantIdentity'
| Parameter | Type | Default |
|---|---|---|
tenant | str | Mapping[str, Any] | TenantIdentity | None | None |
version | str | None | None |
resource_id | str | None | None |
kwargs | Any | required |
Returns: TenantIdentity
Create a validated Flow AI tenant identity.
Accepts define_tenant("acme", "v1"), a mapping, an existing
TenantIdentity, or keyword arguments.
Args:
tenant: Positional resource id string, mapping of tenant fields, or
an existing TenantIdentity to copy from.
version: Tenant configuration version label, e.g. "v1".
resource_id: Keyword override for the tenant resource id.
**kwargs: Additional fields merged into the validated payload.
Returns:
A frozen, validated TenantIdentity.
Raises:
pydantic.ValidationError: If resource_id or version is
missing or empty.
TenantIdentity
TenantIdentity(*, resourceId: Annotated[str, MinLen(min_length=1)], version: Annotated[str, MinLen(min_length=1)]) -> None
| Parameter | Type | Default |
|---|---|---|
resourceId | str | required |
version | str | required |
Returns: None
Runtime tenant identity aligned with agent_fw_core::TenantId.
| Parameter | Type | Default | Description |
|---|---|---|---|
resource_id | str | required | Stable tenant resource identifier; scopes runtime storage and data access. |
version | str | required | Tenant configuration version label, e.g. 'v1'. |
Prompts
Prompts are the system instructions attached to agents. They define the agent's role, communication style, operating rules, tool-use guidance, domain knowledge, safety...
Unions
Unions describe payloads that can take one of several typed shapes. In Flow AI they are most often used for plan action schemas, where each action has a discriminator such as...
