Guide

Experiment flow & branching

Order experiments and route participants based on their answers.

The Flow tab arranges the experiments in a project into the sequence participants experience, and can send different participants down different paths.

Build a flow

  1. 1

    Add experiments to the flow

    In the Flow tab, click + on an experiment to add it. The first experiment is where participants start.

  2. 2

    Reorder

    Drag the handle to change the order.

  3. 3

    Add branching (optional)

    Open a step’s branch config and choose how to split participants: Split randomly (assign each to a path) or Branch on a value (route by a shared value a task recorded).

Shared values (carry data across tasks)

Most multi-task studies just need to pass a value from one task to the next — a screen-size calibration, a score, a name. In the Shared values card on the Flow tab, add the value, then say what it is for (e.g. “pixels per mm — size stimuli as mm × px2mm”). That description is baked into the copy prompt, so the AI knows how to use it. No code, no JSON.

Each value has its own two copy buttons

  • Copy: use in a task — paste into each experiment that USES the value; the prompt tells the AI to read it and how to apply it (from your description).
  • Copy: set in a task — paste into the experiment that PRODUCES the value (a calibration template already does this for you).

Copy each value on its own, so a task only gets the one it needs. Under the hood the value is stored on the participant’s session and injected into later tasks as window.__SESSION.vars.

Branching (optional)

Only needed if different participants should take different paths. Open a step’s branch config and pick one of two ways to split:

Two ways to split

  • Split randomly — name the paths (e.g. A, B), pick the next task for each, and choose even split (counterbalance) or random. The platform assigns each participant and remembers their path.
  • Branch on a value — pick a shared value a task set, then map each value (e.g. hard → Task X) to the next task. Add a route named default for anything unmatched.
Use Preview project to walk the full participant experience end-to-end, including branches and shared values.

Shared values AI prompt (advanced)

The Copy buttons generate this for you; this is the general reference for reading/writing shared values in an experiment.

Use VibeMyExpt session variables so this task shares state with the other tasks in the study.

Session variables live on window.__SESSION.vars and are shared across all tasks in a participant's run. Use them to read a value an earlier task set (or one assigned at the start), and to write a value later tasks or the flow can use.

Requirements:

1. READ: at the start, read any variables you need from window.__SESSION.vars, e.g.
   const S = window.__SESSION || { vars: {} };
   const group = S.vars.group;          // may be undefined if not set yet
   Fall back gracefully when a variable is missing.

2. WRITE: when the task determines a value that later tasks or branching should use, post:
   (window.opener || window.parent).postMessage({ type: 'vibemyexpt:set_var', key: '<name>', value: <value> }, '*');
   You can also write several at once:
   (window.opener || window.parent).postMessage({ type: 'vibemyexpt:set_var', vars: { '<name>': <value> } }, '*');

3. If the flow BRANCHES on a variable, its value must be one of the exact discrete string values the researcher declared for it (e.g. 'A' / 'B'). Continuous values (e.g. px_per_mm) are for read-back only.

4. Keep variable names and values consistent with what I describe below. Do not change the trial_data / experiment_complete protocol.