Build IIoT Solutions Without Memorizing a Single Command
You don’t need to be a LoT (Language of Things) expert to build industrial IoT solutions with Coreflux. With an AI assistant connected to the Coreflux MCP, you describe what you want in plain English, and the AI writes the LoT code for you — correctly, following best practices, using real syntax from the official documentation. This page walks you through the entire workflow: from setting up the MCP connection to deploying a working IIoT feature, using only natural language prompts. Whether you’re monitoring factory temperatures, logging production data to a database, or bridging sensor networks to the cloud — the process is the same.When to Use This Guide
- You’re new to Coreflux and want to build something real without learning LoT syntax first
- You have an AI coding assistant (Cursor, Claude, Copilot) and want to use it effectively for IIoT
- You want a step-by-step walkthrough of the AI-assisted development workflow
- You’re exploring whether Coreflux fits your industrial automation or IoT data pipeline needs
Prerequisites
Before starting, make sure you have:If you haven’t connected the Coreflux MCP to your AI assistant yet, follow the MCP Setup Guide first. It takes under 5 minutes.
The AI-Assisted Workflow
Every AI-assisted Coreflux project follows three phases. This isn’t a suggestion — it’s the workflow that consistently produces working results.
The key insight is that you are the domain expert and the AI is the LoT expert. You know your factory floor, your sensor layout, your business rules. The AI knows the syntax, the patterns, and the best practices. Together, you build faster than either could alone.
Phase 1: Plan Your Feature
The most important step happens before any code is written. A clear plan gives the AI the context it needs to produce working LoT code on the first try.Describe Your Goal, Not Your Code
Tell the AI what you want to achieve, not how to write it. Let it choose the right LoT building blocks.- Good Prompt
- Bad Prompt
A clear, goal-oriented description that gives the AI enough context to make architectural decisions:
The Planning Checklist
Before you prompt your AI assistant, gather answers to these questions. You don’t need to answer all of them — but the more you provide, the better the result.Ask the AI to Propose an Architecture
Once you’ve described your goal, ask the AI to plan before coding. This avoids wasted iteration.“For this system, I recommend:Review this before saying “go ahead.” It’s much easier to adjust a plan than to rewrite code.Topic structure:
- An Action to monitor temperatures and trigger alerts
- A Model to structure sensor readings into consistent JSON
- A Route to store readings in PostgreSQL
- A callable Action for the Celsius-to-Fahrenheit conversion (reusable)
sensors/+/reading(input),processed/+/fahrenheit(converted),alerts/temperature/+(alerts)”
Phase 2: Build with AI
Now let’s walk through a complete guided demo. We’ll build a temperature monitoring system that reads sensor data, converts units, triggers alerts, and logs to a database — all by prompting the AI.Step 1: Create the Core Logic (Actions)
Start with the Action that processes incoming data. Paste this prompt into your AI assistant:The AI uses the MCP’s
consult_documentation and consult_internal_documentation tools behind the scenes to look up correct syntax. You don’t need to tell it to use the MCP — it does this automatically when it detects a Coreflux-related question.Step 2: Add Unit Conversion (Callable Action)
Now ask the AI to add a reusable conversion utility:Step 3: Structure the Data (Model)
Ask the AI to create a Model that formats raw sensor readings into consistent JSON:Step 4: Connect to a Database (Route)
Now bring in a Route to persist the data. Ask the AI:Step 5: Deploy Everything
Ask the AI how to deploy your code:- VS Code (LoT Notebooks)
- MQTT Client
The recommended way to deploy LoT code is through the LoT Notebooks extension in VS Code or Cursor.
1
Create a Notebook
Create a new
.lotnb file in your project. Each cell can contain one or more LoT definitions.2
Add Your Code
Paste each definition into its own cell — this lets you deploy and test them individually.
3
Run Each Cell
Execute cells in order. The extension sends the LoT code to your connected Coreflux broker.
4
Verify in MQTT Explorer
Open MQTT Explorer and subscribe to
# (all topics). Publish a test payload to sensors/temp001/temperature and watch the system respond.Phase 3: Verify and Iterate
After deploying, test the system by publishing a simulated sensor reading.Test Your System
Open MQTT Explorer (or any MQTT client) and follow these steps:1
Subscribe to All Topics
Subscribe to
# to see all messages flowing through the broker.2
Publish a Test Reading
Publish to
sensors/temp001/temperature with this payload:3
Check the Results
You should see messages appear on these topics:
4
Test Below Threshold
Publish to
sensors/temp001/temperature with {"value": 45.0}. Verify that no alert is generated — only the processed and fahrenheit topics should update.When Something Doesn’t Work
If the output isn’t what you expect, describe the problem to the AI:Prompt Patterns That Work
After building dozens of IIoT features with AI, these prompt patterns consistently produce the best results.Pattern 1: Context → Goal → Constraints
Provide the situation, then state what you want, then add any constraints:Pattern 2: Ask for Explanation Before Code
When learning, ask the AI to explain its choices:Pattern 3: Incremental Building
Build complex systems one piece at a time rather than all at once:Pattern 4: Reference the MCP Explicitly
When you need maximum accuracy, tell the AI to consult the documentation:consult_documentation or consult_internal_documentation through the MCP, ensuring the answer uses real, verified syntax.
Common Pitfalls
These mistakes happen frequently when developers start using AI for LoT development. Knowing them upfront saves hours of debugging.Expanding Your System
Once the basic monitoring system works, you can extend it with a single prompt each. Here are natural next steps:
Each of these is a single prompt that the AI can handle using the MCP documentation. The workflow is always the same: describe → review → deploy → verify.
Next Steps
Coreflux MCP Setup
Haven’t connected the MCP yet? Set up your AI assistant’s connection to the Coreflux documentation in under 5 minutes.
Best Practices & AGENTS.md
Level up your AI workflow with naming conventions, code patterns, and a project rules template that keeps your assistant consistent.

