Return string from async function in script logic node
Hi @Baptiste in a script node I have console.log('postAgentMessageToUser content:', content); and i can see the string that exists within 'content' in the console.
I want to display this string back to the user as a typebot message but not sure how to do so. I've tried to set variables within the script node and using a set variable node but haven't gotten anything to work. Any help appreciated
8 Replies
setVariable
is the way 🙂
if you think there is a bug:
Describe it like this:
1. Steps to reproduce
2. What's happening
3. What were you expectingThanks for your answer @Baptiste
I have tried this at the bottom of my script node:
console.log('CONTENT', agent_response);
return agent_response;
setVariable("Assistant Messages", agent_response);
In console i can see there is a string in the agent_response
.
But when i try and display
{{Assistant Messages}}
in the following text bubble node it is empty.
I can see in the docs thatthe setVariable will only work when executed on the server but i can't see any settings available for this directly on the script node?its there on script as well

keep this off to execute on server
@William @Baptiste i don't see that option on my script node - https://privatesnap.s3.amazonaws.com/home/RTMHHZkx6bUn34Uqb6G9/Monosnap_MadlyGlobal_Direct__Editor__Typebot_2024-08-21_16-19-21.png
Version: 2.18.4
maybe you need to upgrade then
Oh right, please upgrade