
Written by Ana Canteli on 13 January 2026
For years, “automation” meant drawing a diagram and passing tasks from one user to another. That works… until the process depends on real documents (contracts, invoices, case files, requests) and the usual bottlenecks show up: manual classification, incomplete data, endless approvals, and errors caused by lack of context.
The real revolution arrives when the workflow engine connects to AI and sits on top of a document management system. At that point, the workflow stops being “blind”: it can read the document, extract information, classify, validate, and route the process using data-driven rules—not assumptions.
In OpenKM, this approach takes shape with OKMFlow, the native workflow engine integrated with OpenKM to run end-to-end document processes. And what’s interesting (for anyone looking for “AI-enabled workflows”) is that OKMFlow isn’t just about “tasks”: it includes forms, context variables, scripts, notifications, scheduling, and monitoring and traceability mechanisms that fit very well with a connected AI layer.
Below, I explain what changes when you bring these pieces together, with examples and concrete concepts taken from OKMFlow’s technical documentation (nodes, variables, forms, API, and best practices).
An intelligent workflow isn’t defined by having more steps—it’s defined by making better decisions with less human intervention. When you connect AI to document management, you typically gain:
In OKMFlow, this “intelligence” relies on a key concept: workflow context. Each process instance works with variables (for example, amounts, UUIDs, emails, statuses, AI results) that can be read and written from tasks, forms, and scripts. This allows AI to be not a “black box,” but a governed data source inside the process.
Many companies try to automate document processes with external tools (BPM, integrations, standalone automation tools) and end up with a hard-to-maintain “ecosystem”: more failure points, more synchronizations, more permissions, and more scattered auditing.
OKMFlow is designed as OpenKM’s native workflow engine with a clear deployment architecture: it installs as its own service (including a bundle with Tomcat 10.1 + OKMFlow) and requires Java 17—specifically to ensure compatibility and technical evolution. It’s a detail that seems “purely technical,” but it says a lot: OpenKM is pushing a modern workflow engine on an updated runtime foundation.
On top of that, OKMFlow offers building blocks that reduce friction in real projects:
Result? Less “glue engineering” and more document automation you can actually maintain.
Approval chains fail for the same reason: they ask people to decide when data is still missing. AI changes the natural order of the process:
An automatic node can validate the basics: Are required metadata present? Is the document the expected type? Do the basic rules match?
If the amount is high, the workflow can escalate to a “supervisor” or “management.” In OKMFlow this is handled with decision nodes or even action nodes which, in addition to executing logic, can return the name of the transition to follow (optional routing from an action). It’s a powerful way to combine “do things” and “choose the path” in a single step.
Task nodes enable human interaction through forms (XML), with structured fields and buttons that trigger transitions (approve / reject). And here’s a practical advantage: the decision outcome is stored as variables and can drive the rest of the flow (notifications, archiving, final metadata, etc.).
OKMFlow also supports pool tasks: instead of assigning to a single person, you can return a list of users and anyone in the group can “claim” the task, becoming the sole assignee. This reduces blocking when someone is absent.
If classification and metadata are poor, everything else collapses: weak search, fragile automation, difficult audits.
In OKMFlow the approach is straightforward: use forms and variables as the data backbone. For example:
Where does AI come in? Right here: AI can automatically fill part of that data (extraction), suggest categories (classification), and store it as variables/metadata. Then the workflow decides: file it in the correct path, apply the property group, notify someone, or open a validation step if there are doubts.
In sensitive sectors, the biggest barrier to AI is data sovereignty: documents with personal, financial, or contractual information you don’t want to leave your perimeter.
OKMFlow’s documentation shows the engine is deployed as its own service and supports common corporate databases (for example, MariaDB, PostgreSQL, or Oracle). This fits an on-premise approach where you keep document management and workflow inside your infrastructure, and connect AI in a controlled way (for example, with internal models or approved providers).
The key is architecture: if workflow and document management live in your environment, you can design an AI layer that complies with your rules (audit, access control, traceability, retention, and compliance).
There’s no single answer, but there is a clear rule:
Cloud usually wins when you need speed, less infrastructure, and easy scaling.
On-premise usually wins when data is critical, compliance is strict, and you need deep internal integrations.
In practice, many organizations go hybrid: cloud AI for “non-sensitive” cases and on-premise AI for regulated processes. The important part is that the workflow engine (OKMFlow) doesn’t force you into a single option: because it deploys as a service and works with standard databases, you can adapt it to the model your organization needs.
For AI + workflow to work, you need two things:
A motor that orchestrates (human tasks + automation + rules)
OKMFlow does this with nodes: Start, Task, Action, Decision, Mail, Scheduled, End, and with named transitions for clear routing.
A clean way to program automation
OKMFlow provides a very practical layer: scripts with access to context, utilities (WorkflowUtils, FileLogger, PathUtils, etc.), and the ability to interact with OpenKM via API (for example, adding metadata, moving documents, searching, etc.).
This makes “connecting AI” straightforward: an action node can call your AI service, store results as variables, and decide the next path. Then, a Task node can request human validation if confidence is low. Or a Mail node can notify stakeholders with dynamic content (supports ${...} variables and FreeMarker-style templates for conditionals).
For advanced automation, you also have scheduled nodes: periodic actions with a configurable interval (default every 60s in ISO 8601 format, e.g., PT60S). This enables powerful patterns such as parallel parent-child workflows: launch multiple subprocesses (e.g., manager voting) and then wait for all responses before continuing.
Real automation isn’t measured by “how nice the diagram looks,” but by whether you can operate the system when something fails.
OKMFlow includes very practical tools for this:
Operational guides also cover common errors: timeouts (adjust openkm.rest.client.call.timeout), credential issues with workflow.adapter.login/password, or errors due to a misconfigured URL (missing trailing slash).
If you’re exploring AI-enabled workflow engines, we show you how to design them in OKMFlow + OpenKM and what parts AI can realistically solve. And if you already have a workflow in mind, we can help you turn it into a governed, versioned, and traceable workflow.