https://discord.gg/botpress logo
Hey dear Botpress Pros I have an issue i'd LOVE s...
# 💻developers
d
Hey dear Botpress Pros I have an issue i'd LOVE some help with! How do i store the response from an autonomous node into a variable that I cna re-use for later? In my flow that i have attached I have tried to achieve this by the second to last node by having a code execution card:
Copy code
const generatedResponse = turn.lastNodeResult

// Ensure generatedResponse is not undefined or null before storing
if (generatedResponse) {
  // Store it in a workflow variable for later use
  workflow.response = generatedResponse
} else {
  // Handle the case where there is no generated response
  workflow.response = 'No response generated'
}

// Log the result for debugging (optional)
console.log('Generated Answer:', workflow.response)
but it's not working for some reaosn. Any help would be highly appreicated! https://cdn.discordapp.com/attachments/1121494527727902891/1328808657491853435/image.png?ex=67880d00&is=6786bb80&hm=3edc8512be513ebfe8865b6ee3fd2581b2fe92bef7d3404e8e3cf7a98088486b&
3 Views