Based on my testing, sensor triggers are invoked one by one without waiting for the response. Is there a way to make sensor triggers to wait for one trigger to complete before invoking the next trigger ?
Example sensor:
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: create-resource
spec:
template:
serviceAccountName: argo-events-controller-manager
dependencies:
- name: event
eventSourceName: kafka
eventName: create-resource
triggers:
- template:
name: create-user-if-not-exists
http:
url: "https://reqres.in/api/users?delay=20"
method: POST
retryStrategy:
steps: 3
duration: 3s
policy:
status:
allow:
- 200
- template:
name: delete-resource-if-exists
http:
url: "https://reqres.in/api/users?delay=10"
method: DELETE
retryStrategy:
steps: 3
duration: 3s
policy:
status:
allow:
- 204
- template:
name: create-resource
http:
url: "https://reqres.in/api/users?delay=3"
method: POST
payload:
- src:
dependencyName: event
dataKey: body
useRawData: true
dest: event
retryStrategy:
steps: 3
duration: 3s
policy:
status:
allow:
- 201
- 202
- The above example uses a live testing REST API which mimics a delay in response. So it should be easy to replicate this scenario.
- We trigger 3 REST API calls.
- create-user-if-not-exists - this takes 20 seconds
- delete-resource-if-exists - this takes 10 seconds
- create-resource - this takes 3 seconds
Expectation :
- after create-user-if-not-exists succeeds, delete-resource-if-exists.
- after delete-resource-if-exists succeeds, create-resource
- If first call fails, the trigger should stop and not run other triggers.
Current behaviour:
- All triggers are fired one after other without waiting for response
- if first trigger fails, still other triggers gets fired. There is no control to stop other triggers or make them wait for the completion of previous trigger.
Is there any way to enforce the order in which triggers gets executed and make the triggers wait (depend on) other trigger ?
Calling argo-workflow or other workflow systems from argo-events just for satisfying this need feels heavy.