Comments (1)
One possibility with BEFORE and AFTER checks:
id: ecommerce-order-processing
namespace: ecommerce
description: E-commerce Order Processing Workflow
inputs:
- id: orderId
type: STRING
tasks:
- id: checkInventory
type: io.kestra.plugin.fs.http.Request
description: Check inventory for the order items
uri: http://inventory-service/check
contentType: multipart/form-data
formData:
orderId: "{{ inputs.orderId }}"
- id: processPayment
type: io.kestra.plugin.fs.http.Request
description: Process payment for the order
uri: http://payment-service/process
formData:
orderId: "{{ inputs.ordered }}"
checks:
- type: BEFORE
description: Check stock before accepting payment
condition: "{{ outputs.checkInventory.body.inventoryAvailable == true }}"
onConditionFail:
- type: RUN_SUBFLOW
flowId: alerting_flow_id
namespace: myteam
- type: SET_TASK_RUN_STATE
state: WARNING # FAILED, WARNING, CANCELLED, KILLED
- type: AFTER
description: Validate payment result
condition: "{{ outputs.processPayment.body.paymentResult == true }}"
onConditionFail: # optional, by default failed condition leads to failing the taskrun
- type: SET_TASK_RUN_STATE
state: CANCELLED # FAILED, WARNING, CANCELLED, KILLED
- id: orderConfirmation
type: io.kestra.plugin.fs.http.Request
description: Confirm the order and notify the customer
uri: http://order-service/confirm
formData:
orderId: "{{ inputs.orderId }}"
- id: arrangeShipping
type: io.kestra.plugin.fs.http.Request
description: Arrange shipping for the order
uri: http://shipping-service/arrange
formData:
orderId: "{{ inputs.orderId }}"
checks:
- type: BEFORE
condition: "{{ outputs.orderConfirmation.body.status == 'SUCCESS' }}"
description: Check stock before accepting payment
- type: AFTER
condition: "{{ outputs.arrangeShipping.body.status == 'SUCCESS' }}"
- id: updateDeliveryStatus
type: io.kestra.plugin.fs.http.Request
description: Update the delivery status of the order
uri: http://delivery-service/updateStatus
formData:
orderId: "{{ inputs.orderId }}"
taskDefaults:
- type: io.kestra.plugin.fs.http.Request
values:
contentType: multipart/form-data
method: POST
from kestra.
Related Issues (20)
- Log task ignores log level HOT 3
- Switching to last 365 days shows Invalid date
- Rootless Podman support on other Linux distributions (RHEL, e.g.) HOT 1
- Too much space on the Flows page HOT 7
- Replace the Flows Execution barchart with the barchart used on the main dashboard to include axis label, legend, description of color to state mapping
- Executions Indent
- Support for OpenTelemetry (via OTLP)
- Dashboard redirect, the back button does not work
- Dashboard Auto Refresh once turned on - can't be switched off HOT 1
- Trigger not filtering in flow overview
- Reevaluate link color in the tables on the new Dashboards
- The trigger toggle on the main dashboard has no effect HOT 1
- The dwh_and_analytics tutorial flow fails to load on develop -- Internal server error: HV000030: No validator could be found for constraint ‘jakarta.validation.constraints.NotEmpty’ HOT 3
- Standardize States display and color
- Add missing backend endpoints to add trend on the main Dashboard, then we can show the trend in the UI
- After changing state of a execution needs refresh
- Topology view modification overwrites the flow without Saving it
- Adjust the design for light mode docs HOT 1
- Add `parse_mode` option to `io.kestra.plugin.notifications.telegram.TelegramSend`
- Kestra dashboard not displaying results and charts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kestra.