The Lumi AI Workspace enables the development and deployment of custom web applications by leveraging cloud APIs from the Delfi digital platform and Lumi data and AI platform. This guide offers a straightforward, step-by-step walkthrough to help you build and preview your first web application using SLB APIs within the AI Workspace. To illustrate the process, we’ve used the OSDU Search API in a sample Dash web app.
While this tutorial is based on the Dash-Python framework, you can also use alternatives like Shiny, Bokeh, or even create a traditional HTML web application using JavaScript and CSS.
- The Lumi Data Science subscription is required to access the AI Workspace.
- The Dataiku code environment is required with the following packages. You might need a Data Science Admin subscription to create or modify the code environment to get the following mandatory packages installed. See "Step 3: Set up code environment" for more information.
dash==3.0.4
dash-bootstrap-components==2.0.3
Flask==3.0.3- Launch the Data Science app from the My Subscriptions section of Digital Home.

- Launch the AI Workspace by clicking AI Workspace as shown below.

The AI Workspace has four main tabs that display projects in the workspace. Each project is displayed as a card.
My Projects: Displays all of the projects created by the logged-in user. From this tab, you can create new projects or import existing templates.
Shared: Displays the shared projects that you have permission to access.
All: Displays all projects that you have permission to access.
Favorites: Displays the projects that you have tagged as a favorite by clicking on a card.
For more details on AI Workspace features, refer to the SLB Help documentation on the AI Workspace. Note, you must be onboarded to a Digital Home account to access SLB Help documentation.
A project is a container in Dataiku for all your work on a particular activity. Each project has a single flow that shows the pipeline of datasets and recipes associated with the project. To create a project in the AI Workspace:
- From the AI Workspace tab in the Data Science application, click New Project. The New Project dialog box opens.

- Type the project Name. Do not use special characters in the name, except for an underscore. The Project Key is added automatically when you enter the project name.
- Select the Status and Type.
- (Optional) Enter one or more Domain tags as needed.
- Search for and select users in your organization as Readers or Contributors.
- Enter a Description for the project.
- Click Create.
The project is added to the My Projects area in the AI Workspace. You can edit a project's details by clicking Edit on a project card.
- Click your project's name in the My Project area of the AI Workspace to launch the project page.
- Click the grid icon on the top-right of the page, as shown in the image below, and click Administration. The Administration page opens where you can create or modify code environments that can be used to run the webapp. You can only access Administration if you have a Data Science Admin subscription.

- Click the Code Envs tab to view available environments. You can filter the existing environments to show the ones that you would like to modify, or you can create a new Python environment as shown below:

If you are planning to create a new environment, the image below shows the settings to select when creating a code environment to run the provided webapp code.

Ensure the following dependencies are installed. To install dependecies, navigate to Packages to install as shown in image below.
Copy the provided dependency list below and paste it into the space provided for Requested packages.
Click Save and Update to update your code environment with the required dependencies.

Packages required
dash==3.0.4
dash-bootstrap-components==2.0.3
Flask==3.0.3Navigate back to the AI Workspace and click your project's name in the My Project area to launch the Project page in Dataiku.
Click the </> icon in the toolbar and select Webapp.

Click CREATE YOUR FIRST WEBAPP and select Code Webapp.

Click Dash to develop your webapp.

Select An empty Dash app.
Type the Webapp name in the space privided and click CREATE.

This creates an empty Dash webapp in the AI Workspace project where you can start coding.

The empty webapp has the following tabs:
Preview: Click to view the Webapp while you code.
Python: Click to show the code.
Log: Click to show the server log for the webapp.
Settings: Click to configure the back-end settings for the webapp server.
Each webapp requires a code environment with prerequisite packages and the right back-end settings to run without errors. You must specify the code environment containing the Dash packages to run the provided code snippets in this tutorial.
a) Go to Settings, change the value of Code env to Select an environment, and change the value of the Environment to the code environment with the prerequisite packages installed. Refer to the Prerequisites.
b) Change the Container to None-Use backend to execute.

c) Click Save at the top-right corner of the page.
The tabs in the AI Workspace webapp are highlighted in the image below.

