Skip to main content

Variable Implementation: Working with v2.0

Master the enhanced variable interface in v2.0, including input configurations, UI control mapping, and visual debugging for highly adaptable workflows.

Sophie avatar
Written by Sophie
Updated yesterday

Version Compatibility: This guide is specifically for Octoparse AI 2.x and above. The 2.x variable system features a redesigned interface and logic. If you are using v1.x, please refer to our [Legacy Guide] to avoid confusion. We recommend upgrading to the latest version for a more intuitive design experience.

In Octoparse AI 2.x, variables are more than just storage; they are the "working memory" and "interface" of your automation. The new system categorizes variables based on their purpose rather than their source, making it easier to build modular and reusable workflows.

Variables are now divided into two primary categories:

  • Flow Variables: Internal containers used to store and process data as the workflow executes.

  • Input Variables: External interfaces that allow users to provide specific parameters before the run starts.

Creating and Managing Variables

All variable operations take place in the Variables Panel on the right side of the canvas.

How to create a variable:

  1. Navigate to Variable tab in the right panel, click the [ + ] button next to "Global Variable."

  2. Name: Use a clear, descriptive name (2–32 characters, starting with a letter).

  3. Data Type: Select the container (String, Number, List, Dictionary, or Data Table) that matches your data.

  4. Default Value: Set a starting value. The system provides defaults based on the type (e.g., 0 for numbers).

  5. Variable Type: Choose between Flow Variable (internal use) or Input Variable (external input).

Input Variables: Transforming Flows into Apps

Input Variables are the cornerstone of 2.x, turning static scripts into configurable "Applications." By exposing fixed values—like login credentials, search terms, or file paths—as input variables, you make your workflow adaptable without changing the internal logic.

Advanced Configuration: UI Controls

When a variable is set as an "Input Variable," you can click the Settings icon to customize the user-facing form:

  • Widget Mapping: Choose the best UI control for the data type:

    • String: Single/Multi-line text, Radio buttons, File/Folder selectors, Password fields, or Date-Time pickers.

    • Boolean: Checkbox or Switch (best for enabling/disabling features).

    • List: Multi-select box.

  • Display Logic: Create dependencies between inputs. Example: Hide the "Folder Path" input unless the "Download Enabled" switch is turned on.

飞书文档 - 图片

Efficiency in Testing and Debugging

The v2.x editor includes features specifically designed to speed up the debugging of parameterized flows.

  • App Input Preview: When running a flow in the editor, the "App Input" window appears automatically. This lets you test the user experience and UI logic immediately.

  • Input History: The system remembers the parameter sets from the last 5 runs.

    • Scenario: If a bot fails with a specific configuration, you can instantly reload those exact parameters from the history to reproduce and fix the error.

  • Modify Inputs: If you need to change your test data, simply select "Edit inputs" from the Run dropdown menu.

Best Practices for v2.0

  • Expose Key Settings: Always design account info, keywords, and file paths as Input Variables.

  • Optimize the UI: Use File Pickers instead of plain text boxes for paths to reduce user error.

  • Use Logic Dependencies: Keep your input forms clean by only showing relevant parameters based on previous selections.

Quick Transition for v1.x Users

If you are moving from v1.x, here is the simplified mapping:

  • Input Variables replace and expand the old "Custom Variables set as Startup Parameters."

  • Flow Variables unify both "Internal Custom Variables" and "Instruction-generated Flow Variables."

The Core Shift: Instead of worrying about how a variable was created, you now only focus on who provides the value: the system (Internal) or the user (External).

Did this answer your question?