Motivating custom events
Imagine you are running an e-commerce platform and you want to trigger a deployment when a customer completes an order. There might be a number of events that occur during an order on your platform, for example:order.createdorder.item.addedorder.payment-method.confirmedorder.shipping-method.addedorder.complete
expectanorder.completeeventafteranorder.createdevent- evaluate these conditions
for_eachuser id
user_id as a parameter to the deployment.
Define the trigger
Here’s how this looks in code:post_order_deployment.py
Simulate events
To simulate users causing order status events, run the following in a Python shell or script:simulate_events.py
user_id_1creates and then completes an order, triggering a run of our deployment.user_id_2creates an order, but no completed event is emitted so no deployment is triggered.