k3rnlp4n1c
k3rnlp4n1c10mo ago

I am trying to implement a loop as

I am trying to implement a loop as follows: While retrieveRun != "completed" retrieveRun = curl https://api.openai.com/v1/threads/$newThread/runs/$runId \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "OpenAI-Beta: assistants=v1" If I tell the AI to create a node with this logic (and add a return node afterwards to return the value), the logic loops indefinitely. Alternatively, I can create a loop node SEPERATELY (i.e. buildship's loop node) and within the loop node I can have the AI implement the retrieveRun curl logic BUT how do I set the CONDITION for the loop node to be retrieveRun != "completed" since we CANNOT reference future nodes in the variables menu.
No description
1 Reply
Gaurav Chadha
Gaurav Chadha10mo ago
Referencing the future nodes values in the previous menu is not the correct flow, due to which it is not supported. If you want to reference a variable across the workflow then you can set it as global variable manually via JS, you can refer to this related message - https://discord.com/channels/853498675484819476/853498675991937056/1187342216151191662.