How to Add JavaScript Code in Oracle AI Agent Studio

 This article explains how to add javascript code in AI Agent workflow in Oracle AI Agent Studio.

1. Add a Code Node

Navigate to Agent Team and drag or add a Code node into your agent workflow.


2. Configure the Code Node
  • Enter the Name, Code Identifier, and Return Type. 
  • Add your JavaScript Source Code.
  • In this example, the code node extracts an array from the previous Agent node's JSON response and counts the number of orders.
  • The Output Schema is generated automatically based on your selected return type.


3. Use the Result in Downstream Logic
You can reference the output of the Code node in subsequent workflow steps. For instance, to continue processing only when orders exist, add an IF Condition node.


4. Define the Condition Rules
Provide a name and set the specific rule criteria (e.g., allow the flow to proceed only when orderCount == 1).




No comments:

Post a Comment