Ciaran
05/18/2026, 9:46 AMAI Evy
05/18/2026, 9:46 AMAI Evy
05/18/2026, 9:47 AMattempt_count) to 0 at the agent level or pass it when creating the call. [(1) ]()
2. Use a Code Node to increment the counter
After each failed attempt, add a Code Node that increments your counter: [(2) ]()
javascript
// Increment the attempt counter
const currentCount = parseInt(dv.attempt_count || 0) ;
return { new_count: currentCount + 1 };
3. Store the incremented value
In the Code Node settings, use "Store Fields as Variables" to save the result back to your dynamic variable (e.g., map new_count from the JSON path to attempt_count) .
4. Add transition conditions
Create equation-based transition conditions to check if the counter has reached your limit: [(3) ]()
- {{attempt_count}} < 3 → retry the question
- {{attempt_count}} >= 3 → move to a fallback node
This approach lets you control retry logic precisely while keeping track of how many attempts have been made. [(1) ]() [(2) ]() [(3) ]()AI Evy
05/18/2026, 9:47 AMAI Evy
05/18/2026, 9:47 AMCiaran
05/18/2026, 11:34 AMCiaran
05/18/2026, 11:34 AMAI Evy
05/18/2026, 11:34 AMCiaran
05/18/2026, 11:34 AMAI Evy
05/18/2026, 11:35 AMattempt_count (e.g., set it to "0", "1", "2") . The output panel will show the result and any console.log() output.
2. Add console.log() statements
In your Code Node, add debugging output:
javascript
const currentCount = parseInt(dv.attempt_count || 0) ;
console.log("Current attempt_count:", dv.attempt_count) ;
console.log("Parsed count:", currentCount) ;
const newCount = currentCount + 1;
console.log("New count:", newCount) ;
return { new_count: newCount };AI Evy
05/18/2026, 11:35 AMnew_count to your dynamic variable attempt_count. [(1) ]() If the variable name doesn't match exactly, the counter won't update properly.
5. Verify transition conditions
Make sure your transition conditions are checking the correct variable name and using the right comparison operators (e.g., {{attempt_count}} < 3) . [(2) ]()
If new_count is showing as 2 when it should be incrementing from 0, check that your initial default value is actually being set to 0 and that you're storing the result back to the same variable name you're reading from. [(1) ]() [(3) ]()AI Evy
05/18/2026, 11:35 AMAI Evy
05/18/2026, 11:35 AMCiaran
05/18/2026, 11:37 AMAI Evy
05/18/2026, 11:37 AMAI Evy
05/18/2026, 11:38 AMAI Evy
05/18/2026, 11:38 AMAI Evy
05/18/2026, 11:38 AM