Process automation vs custom microflows for approval routing

I’m designing an approval routing system for our expense management application and trying to decide between using Mendix’s process automation workflow module versus building custom routing logic with microflows. The requirements include multi-level approvals, conditional routing based on amount thresholds, and exception handling for manager unavailability.

From what I understand, workflow visual modeling makes it easier to see the approval flow at a glance, but microflows offer more flexibility for complex conditions and integrations. However, I’m concerned about long-term maintenance costs and which approach will be easier to modify as business rules change.

What has been your experience with these two approaches? When would you choose visual workflow modeling over custom microflow logic, especially considering exception handling scenarios?

I disagree somewhat. While workflows are great for straightforward approval chains, they become limiting when you need complex conditional logic. We tried using the workflow module for a similar expense system, and ended up having to call microflows from within the workflow anyway for the business rule evaluation. At that point, you’re mixing two paradigms and the maintenance becomes harder, not easier.

The maintenance cost argument is crucial. I’ve maintained both types of systems. Workflow-based systems are easier to hand off to junior developers or even power users because the visual representation is self-documenting. Microflow-based routing requires diving into code, understanding the logic flow, and hoping the previous developer left good comments. When business rules change frequently - which they do with approval processes - the workflow approach reduces change cycle time significantly.

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:

  1. 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.

  2. 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.

  3. 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.

  4. 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:

  1. 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.

  2. 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.

  3. 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:

  1. Expense approval routing is exactly the use case workflows were designed for
  2. Your multi-level approval structure maps naturally to workflow stages
  3. Amount-based conditional routing can be handled with workflow decision points
  4. Exception scenarios (manager unavailability) are covered by built-in features
  5. 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.

Fair points on maintenance. I think the real answer is hybrid - use workflows for the orchestration and standard approval routing, but don’t be afraid to call microflows for complex business logic. The key is keeping the boundary clear: workflows handle the process flow and task management, microflows handle the business rules and data validation.

Exception handling is actually where workflows shine. The module supports task reassignment, delegation, and escalation natively. For manager unavailability, you can configure automatic reassignment to a backup approver or escalation to the next level after a timeout period. This is all configurable without code. With pure microflows, you’d need to build all that infrastructure yourself - tracking task states, handling timeouts, managing reassignments.

That’s an interesting point about mixing paradigms. How did you handle exception scenarios like manager unavailability? Did the workflow module’s built-in features cover that, or did you need custom logic there too?

I’ve implemented both approaches in multiple projects. For approval routing specifically, I strongly lean toward the workflow module. The visual modeling makes it much easier for business analysts to understand and validate the flow without reading code. Plus, the built-in task management and user assignment features save significant development time.