Who this is for. Anyone whose job writes records of the kind it listens to, or calls the site's own API. Afterwards you can say whether a job can loop, and you have a guard to put on every job that might.
Which writes start jobs
Whether a write raises an entity event depends on where it runs, not on which action made it:
| The write is made by | Raises entity events? |
|---|---|
| An asynchronous job, or a loop element running in the background | No. Background workers do not raise entity events |
| A synchronous job, which runs inside the web request that started it | Yes |
Any job, through an HTTP Request to the site's own API (/cdna-api/…) | Yes: the API call is a web request like any other |
| The platform's own background events: abandoned carts, back in stock, scheduled publishing | Always, whoever wrote the record |
So an asynchronous job with an Update Record action cannot start itself through the record it writes. That is platform behaviour rather than a promise, and a job changed to synchronous, or rewritten to use the API, inherits the loop. Guard every job that writes the kind of record it listens to.
The four loops that actually happen
- A job writes through the site's API. An Updated trigger on orders, and an HTTP Request that changes the order with
PUT /cdna-api/orders/order/{id}. The PUT raises Updated, which runs the job again. The worked integration has exactly this shape, and its first condition is the guard. - A synchronous web-event job writes records that another job listens to, and that job calls the web event.
- Two jobs trigger each other with Trigger job actions. Pass a depth in the event data and stop at a limit (Chaining one job to another).
- A job calls its own web event URL with an HTTP Request.
The symptom is the same each time: Batch Logs fills with runs of one job, a few seconds apart, for the same record (A job is triggering itself in a loop). Unpublish the job to stop it, then add the guard.
The guard: carry on only when the watched field changed
Put the field the job reacts to under the trigger's Pre-Event properties, and make the first action a template condition that carries on only when that field's value is different from before. Then make sure the job never writes that field. Its own write then changes other fields only, the second run finds the watched field unchanged, and stops. With {financialStatus} as the Pre-Event property: