Appearance
AI Agents
Cloud Flow Blocks reference.
Blocks
- AI Agent Auth Info
- AI Agent Function Implementation
- AI Agent Function Params Object
- AI Prompt Output
- AI Prompt Output Data
- AI Prompt Output Status
- AI Prompt Output Text
- Current User
- Current User is in group and role
AI Agent Auth Info
Block name: aia_auth_info
Gets the auth information object passed to the current AI agent function implementation.
Output
This block produces an output value of type Any.
Behavior
Generates server-side code that reads the current AI agent auth information from the generated callback context when one is available.
Related Blocks
AI Agent Function Implementation
Block name: aia_register_function
Registers a server-side function that an AI agent can call by name. The nested implementation statements run when the function is invoked by the agent.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| Function Name | string | The function name that the AI agent can call. This is typically provided by a text block. | text |
| When called do | statements | The statements to run when the AI agent calls this function. Inside this area, aia_function_params provides the input parameters object and aia_auth_info provides the agent auth information. The function should return a result, typically using function_return_value with a result_object. Nested blocks run inside the generated callback for this block. customcode and customcodeexpr blocks inside this area can directly access the documented callback-scope variables. |
Output
This block does not produce an output value.
Behavior
Generates server-side code that registers an async agent function through $io.system.registerAgentFunction. The nested implementation blocks are emitted inside async function(tvwaAiaFuncParams, tvwaAiaAuthInfo) { ... }, so customcode and customcodeexpr blocks inside the implementation can access tvwaAiaFuncParams and tvwaAiaAuthInfo directly. If no explicit value is returned it falls back to an error result object.
Calls: $io.system.registerAgentFunction
Related Blocks
aia_function_paramsaia_auth_infoaia_current_useraia_query_user_groupfunction_return_valueresult_object
AI Agent Function Params Object
Block name: aia_function_params
Gets the parameter object passed to the current AI agent function implementation.
Output
This block produces an output value of type Any.
Behavior
Generates server-side code that reads the current AI agent function parameters from the generated callback context when one is available.
Related Blocks
AI Prompt Output
Block name: aia_run_prompt
Runs a prompt against the selected AI agent and returns a deferred result. This block is typically used with promise blocks such as promisethen or promiseawaitret to wait for the agent response.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| AI Agent | string | The AI agent identifier to run the prompt against. This is typically provided by a text block. | text |
| Prompt | string | The prompt text to send to the AI agent. This is typically provided by a text block. | text |
| JSON Schema | object | An optional JSON schema object that constrains the AI output. | |
| JSON Schema Name | string | An optional name for the JSON schema. This is typically provided by a text block. | text |
Output
This block produces an output value of type Promise.
Behavior
Generates server-side code that runs a prompt against the selected AI agent through the ioLoop system runtime. The generated result object is used by the AI prompt helper blocks to read status, outputData, and outputText.
Calls: $io.system.runAgentPrompt
Related Blocks
AI Prompt Output Data
Block name: ai_run_prompt_data
Gets the structured output data from an AI prompt result object.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| result | object | The AI prompt result object to inspect. This is typically the resolved output of an aia_run_prompt block. |
Output
This block produces an output value of type Any.
Behavior
Generates server-side code that reads the outputData field from an AI prompt result object, falling back to an empty object when no result is available.
Related Blocks
AI Prompt Output Status
Block name: ai_run_prompt_status
Gets the success status from an AI prompt result object.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| result | object | The AI prompt result object to inspect. This is typically the resolved output of an aia_run_prompt block. |
Output
This block produces an output value of type Boolean.
Behavior
Generates server-side code that reads the status field from an AI prompt result object and treats it as successful only when it is exactly true.
Related Blocks
AI Prompt Output Text
Block name: ai_run_prompt_text
Gets the text output from an AI prompt result object.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| result | object | The AI prompt result object to inspect. This is typically the resolved output of an aia_run_prompt block. |
Output
This block produces an output value of type String.
Behavior
Generates server-side code that reads the outputText field from an AI prompt result object, falling back to an empty string when no result is available.
Related Blocks
Current User
Block name: aia_current_user
Gets the current user associated with the provided AI agent auth information.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| AI Agent Auth Info | object | The AI agent auth information to use for the lookup. This is typically provided by an aia_auth_info block. | aia_auth_info |
Output
This block produces an output value of type String.
Behavior
Generates server-side code that resolves the current user from the provided AI agent auth information through the ioLoop system runtime.
Calls: $io.system.getAgentUser
Related Blocks
Current User is in group and role
Block name: aia_query_user_group
Checks whether the current user associated with the provided AI agent auth information belongs to the selected group at the selected role level.
Inputs
| Input | Type | Description | Accepts |
|---|---|---|---|
| group | number | The user group to check. This is typically provided by a user_group_sel block. | user_group_sel |
| role | number | The role level to check within the selected group. This is typically provided by a user_role_sel block. | user_role_sel |
| AI Agent Auth Info | object | The AI agent auth information to use for the membership lookup. This is typically provided by an aia_auth_info block. | aia_auth_info |
Output
This block produces an output value of type Boolean.
Behavior
Generates server-side code that queries user group membership through the ioLoop system runtime using the provided AI agent auth information.
Calls: $io.system.queryAgentUserGroupMembership

