github.com/argoproj/argo-events@v1.9.1/docs/tutorials/07-policy.md (about) 1 # Policy 2 3 A policy for a trigger determines whether the trigger resulted in success or failure. 4 5 Currently, Argo Events supports 2 types of policies: 6 7 1. Policy based on the K8s resource labels. 8 2. Policy based on the response status for triggers like HTTP request, AWS Lambda, etc. 9 10 ## Resource Labels Policy 11 12 This type of policy determines whether trigger completed successfully based on the labels 13 set on the trigger resource. 14 15 Consider a sensor which has an Argo workflow as the trigger. When 16 an Argo workflow completes successfully, the workflow controller sets a label on the resource as `workflows.argoproj.io/completed: 'true'`. 17 So, in order for sensor to determine whether the trigger workflow completed successfully, 18 you just need to set the policy labels as `workflows.argoproj.io/completed: 'true'` under trigger template. 19 20 In addition to labels, you can also define a `backoff` and option to error out if sensor 21 is unable to determine status of the trigger after the backoff completes. Check out the specification of 22 resource labels policy [here](https://github.com/argoproj/argo-events/blob/master/api/sensor.md#k8sresourcepolicy). 23 24 ## Status Policy 25 26 For triggers like HTTP request or AWS Lambda, you can apply the `Status Policy` to determine the trigger status. 27 The Status Policy supports list of expected response statuses. If the status of the HTTP request or Lambda is within 28 the statuses defined in the policy, then the trigger is considered successful. 29 30 Complete specification is available [here](https://github.com/argoproj/argo-events/blob/master/api/sensor.md#statuspolicy).