Launchers overview

Launchers let you turn your analyses into self-service web forms that less technical colleagues can interact with. They are great for creating "templatized" reports and analyses, so stakeholders can answer questions without bothering data scientists.

This guide describes the basic concepts of how they work, and provides complete working examples in R and Python.

You could build a Launcher to let your users upload data and specify parameters, and then see the output from any code you specify should run under the hood. For example, you could give your users something like this:

That would produce for them something like this:

Basic concepts

A Launcher is essentially a web form on top of any script you could run through Domino, i.e., anything you could run at a command line. Any arguments (i.e., parameters) your script or executable expects can be exposed as UI elements in the web form.

The Command

When you create a Launcher, you specify a command that runs under the hood. This command serves as a template: when an end-user runs the Launcher through the web form, parameters in your command template will be replaced with the user's input values, and the resulting command will run.


When your code runs, it runs just like anything else in Domino. Namely, Domino will detect new files your code produces — include images, CSVs, PDFs, HTML, etc. — and treat those as the "results". Whoever runs your Launcher will get a link to those results to view on the web, and they'll get an email when the results are ready. So your code can produce rich images, even interactive HTML dashboards, dynamically based on a user's input.


Like any other script you run through Domino, your command can take parameters/arguments. Anything in your command of the form ${param_name} will be treated as a parmeter in the Launcher -- i.e., it will be presented to the end user for input.

Your parameters can be of the following types:

  • Text: normal text field
  • Select: drop down where you can select one value from a list
  • File: button to select and upload files
  • Multiselect: list where you can select multiple values

An end user would see those parameters rendered like this in the final web form:

Writing your code to process parameter values

When an end-user runs your Launcher through the web form, the user's input values will be passed into your command in place of the corresponding placeholders you specified, and that final command will be run as though it were a command-line executable. That means your underlying code can access parmeters using any standard method for reading command-line inputs. The most common techniques would be:


Using sys.argv, e.g.,

import sys
p1 = sys.argv[1]
p2 = sys.argv[2]
# a file upload parameter
with open(sys.argv[3], 'r') as f: 
   print f.readline()
# a multi-select parameter
for part in sys.argv[4].split(","):
 print part   


Using the commandArgs function, e.g.,

args <- commandArgs(trailingOnly=TRUE)
p1 <- args[1]
p2 <- args[2]

# a file upload parameter
print(readLines(args[3], n = 1))

# a multi-select parameter
for (each in strsplit(args[4],",")) {
 cat(each, sep="\n")

Note that file parmeters will be passed into your file as the path to the file. Multi-select parameters will be passed in as the comma-separated list of all selected choices.

Full examples in R and Python


Our simple example lets users input two numbers, and behind the scenes, we run some R code that adds them and prints the sum (obviously a trivial example). Our script is in a file called launcher.R, and we could tell Domino to run launcher.R 10 20 (or any other two numbers), so our Launcher's command will be launcher.R ${A} ${B}.

You can view the "R example" Launcher in our sample project to see how this works. launcher.R reads inputs from the command line, using the commandArgs() function.

args <- commandArgs(trailingOnly = TRUE)
a <- as.integer(args[1])
b <- as.integer(args[2])
if ( {
 print("A is not a number")
} else if ({
 print("B is not a number")
} else {
 paste("The sum of", a, "and", b, "is:", a+b)

The R example Launcher is defined to take A and B both as parameters.

When operational, the user will see:


The "Scatter plotting your data" Launcher in the sample project shows a more sophisticated example in Python.

The idea is to have a script that creates an interactive scatter plot, using Bokeh, from a CSV file that anyone can upload using a web form. The user provides (a) a file (b) what to put on the X- and Y- axes and (c) some information how to color the data points; our Python script generates an interactive Bokeh scatterplot.

Writing the script

This is the complete code of

from bokeh.plotting import show, output_file  
from bokeh.charts import Scatter  
import pandas as pd  
import sys


data = pd.read_csv(sys.argv[1])  
scatter = Scatter(data, x = sys.argv[2], y = sys.argv[3], color = sys.argv[4], legend = "top_left")  

Building the Launcher

Select the “Launchers” button and click “New launcher”. Now you get a set up screen to build the web form.

Like we figured out writing the script, we need 4 parameters. So click “Add Parameter” 4 times. You can rename them by selecting the text.

Their exact names aren’t important for the script, they are for the users of the launcher only. The order of the parameters is directly linked to the script. So rename them to File, X, Y, Color.

After renaming the parameters, you should change their types. In the overview of the parameters, click on “File” and use the dropdown next to “Type” to select “Upload File”. X, Y and Color can remain type “Text”.

Make sure to put in a clear name for the launcher and you might have an idea for the Description. Your result should look something like this:

Using the Launcher

Now it is time to put this to the test! Select the “Launchers” button and click “Run” on the launcher that you have just created.

The earlier created form appears where you have to fill in the different values. As a dataset, I use scanvote.csv containing the percentage of a population voting “Yes” per district in Finland, Sweden and Norway.

With this data I would like to create a scatter plot with population (Pop) as X, “Yes” vote percentage as Y (Yes), and the points colored based on the country (Country)

Putting this in the launcher form will give the picture below. Hit “Run” and wait for the result!

When they run the Launcher, the user will get an interactive HTML page like this

Was this article helpful?
1 out of 1 found this helpful