Variables
Variables are core components of nodes and serve as the fundamental units for data transfer between nodes in a workflow. The essence of a node is to receive variables, execute operations, and output variables.
Variable Types
GPTBots Workflow supports mainstream variable types, including:
String
Integer
Number
Boolean
Object
Array<String>
Array<Integer>
Array<Number>
Array<Boolean>
Array<Object>
File - Doc
File - Excel
File - Ppt
File - Image
File - Code
File - Audio
File - Video
Array<File> - Array<Doc>
Array<File> - Array<Excel>
Array<File> - Array<Ppt>
Array<File> - Array<Image>
Array<File> - Array<Code>
Array<File> - Array<Audio>
Array<File> - Array<Video>
Note: When a File-type variable is input, it will be converted into a URL to participate in workflow processing. Supported formats include:
Doc: doc, docx, pdf, txt, md, html
Excel: xls, xlsx, csv
Ppt: ppt, pptx
Image: jpg, jpeg, png, gif, webp, svg
Code: py, java, c, cpp, js, css
Audio: mp3, wav, aac, flac, ogg, wma, alac, mid, midi, ac3, dsd
Video: mp4, avi, mov, wmv, flv, mkv
Variable Definition and Assignment
Each node can define input or output variables based on its requirements.
For input variables, values can be assigned to enable referencing in node configurations. Avaiable value sources include:
Custom values: Manually entered specific values within the current node.
Outputs from upstream nodes: Values from upstream nodes passed to the current node as parameters, which can be assigned to the current node's variables.
Global variables: Predefined variables in the GPTBots system, accessible across all workflows and nodes (e.g., conversation ID, browser properties, third-party platform attributtes such as WhatsApp or Telegram). These cannot be modified.
Environment variables: Developers can define custome environment variables within a workflow (scoped exlusively to this workflow). These environment variables are accessible in any node of the current workflow.
Variable Usage
Node Input (Variable Definition): In the node's input section, variables can be defined and assigned values.
Node Configuration: Variables can be referenced in configuration items through selection and "{{" syntax.
Node Output: For some components, output variables and their types can be defined in the node's output section. Outputs vary depending on the component.