https://discord.gg/botpress logo
How to handle prompts stored in variables when usi...
# 🤝help
t
Hi - I am storing my prompts within bot variables because we are writing & maintaining our prompts in Langfuse for the benefits of versioning, tracing, etc. This means that we need to fetch those prompts and then store them in bot variables. The issue with this is that I can't then pass a variable as the "Task Instructions" to an AI Task card, and am instead forced to put them into the "AI Task Input" - which leads to inconsistent results. When having the prompt within the AI Task Input, I sometimes find that my AI Task card is returning nothing, causing issues. When I then copy paste the prompt into the Task Instructions, it seems to work fine. I've attached a screenshot of how I have tried to handle this using an AI Task card. My question is: Is there a good way to handle prompts that are stored in variables when using AI Task cards? I could use the AI Generate Text, as that allows variables, but the output that I want in this case is not text - it is JSON (which I have setup a schema for and therefore would like to benefit from the typing gained by using "Store result in variables"). https://cdn.discordapp.com/attachments/1404413357246644357/1404413358559592529/Screenshot_2025-08-11_at_11.36.48.png?ex=689b195d&is=6899c7dd&hm=2c2b70e97f7379cd7117ee2cff76a6ac858d3f577b37175b083cc350ed4781b0&
p
Could you share the logs associated to this?
t
Here are the logs - not sure how helpful they will be but you can see that I have a log card for the "section rationale" which is an AI task - and the output is blank. https://cdn.discordapp.com/attachments/1404413357246644357/1404462952761004134/Screenshot_2025-08-11_at_14.53.48.png?ex=689b478d&is=6899f60d&hm=925a3c091546236d306e9b3f0c9567f8b420bfddce54e6f9f2e46d55c1a71c91&
I think that one issue is that AI tasks should have the prompt within the Task instructions section, but because we are storing our prompts in variables, we have to pass the prompt in within the task input section which I think is wrong
p
Have you considered using an autonomous node instead and transitioning out of it when you're done with that task?
t
Hmm, haven't considered that. We could do that but I am concerned about the latency introduced (from what I've seen, autonomous nodes seem to be a lot slower than AI tasks). It also doesn't immediately seem intuitive, but I am happy to give it a go if you think that is the best way to handle this?
by the way, question about how best to get support since its my first time asking a question in this community: are you guys able to access my bot to be able to look around better?
p
I do think you should try that approach as well. And, yes but only if you provide a report id or workspace id/bot id. They can only be used by botpress employees.
t
so would you suggest replacing all our AI task cards with autonomous nodes, that have the prompt and other input variables, and then just transition out of it once it finishes its task?
Do you have an example of how you would set that up so that it transitions out of it once the task is finished?
if it helps i can provide the bot ID
8 Views