Building Complex Process Models with Plugboard and AI
Source: Dev.to

If you are working on simulation, digital twins, or complex event‑driven workflows, you likely know the pain of managing state and data flow between dozens of disconnected components. Plugboard is a Python framework designed to solve exactly this problem.
In this post we’ll look at what Plugboard does, real‑world use cases, and how you can super‑charge your development by combining it with AI using a custom prompt for your LLM of choice.
What is Plugboard?
Plugboard is an event‑driven modelling and orchestration framework built for Python. Think of it as a way to wire together different components—which could be anything from a physics simulation to a machine‑learning model—so that they can communicate and react to each other in real time.
It handles the heavy lifting of:
- State Management: Keeping track of the internal state of every component.
- Data Flow: Automatically routing data between inputs and outputs (e.g., the output of a tank‑level sensor triggers a valve controller).
- Orchestration: Running these models efficiently, whether on a single laptop or scaled out to a compute cluster in the cloud.
Because it is built on modern Python (asyncio, type hinting), it integrates seamlessly with the existing data‑science and engineering ecosystem. Use it to create robust, maintainable models for research or live deployment.
Real‑World Examples: Where to Use Process Modelling
Process modelling isn’t just for academic simulations. Plugboard is designed for practical, data‑intensive applications. Here are a few examples of what you can build:
- Digital twins for industrial engineers: Create a digital replica of a manufacturing plant to test changes before applying them. Plugboard can handle complex loops like material recirculation or production‑process optimisation, where feedback from one stage affects an earlier one.
- Physics‑based simulations: Connect discrete physical models (e.g., a hot‑water‑tank model) with control logic to simulate energy efficiency under different usage patterns. You can integrate third‑party models as long as you can invoke them from within your Plugboard Python classes.
- Financial modelling: Build event‑driven trading strategies, such as momentum‑trading algorithms that react to tick‑level market data in real time. Use the built‑in optimisation algorithms to fine‑tune them for performance.
- AI pipelines: Orchestrate LLM workflows, where one component filters raw data and feeds it into an LLM for processing, creating a robust chain of AI agents.
Getting Started: Documentation & Examples
The best way to dive in is through the official Plugboard Documentation. The docs are comprehensive, offering:
- Tutorials: Step‑by‑step guides taking you from a “Hello World” model to parallel execution.
- API Reference: Detailed breakdowns of
Component,Process, andConnectorclasses. - Examples: Ready‑to‑run code snippets for common patterns, like building custom components or setting up a local process.
Supercharging Development with AI
One of the most powerful ways to build with Plugboard is to use it alongside an AI coding assistant like GitHub Copilot or Claude Code. However, general‑purpose AI models don’t always know the specific syntax and lifecycle methods of a new framework.
To bridge this gap, the Plugboard team has provided a custom instructions file specifically designed to teach AI models how to write Plugboard models.
Using the Custom Copilot Prompt
You can find the prompt file here: 👉 models.instructions.md
How to use it effectively
-
Context is key – When you ask your AI assistant (Copilot, Cursor, etc.) to generate a new component, reference this file.
- If you are coding with GitHub Copilot, the file will be picked up automatically when you create files in the examples folder.
- GitHub provides documentation on how to set this up for your own repositories.
-
Provide clear instructions – Detail what you want the model to do and, if possible, enumerate the individual components it will need.
Example prompt to create a simple working process simulation:
Create a Plugboard model of a bathtub filling with water. It should contain the following components: * A tap, with a parameter for the inlet flow rate in litres per second, * A bathtub with a parameter for the size in litres, and * An overflow, which outputs the overflow rate in litres per second. The simulation should run for 60 minutes at a resolution of 1 minute each step. Log the bathtub level and overflow amount to a CSV using the DataWriter component.
The AI will quickly generate a model similar to the one below, which you can iterate on and extend.
Happy modelling!
e on and refine.

All Plugboard models can be exported in a simple YAML format, allowing you to save/version them, and transfer them to a different computing environment as your needs evolve.
Ready to start modelling? Check out the GitHub repository and give it a star!
