Having worked with both approaches across numerous enterprise implementations, I can provide some structured guidance on this decision:
Workflow Visual Modeling Advantages:
The process automation workflow module excels in scenarios where the approval flow itself is the primary complexity. For your expense management case:
-
Transparency: Business stakeholders can literally see the approval path. This is invaluable during requirements gathering and UAT. Non-technical managers can review the workflow diagram and confirm it matches their mental model.
-
Built-in Infrastructure: You get task management, user work queues, task history, and audit trails out of the box. Building equivalent functionality with microflows requires significant boilerplate code.
-
Change Management: When approval rules change (and they will), modifying a visual workflow is faster and less error-prone than tracing through microflow logic. You can see immediately what changes and what remains the same.
-
Parallel Approvals: The workflow module handles concurrent approval branches elegantly. Implementing this in pure microflows requires careful state management and synchronization logic.
Microflow Flexibility Benefits:
Microflows become necessary when:
-
Dynamic Routing: If your approval routing depends on complex calculations, external API calls, or database queries that change frequently, microflows give you full programmatic control.
-
Integration Points: When you need to trigger external systems during the approval process (ERP updates, email notifications with custom logic, etc.), microflows provide direct access to all Mendix capabilities.
-
Performance Optimization: For high-volume scenarios, custom microflows can be optimized more aggressively than workflow engine processing.
Exception Handling Reality:
This is where the workflow module truly differentiates itself:
-
Timeout Escalation: Configure automatic escalation when approvers don’t respond within SLA timeframes. With microflows, you’d need scheduled events to check task ages and trigger escalations.
-
Delegation: The workflow module supports approver delegation natively. Users can temporarily assign their approval tasks to colleagues. Building this with microflows requires complex permission management.
-
Substitute Approvers: Configure backup approvers who automatically receive tasks when primary approvers are unavailable (vacation, leave, etc.). This is workflow configuration vs. custom development.
-
Ad-hoc Routing: Business users can sometimes need to route approvals outside the standard flow. Workflows support this through task reassignment features.
My Recommendation for Your Use Case:
Use the Workflow Module as your primary approach for these reasons:
- Expense approval routing is exactly the use case workflows were designed for
- Your multi-level approval structure maps naturally to workflow stages
- Amount-based conditional routing can be handled with workflow decision points
- Exception scenarios (manager unavailability) are covered by built-in features
- Maintenance costs will be significantly lower as business rules evolve
When to Call Microflows from Workflows:
Use microflows for:
- Complex amount threshold calculations that involve multiple factors
- Determining approver lists dynamically from organizational hierarchies
- Validating expense data against external systems before routing
- Sending custom notifications with rich formatting or attachments
- Updating related systems when approval stages complete
The key is keeping workflows responsible for process orchestration (what happens when, who approves what) and microflows responsible for business logic (calculating amounts, determining approvers, validating data).
Maintenance Cost Perspective:
Over a 3-5 year lifecycle:
- Workflow-based: Changes to approval flow take 1-2 hours, mostly configuration
- Microflow-based: Changes require code review, testing, and deployment, typically 4-8 hours
- Hybrid approach: Changes are isolated to either workflow config or microflow logic, rarely both
For your expense system, I’d estimate the workflow approach will reduce maintenance effort by 40-60% compared to pure microflows, while providing better visibility and built-in features that would take weeks to build custom.
The visual workflow modeling isn’t just about pretty diagrams - it’s about separating process concerns from business logic concerns, which is fundamental to maintainable enterprise applications.