Skip to content

Workflow Editor (.pseq)

The Workflow Editor lets you design your application's execution flow as a visual node graph. Each node (called a step) represents an action: showing a GUI, running a script, or branching based on a condition. Connections between steps define the order of execution.

Opening the Editor

Double-click any .pseq file. To create a new one, run Apleno: Create new Sequence file from the Command Palette.

The Canvas

The editor renders all steps on a free-form canvas that you can pan and zoom:

  • Pan: click and drag on an empty area.
  • Zoom: scroll the mouse wheel.
  • Select a step: click on it. Its properties appear in the sidebar panel.
  • Move a step: click and drag the step to reposition it.

The canvas position and zoom level are saved in the .pseq file so your view is preserved between sessions.

Step Types

Every sequence has exactly one Start step and can have one or more End steps. All other steps sit between them and form the execution path.

Start

The entry point of the sequence. Execution always begins here.

  • Has one output handle (bottom) to connect to the first action.
  • No configurable properties.

GUI

Displays a graphical interface to the user and waits for them to submit it (or, if no submit button is shown, advances when gui.submit() function is called).

Property Description
File Path to the .pgui file to display (relative to the workspace root).
  • Has one input handle (top) and one output handle (bottom).

Script

Executes R or Python code, either inline or from an external file.

Property Description
File Path to the R or Python script file (e.g. analysis.R).
  • Has one input handle (top) and one output handle (bottom).
  • Script steps can access widget values, call the Apleno Designer API, and manipulate the session state.

Condition

Evaluates an R or Python expression and branches the flow.

Property Description
Language R or Python.
Code An expression that evaluates to a truthy/falsy value.
  • Has one input handle (top).
  • Bottom handle → taken when the expression is true.
  • Right handle → taken when the expression is false.

Example:

age >= 18

Sequence

Includes and executes another .pseq file as a sub-sequence. When the sub-sequence reaches its End step, control returns to the next step in the parent sequence.

Property Description
File Path to the .pseq file to run as a sub-sequence.
  • Has one input handle (top) and one output handle (bottom).

End

Marks the end of the sequence. When reached, the app exits (or, in a sub-sequence, returns to the calling step).

  • Has one input handle (top) only.
  • No configurable properties.

Connecting Steps

Steps are linked by dragging from one handle to another:

  1. Click and drag from an output handle (bottom or right) to another step.
  2. Release to create the connection.

To remove a connection, select the target step and clear its incoming connection from the properties panel, or drag the connection away.

Tip

A step that has no outgoing connection will simply stop execution when reached (equivalent to reaching an End step).

Step Properties Panel

Clicking a step opens its properties in the sidebar on the right:

  • ID: a user-defined string identifier. Used by the Apleno Designer API to programmatically navigate to this step (e.g. rpgm.setNextSequence(rpgm.step("step-file", "step-id"))). Must be unique within the sequence.
  • Name: a human-readable label shown on the step list during the app (deprecated).
  • Type-specific properties (file, language, code) as described above.

Validation

The editor continuously validates the flow and highlights problems:

  • Steps with no outgoing connection (apart from End steps).
  • Duplicate Custom IDs.
  • Missing referenced files (.pgui, .pseq, script files).

Errors are shown in the error panel at the bottom of the editor.

Multiple Sequences

An Apleno Designer project can have multiple .pseq files. The entry point is defined in the .ppro file (sequenceStart). You can:

  • Break complex flows into reusable sub-sequences (use Sequence steps to call them).
  • Use separate sequences for distinct phases of your app (e.g. login.pseq, main.pseq, report.pseq).

Programmatic Navigation

From any R/Python script, you can jump to a specific step by its Custom ID using the Apleno Designer API:

rpgm.setNextSequence(rpgm.step("step-file", "step-id"))

This bypasses the normal flow and jumps directly to the named step, which is useful for looping back, error recovery, or multi-path navigation.

File Format

.pseq files are JSON. Example of a simple two-step sequence:

{
    "_version": 4,
    "cameraX": 0,
    "cameraY": 0,
    "cameraZoom": 1,
    "steps": [
        {
            "id": 1,
            "type": "start",
            "x": 0,
            "y": 0,
            "parameters": {
                "target": 2
            }
        },
        {
            "id": 2,
            "type": "gui",
            "x": 0,
            "y": 120,
            "customId": "welcome-screen",
            "customName": "Welcome",
            "parameters": {
                "file": "welcome.pgui",
                "target": 3
            }
        },
        {
            "id": 3,
            "type": "script",
            "x": 0,
            "y": 240,
            "customName": "Process inputs",
            "parameters": {
                "language": "r",
                "code": "message('Processing...')",
                "target": 4
            }
        },
        {
            "id": 4,
            "type": "end",
            "x": 0,
            "y": 360,
            "parameters": {}
        }
    ]
}

Tips

  • Use IDs on steps that you may want to jump to programmatically or dynamically change state or widgets.
  • Group related logic into sub-sequences to keep each sequence manageable.
  • A Condition step branching to another Condition step lets you implement multi-way branching.
  • You can duplicate a step's behaviour by routing multiple incoming connections to the same step.