Industrial Automation Flows
Go beyond simulation: automate MaConSim itself with low-code flows and sandboxed Python functions. React to machine events with triggers, expose flows as operator buttons and live displays on the dashboard, implement OPC UA methods, and log every run.
Back to the product overview.

How automation works
- Write functions — reusable units with typed inputs and outputs, either as a Python script or as a low-code flow on a visual canvas.
- Compose flows — step-by-step procedures that call functions (capabilities), wait, branch and loop. Unlike a function, a flow is not atomic: every step takes effect immediately.
- Wire triggers — flows start automatically when the database changes (machine status changes, SFC completed, order finished, alert raised, NC code recorded, …), optionally with conditions and a cooldown.
- Expose buttons and displays on the Production Operator Dashboard so operators can start flows and see their outputs live.
- Every run is recorded in the Automation Run Log — including which trigger started it. Test safely with Test (no changes): reads execute, writes are only listed.
Capabilities
- Python functions: typed parameters, allow-listed standard modules, run in an isolated sandbox (embedded WASI interpreter where available, otherwise system Python 3.8+); static checks refuse unsafe scripts before they are saved
- Low-code flows: input/output variable boxes wired to capability calls, if/else and for-each steps
- Capabilities palette: machine, order, SFC, takt, part, simulation, alerts, NC codes, maintenance, materials, tools, OPC UA, MQTT and more — everything a function or flow can read or change at runtime
- OPC UA methods: implemented by functions, callable by external OPC UA clients — see OPC UA simulator
- Database triggers: SQL trigger templates with a review → approve → activate workflow (PostgreSQL)
- Custom variables, automation buttons, automation displays, run log
- Limits and safeguards: 10,000 steps per run, 1,000 loop items, 3 levels of nested flows, waits up to 1 hour, flow timeout 5 min (default), function timeout 10 s (default), 500 runs kept per plant; triggers respect a cooldown and disable themselves if they fire more than 20 times in 10 s
Typical use cases
- React to simulation events: “When any machine goes STOPPED, run the maintenance-notification flow.”
- Simulate operator workflows end-to-end and verify MES reactions.
- Implement OPC UA methods that MES clients can call during integration tests.
- Build reproducible demo environments: import a plant YAML that already contains functions, flows, buttons, displays and triggers.
Technical details
| Aspect | Detail |
|---|---|
| Function sources | Python script (sandboxed) or low-code flow |
| Python runtime | Embedded WASI sandbox (CPython 3.14, no files/network/processes) or system Python 3.8+ (MES_PYTHON) |
| Atomicity | Functions are atomic; flows apply every step immediately |
| Dry run | “Test (no changes)” lists would-be changes without executing them |
| Plant export | Functions, flows, buttons, displays and triggers are included in the YAML export; runs are not |
| AI agents | Agents can create and run functions via the MCP server; marked created by agent |
FAQ
Which Python version do scripts run on? Where the embedded sandbox is available it uses CPython 3.14 compiled to WebAssembly (isolated: no files, network, environment or processes). Otherwise a system Python 3.8+ is used as a hardened fallback.
Are flows atomic like functions? No. A function applies its changes only if the whole script succeeds; a flow executes every step as it goes.
What are the execution limits? 10,000 steps per run, 1,000 loop items, 3 levels of flows calling flows, one wait up to one hour, a flow timeout (default 5 minutes) and a function timeout (default 10 seconds). 500 runs are kept per plant in the run log.
Can an AI agent create automation without review? Via the MCP server, yes — agent-created functions run without an approval step but inside the sandbox and are badged created by agent so you can review them.
Technical documentation
Read the automation chapters of the User Manual: Advanced Database Features, Python Functions, Automation Flows, Automation Triggers, Dry Run and Limits.
Related: MCP Server · OPC UA simulator · Machine Simulation.
