Ask any chatbot to "draw the invoice approval process" and you get one of two things: a picture you cannot edit, or a block of Mermaid that looks like a flowchart but is not BPMN. Either way, the result lives in a chat and dies there.
We took a different route at Instant Process. Our editor already turns plain-text process code into BPMN diagrams. So we gave AI assistants a remote Model Context Protocol server, and let them write that code, compile it and render it, the same way a developer would.
This post covers how it works and what we learned. The full walkthrough for process analysts, with every step of a real assignment, is on our blog: Bring process mapping into your AI workflow with MCP.
Why code beats pixels for an LLM
Language models are good at writing structured text and bad at placing shapes on a canvas. A BPMN diagram described as code plays to that strength:
LANE Supplier START 'Invoice sent' NEXT LANE 'Accounts payable' ACTIVITY-RECEIVE 'Register invoice' NEXT GATEWAY-EXCLUSIVE 'Purchase order found?' NEXT 'Match invoice to PO' 'Yes' AND 'Ask budget holder for PO' 'No' ACTIVITY 'Ask budget holder for PO' NEXT 'Match invoice to PO' ACTIVITY 'Match invoice to PO' NEXT LANE 'Budget holder' ACTIVITY-USER 'Approve invoice' NEXT GATEWAY-EXCLUSIVE 'Approved?' NEXT 'Schedule payment' 'Yes' AND 'Dispute with supplier' 'No' LANE Finance ACTIVITY 'Schedule payment' NEXT END 'Invoice paid' LANE 'Accounts payable' ACTIVITY-SEND 'Dispute with supplier' NEXT END 'Invoice disputed' One line per node, links with NEXT and AND, lanes as sections. The layout engine does the rest:
The model never decides where a box goes, so there is no messy diagram to fix afterwards. And because it is text, a human can review the diff.
The loop: write, compile, render
The important part is not the generation, it is the feedback loop. The MCP server exposes tools that let the assistant check its own work before anything is saved:
- Read the spec. The server ships the language specification, agent instructions and a cheatsheet as resources. The assistant reads them before writing code.
- Compile.
compile_processreturns errors and BPMN warnings, such as a sequence flow between two pools or a reference to a step that does not exist. - Fix and save. The assistant corrects the code and writes it with
update_process_codeorcreate_process. - Render.
render_processreturns an image the assistant shows in the chat, plus a link that opens the process in the editor.
That loop is what turns "the AI drew something" into "the AI produced a checked model". The assistant cannot save code that does not compile, and every save returns the BPMN rules the process still breaks.
The server also ships four prompts that clients show as shortcuts: create a process from text, explain a process, review a process against modeling guidelines without changing it, and tidy the layout of a process.
What a real session looks like
A consultant interviews the accounts payable lead, pastes the transcript into Claude and asks:
Create a process from this interview in my Client A / Finance folder. Use lanes for Supplier, Accounts payable, Budget holder and Finance. Model the missing purchase order and the rejected invoice as separate paths. List every assumption you make. The draft appears in their drive with a list of assumptions. In the validation session, stakeholder corrections become one-line instructions ("skip approval for invoices under 500 euro"), and the assistant reads the current code, edits it, compiles and re-renders. At the end, the client gets a link and a BPMN 2.0 XML export that opens in Camunda Modeler or bpmn.io.
The blog post walks through all six steps, from discovery interview to handover.
Auth and safety
Letting an agent write to your data needs guardrails:
- OAuth per client. The client signs in as you and is approved on a consent page that names it.
- Same permissions as the user. The assistant only sees processes you may open.
- Read-only option. Write access can be switched off at approval.
- Soft delete only. Trashed processes stay restorable.
- Revocable. Every connected client is listed under Account, Connected apps.
The client brings its own model, so MCP work uses none of your Instant Process AI budget.
Try it
The server URL is the same for every client:
https://api.instantprocess.nl/mcp In Claude Code:
claude mcp add --transport http instantprocess https://api.instantprocess.nl/mcp In Cursor (~/.cursor/mcp.json):
{ "mcpServers": { "instantprocess": { "url": "https://api.instantprocess.nl/mcp" } } } Setup for Claude, ChatGPT, Cursor, GitHub Copilot and Codex is on the AI assistants page.
If you build MCP servers yourself, I'd like to hear how you handle validation loops for generated artifacts. And if you map processes for a living, the full walkthrough is written for you.

