Calling Workflows dynamically at runtime instead of explicitly selecting at design time - Mendix Forum

Calling Workflows dynamically at runtime instead of explicitly selecting at design time

0

Dynamic Runtime Workflow Invocation

Hi Team,

It would be valuable to have an option in Mendix to invoke a workflow dynamically at runtime instead of explicitly selecting and binding a specific workflow at design time.

As applications are increasingly adopting workflows at a larger scale, we often have scenarios where the workflow to be executed depends on business configuration, application context, user selection, or other runtime conditions. Currently, explicitly selecting the workflow at design time can make the implementation less flexible and can result in additional conditional logic when multiple workflows need to be supported.

Proposed Feature

I would suggest introducing a mechanism where a workflow can be identified and invoked dynamically at runtime using a workflow reference, workflow name/identifier, or another suitable runtime-resolvable mechanism.

For example:

Example Use Case

Consider an application that handles different types of claims in an insurance domain. The workflow may vary depending on the claim type, such as:

Instead of implementing separate decision branches and explicitly selecting each workflow at design time, the application could determine the appropriate workflow from configuration and invoke it dynamically at runtime.

Benefits

This capability could provide several advantages:

As workflow adoption continues to grow in Mendix applications, having a runtime workflow invocation mechanism could make workflow implementations significantly more flexible and scalable, particularly for enterprise applications with configurable business processes.

I believe this would be a valuable addition to the Mendix platform and would enable developers to build more dynamic, configuration-driven workflow solutions.

asked
1 answers

I think you can do that by retrieving all System.WorkflowDefinition objects and then calling Core.workflows.instantiate() in java

Created