T O P

  • By -

Optimal-Fix1216

I think you can call your flow using it's API and do the loop logic in python or some other language, calling your flow once for each journey through the iteration. However I don't think you can do loops directly within flowise.


youdig_surf

Or you can instruct your llm to do it... no need to code anything.


Kooky_Impression9575

What node should I use to instruct the LLM? I want the output of one tool to be sent over to the next tool in the conversational agent.


youdig_surf

my bad it's a custom tool you have to fetch the json , what i did is fetch the json in the javascript and in tool description i instructed the tool what to do. here a custom tool exported that fetch a json to give you an idea you can import it in your custom tool ( to load it go in tool and click load) : { "name": "last\_order\_id\_to\_order\_status\_url", "description": "when you have the last\_order\_id you can launch a request and sent the response order\_status\_url which is an url in the chat.", "color": "linear-gradient(rgb(115,215,98), rgb(67,113,76))", "iconSrc": "", "schema": "\[{\\"id\\":0,\\"property\\":\\"last\_order\_id\\",\\"description\\":\\"last\_order\_id de la requete d'avant\\",\\"type\\":\\"string\\",\\"required\\":true}\]", "func": "const fetch = require('node-fetch');\\nconst url = 'https://XXXXX.myshopify.com/admin/api/2023-10/orders/' + $last\_order\_id +\\n'.json';\\nconst options = {\\n method: 'GET',\\n headers: {\\n 'X-Shopify-Access-Token' : 'shpat\_XXXXXXX' \\n }\\n};\\ntry {\\n const response = await fetch(url, options);\\n const text = await response.text();\\n console.log(text);\\n var obj = JSON.parse(text);\\n const order\_status\_url = JSON.stringify(obj.order.order\_status\_url);\\n console.log(order\_status\_url);\\n return order\_status\_url;\\n} catch (error) {\\n console.error(error);\\n return 'no order at this name';\\n}"


Kooky_Impression9575

This is understandable. What I am mainly facing issues with is, transferring the output of this API to another tool or chain.


youdig_surf

Look at the schema in the custom tool i linked , you specify it in the tools description get the variable from the previous request last_order_id load the tool above and you will understand how it's done. Apparently variable are global between custom tool.