Skip to main content

How to Operationalize Data Workflows in CDF using Streamlit UI [Contributed by SLB]

  • September 18, 2025
  • 1 reply
  • 33 views

Forum|alt.badge.img+4

Objective

This document demonstrates how Streamlit, a lightweight Python-based web framework, can be used to create a user-friendly interface for triggering Cognite Data Fusion (CDF) workflows - including:

  • Image/File Ingestion
  • Ad-hoc Workflow Execution
  • Metadata tagging and status handling

Such solutions allow non-technical users (e.g., engineers, operators) to initiate sophisticated data operations without writing code -increasing accessibility, automation, and operational agility.

 

Architecture Overview

[User] → [Streamlit UI] → [CDF SDK/API] → [Files, Workflows, Datasets, Metadata]

  • Ingestion: Upload images to Cognite File storage with metadata.
  • Transformation/Processing: Trigger workflows (e.g., YOLO object detection, anomaly detection).
  • Visualization & Logging: Provide real-time feedback and results to users.

Streamlit UI Features

  1. File Upload to Cognite
  • Accepts multiple image types (jpg, png, etc.)
  • Uploads them to Cognite File Storage
  • Assigns metadata and associates with a predefined data_set_id
  • Handles and displays upload success or failure
client.files.upload_bytes(
name=file_name,
content=file_bytes,
source="streamlit",
external_id=f"streamlit-img-{file_name}",
mime_type=uploaded_file.type,
metadata={"type": "image", "source": "streamlit"},
data_set_id="YOUR_DATASET_ID"
)
  1. Workflow Trigger
  • Simple button to run any registered CDF Workflow
  • Option to specify version or parameters
  • Can be extended to support user-input parameters for dynamic execution
client.workflows.executions.run(workflow_external_id="MainWorkflow", version="3")

 

Example Use Case: Subsea Image Anomaly Detection

Scenario:

  1. Field engineer uploads new batch of pipeline inspection images.
  1. They trigger the MainWorkflow which:
  • Ingests the images
  • Parses and tags them
  • Runs YOLO-based defect detection
  • Logs results back to CDF
  1. Results are visualized in downstream dashboards or reported via alerts.

 

Benefits

 

Feature

Benefit

No-code trigger 

Enables broader user base to operationalize AI/ML

Integrated with CDF 

Seamless metadata, logging, traceability

Ad-hoc ready 

On-demand execution without re-deployment

Modular & Reusable 

Easily extendable to other workflows

Secure & Auditable 

CDF SDK ensures enterprise-grade tracking

 

How to Extend

  • Add parameter inputs to Streamlit (text boxes, dropdowns).
  • Visualize execution results (success/failure, tags, bounding boxes).
  • Add authentication and user-specific tracking.
  • Chain multiple workflows: e.g., QC → Detection → Report Generation.

Summary

Streamlit + CDF = Lightweight Operationalization Layer

This integration pattern is ideal for:

  • Image processing
  • IoT data snapshots
  • AI-driven diagnostics
  • Interactive ETL tasks
  • Citizen data scientist enablement

It empowers asset teams to convert raw data into insights instantly - closing the loop between field data and digital action.

1 reply

Aditya Kotiyal
MVP
Forum|alt.badge.img+5

Great to see SLB CDF SMEs helping and sharing experiences with the community. Great work ​@Joy Barua .