Vyyy
05/14/2026, 6:58 PMAI Evy
05/14/2026, 6:58 PMVyyy
05/14/2026, 6:59 PMAI Evy
05/14/2026, 6:59 PMAI Evy
05/14/2026, 6:59 PMdv — Dynamic variables as properties (all values are strings)
- metadata — Call metadata passed when the call was created via API
- fetch(url) — Make HTTP requests to external APIs
- console.log() — Debugging output visible in test panel and call logs
Standard JavaScript built-ins are available: Math, JSON, Date, Array, Object, String methods, etc . External packages (require, import) are not available . Code is limited to 5,000 characters .
## Practical Examples
Extract first name from full name:
javascript
const fullName = dv.customer_name; // "John Doe"
const firstName = fullName.split(" ") [0];
return { first_name: firstName };
Calculate quote based on inputs:
javascript
const weight = parseFloat(dv.order_weight) ;
const zone = dv.shipping_zone;
let cost;
if (zone === "local") {
cost = weight * 0.5;
} else if (zone === "domestic") {
cost = weight * 1.2;
} else {
cost = weight * 3.0;
}
return { shipping_cost: "$" + cost.toFixed(2) , zone: zone };
Conditional logic with API call:AI Evy
05/14/2026, 6:59 PMAI Evy
05/14/2026, 6:59 PMAI Evy
05/14/2026, 6:59 PMjavascript
const response = await fetch("<https://api.example.com/customers/%22> + dv.customer_id) ;
const customer = await response.json() ;
if (customer.tier === "premium") {
return { action: "priority_support", wait_time: "0 minutes" };
} else if (customer.tier === "standard") {
return { action: "standard_queue", wait_time: "5 minutes" };
} else {
return { action: "general_queue", wait_time: "10 minutes" };
}
## Response Variables
You can extract values from your code's return value and save them as dynamic variables using Store Fields as Variables . Specify a variable name and JSON path to the value . For example, if your code returns { "status": "shipped", "estimated_delivery": "March 25" }, you can extract order_status from path status to get "shipped" .
## Node Settings
- **Speak During Execution**: Agent says something while code runs (Prompt or Static Text)
- **Wait for Result**: Agent waits for code to finish before transitioning
- **Timeout**: How long code can run before timing out (5–60 seconds, default 30)
- **Block Interruptions**: Prevents user interruptions when speaking
## Security Guidance
Code Node is best for lightweight, low-risk logic . Don't use it to access internal systems, write to production databases, or handle sensitive credentials . Both dv and metadata values are stored in plaintext with every call record . For integrations requiring authentication, secrets management, or write access, use a Custom Function hosted on your own backend .AI Evy
05/14/2026, 6:59 PMfetch function for HTTP requests.
For example, here's how you might look up an order and return its status:
javascript
// Example: look up an order and return the status
const response = await fetch("<https://api.example.com/orders/%22> + dv.order_id) ;
const data = await response.json() ;
return { status: data.status, estimated_delivery: data.delivery_date };
You can also use Store Fields as Variables to extract values from your code's return value and save them as dynamic variables. For instance, if your code returns { "status": "shipped", "estimated_delivery": "March 25" }, you can specify variable names and JSON paths to extract specific values.
Code Node is designed for lightweight logic like formatting, calculations, and simple read-only lookups. For complex integrations requiring authentication, secrets management, or write access, use a Custom Function hosted on your own backend instead.AI Evy
05/14/2026, 6:59 PMAI Evy
05/14/2026, 6:59 PM