How It Works
Each analysis script has:Trigger Types
Scripts can be triggered in different ways:Currently, only manual execution is available in the UI. Automatic triggers (after_experiment, scheduled, etc.) will be enabled in a future update.
Data Flow
When a script executes:- The server queries all datasets for the quest (filtered by the script’s
datasetTypesif set) - For each dataset, the actual file content is downloaded from blob storage
- Everything is sent to the Python executor as structured input
- The executor runs the script and returns output + stdout
- Results are saved as an execution record with status, output, errors, and timing
Writing Scripts
Scripts run in a Python 3.11 environment with numpy, pandas, scipy, and json pre-imported. Your code receives several variables automatically:Available Variables
Dataset Object
Each item in thedatasets list is a dictionary:
Returning Results
Set theoutput variable to return structured results. Anything printed to stdout is also captured.
Example: EEG Quality Check
Example: Experiment Reaction Times
Using the Dashboard
Analysis scripts are managed from the quest detail page, below the dataset sections.Creating a Script
- Open your quest in the dashboard
- Scroll to the Analysis Scripts section
- Click New Script
- Enter a name, select a trigger type, and write your Python code in the Monaco editor
- Click Save Script
Running a Script
- Find the script in the list
- Click Run
- The execution status and output appear in the expandable execution history below the script
Viewing Execution History
Click on a script row to expand it and see recent executions with:- Status (completed / failed)
- Execution time
- Output (stdout + structured output)
- Error messages and Python tracebacks (if failed)
Filtering by Dataset Type
If your script only needs certain data types, set the Dataset Types field when creating the script. For example, an EEG quality script should filter tobrain_recordings only — this avoids loading irrelevant prompt responses or experiment trials.
Supported dataset types:
brain_recordings— EEG data from Muse or Neurosityexperiment_trials— jsPsych experiment resultsprompt_responses— Answers to recurring promptsonboarding_responses— Onboarding form answers
Billing
Each script execution costs credits, billed asscript_run to the quest’s organization. See the Pricing page for current costs.
Permissions
To create, edit, or run analysis scripts, you need thedata.run_script permission in the quest’s organization. Organization admins have this by default. See Members & Permissions for details.
Limits
API Reference
Analysis scripts are also available via the REST API:Execute Request Body
datasetId restricts execution to a single dataset (useful for event-driven triggers). inputValues maps to the script’s configured input variables.
Explore
Experiments
Learn about the experiments that generate data for your scripts.
Billing
Understand how script execution costs are billed.
Viewing Quest Data
Browse the datasets your scripts analyze.
Members & Permissions
Manage who can run analysis scripts.

