Spanish Total.js
English
Documentation For AI agents
Contents

Variables

Keep values such as texts, addresses or keys outside your nodes and use them in settings and code.

.md GitHub
On this page

Variables are named values that belong to your flow. Use them for values you want to change in one place.

Add a variable

  1. Select Variables in the toolbar.
  2. Type a key in Type a key, for example GREETING.
  3. Type a value in Type a value and press enter and press Enter.
  4. Select SUBMIT, then close the window with Cancel or the cross.

The Variables window with the GREETING variable

A variable that you do not confirm with Enter is not saved. Variables start working at once and are saved in the flow file.

Use a variable in a Code node

Write the key in braces and pass it to instance.replace():

send({ message: instance.replace('{GREETING}') });

With GREETING set to Hello from LessCode, an endpoint built with this code answers:

{"message":"Hello from LessCode"}

A Route, Code and Response flow that returns the variable

Made in Europe