3. Using a workflow engine instead
Workflow Engine
Scheduler
Durable State
Workflow Definitions
V1
V2
Workflow Engine:
Is stateful
Can wait
Can retry
Can escalate
Can compensate
Provides visibility
4. Execute Processes
One process instance gets started.
It is persisted in the workflow
engine and „walks“ through the
process model.
@PUT
retrievePayment() {
result = workflowEngine.
startProcessInstance('payment')
if (result.hasEnded())
return 'paymentSucceeded'
else
return 'paymentSucceeded'
}
Your code to provide
a RESTendpoint
Instance
Id
Process
Definition
Current
State
…
…-7454 payment „Charge
Credit
Card“
…
…-4571 payment „Charge
Credit
Card“
…
Process Instance Table
Durable state of
workflow engine
(e.g. via relational database)
Your glue code to
implement the RESTcall
@Task('chargeCreditCard')
chargeCreditCard() {
...
restClient.put(
'http://creditCards/charge/',
requestData)
}
Credit Card
Service
REST
5. Value Proposition of a Workflow Engine
Value of Visibility
Value of
long running
capabilities
Process
Orchestration
Business Transactions,
Sagas
Solving challenges
with remote communication
Integration Patterns
Graphical Programming
Effort of introducing
a workflow engine
24. Want to learn more?
https://ProcessAutomationBook.com/
Available as early release
Free 30 days trial available
Featuring code examples:
25. 26
Large Number of Use Cases
91.2 Billion
ANNUAL ACTIVITIES
3,000+
WORKFLOWS
83.9 Billion
ANNUAL ACTIVITIES
800+
WORKFLOWS
26. Summary
• Use a workflow engine to automate long running processes
• Orchestration helps to avoid chaos in microservice architectures
• The value proposition of a workflow engine includes visibility
And NOW you can leverage it together with Micronaut!