a) Navigate to the Python tab in the web app and replace the existing dependency imports with the ones provided in the code snippet. This will ensure that the required dependencies for the web app being developed in this guide are properly imported. Your prewritten code snippet for importing dependencies should look like following highlighted snippet.
Prewritten dependency imports: 
Replace the highlighted line above of the prewritten code with the following snippet:
import dataiku
from global_de_utils import getAppKey, getSauthToken
import dash
from dash import html
from dash import dcc
import dash_bootstrap_components as dbc
from dash.dependencies import Input
from dash.dependencies import Output
from dash.dependencies import State
from dash.exceptions import PreventUpdate
import requests
import xml.etree.ElementTree as ET
b) Click Save from the top-right corner of the page.
c) Check the Log tab for any errors. If the Log tab shows "Backend is not running," click Start Backend.
d) If the Log tab indicates that any dependencies are missing, contact your Data Science application admin to update the code environment with the missing dependencies. Refer to Step 3 above for more information.
Copy and use the following code snippet on the Python tab to replace the app.layout defined in the prewritten code. Click Save to generate the UI elements as shown in the image below.
Copy and Paste the following code snippet:
# Define App layout using stylesheet
app.config.external_stylesheets = [dbc.themes.BOOTSTRAP]
Login_layout = html.Div([
dbc.Card(
dbc.CardBody([
html.Div([
html.H2("My First AI Workspace Webapp"),
], style={'textAlign': 'center'})
])
),
html.Br(),
dbc.Row([
dbc.Col(dbc.Button("Get Token", id="login_button", color="primary", n_clicks=0), width=2, className="d-grid col-2 gap-2"),
], className="mb-3",),
html.Br(),
html.Br(),
html.P(id="login_output"),
dbc.Row([
dbc.Col(dbc.Button("Show logged in User", id="ShowUser_button", color="primary", n_clicks=0), width=2, className="d-grid col-2 gap-2"),
], className="mb-3",),
html.Br(),
html.Br(),
html.P(id="ShowUser_output"),
dcc.Input(id='input-text', type='text', placeholder='Enter Kind to search'),
html.Br(),
html.Br(),
dbc.Button('Search', id='submit-button', color="primary", n_clicks=0),
html.Div(id='response-output')
])
# build your Dash app
app.layout = html.Div([
Login_layout
], className="container-fluid mt-3")
There are three controls in the webapp UI: Get Token button, Show logged in user button, and Search.
To write callbacks for these:
- Get Token button - Callback
The AI Workspace provides built-in functions to get an SLB Authenticator token and appkey that can be used to call any SLB platform APIs. The following code snippet is a simple function that can be used to generate the token.
a. Append the following code to define the callback for the Get Token button.
b. Click Save and test the Get Token button in the Preview tab. It should return the SLB Authenticator token.
Note: You must be logged into the Data Science Application for the getSauthToken() function to get the token successfully.
Code snippet:
# 'Get Token' button-function and callback
@app.callback(
Output("login_output", "children"),
Input('login_button', 'n_clicks'),
prevent_initial_call = True
)
def on_login_button_click(n_clicks):
stoken, info = getSauthToken()
return f"Your Access Token is {stoken}"
Show Logged in user button - Callback
a. Append the following code to define the callback for the Show logged in user button.
b. Click Save and test the Show logged in user button in the Preview tab. It should return your login email.
Code snippet:
# show logged in user- function and callback
@app.callback(
Output("ShowUser_output","children"),
Input('ShowUser_button', 'n_clicks'),
prevent_initial_call = True
)
def on_show_user_button_click(n_clicks):
from flask import request
#return 'test'
request_headers = dict(request.headers)
auth_info_brower = dataiku.api_client().get_auth_info_from_browser_headers(request_headers)
return auth_info_brower["authIdentifier"]
Search function - Callback
a. Append the following code snippet to define the callback for the Search button.
b. Replace the "server" in the API endpoint url definition and add the Data Partition ID in the header.
c. Click Save.
Add your "server" url and "Data Partition ID"
You can get the URL and data partition information from Digital Home.
a. Navigate to Digital Home and click the profile icon. You will see a Copy icon as shown in screenshot below.
b. Click the Copy icon and paste the copied text to a notepad.
c. You can use the "DeploymentURL" and "DataPartitionID" to replace "server" and "Add-Data-Partition-Here" respectively in the code below.


Code snippet:
# Search Function definition and Callback
@app.callback(
Output('response-output', 'children'),
Input('submit-button', 'n_clicks'),
Input('input-text', 'value')
)
def call_api(n_clicks, value):
if n_clicks > 0:
#get stoken
from global_de_utils import getAppKey, getSauthToken
stoken, info = getSauthToken()
appkey = getAppKey()
if info:
print(f"Error retrieving sauth token : {info}")
# API endpoint
url = "https://<Server>/api/search/v2/query"
# Headers
headers = {
"Authorization": 'Bearer ' + stoken,
'data-partition-id': '<Add-Data-Partition-Here>',
"Content-Type": "application/json"
}
# Payload
payload = {"kind": value, "limit":5}
# Make the API request
response = requests.post(url, headers=headers, json=payload)
# Check response status
if response.status_code == 200:
return f"API Response: {response.json()}"
else:
return f"Error: {response.status_code} - {response.text}"
The final webapp preview would like the image below. After the backend starts, you can test all three functions in the Preview tab.
- The Get Token button returns the SLB Authenticator token that can be used to call an API from within an AI Workspace webapp.
- The show logged in User button shows the logged-in user in the webapp.
- The search box takes the OSDU data "Kind," such as osdu:wks:master-data--Wellbore:1.0.0, as input and returns the first 5 search results. The search limit in the API is set to 5, but you can modify it as needed.
Final Webapp Preview

You were able to create a Dash WebApp in the AI Workspace that uses the provided SLB utility to get a token and call the "OSDU Search API." This can be extended to build custom applications using any of the SLB offered APIs for varied domain use cases.