Skip to content

AI Agents ​

Cloud Flow Blocks reference.

Blocks ​

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.

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 ​

InputTypeDescriptionAccepts
Function NamestringThe function name that the AI agent can call. This is typically provided by a text block.text
When called dostatementsThe 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

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.

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 ​

InputTypeDescriptionAccepts
AI AgentstringThe AI agent identifier to run the prompt against. This is typically provided by a text block.text
PromptstringThe prompt text to send to the AI agent. This is typically provided by a text block.text
JSON SchemaobjectAn optional JSON schema object that constrains the AI output.
JSON Schema NamestringAn 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

AI Prompt Output Data ​

Block name: ai_run_prompt_data

Gets the structured output data from an AI prompt result object.

Inputs ​

InputTypeDescriptionAccepts
resultobjectThe 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.

AI Prompt Output Status ​

Block name: ai_run_prompt_status

Gets the success status from an AI prompt result object.

Inputs ​

InputTypeDescriptionAccepts
resultobjectThe 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.

AI Prompt Output Text ​

Block name: ai_run_prompt_text

Gets the text output from an AI prompt result object.

Inputs ​

InputTypeDescriptionAccepts
resultobjectThe 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.

Current User ​

Block name: aia_current_user

Gets the current user associated with the provided AI agent auth information.

Inputs ​

InputTypeDescriptionAccepts
AI Agent Auth InfoobjectThe 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

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 ​

InputTypeDescriptionAccepts
groupnumberThe user group to check. This is typically provided by a user_group_sel block.user_group_sel
rolenumberThe role level to check within the selected group. This is typically provided by a user_role_sel block.user_role_sel
AI Agent Auth InfoobjectThe 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