Salta ai contenuti
Vai al contenuto

Object event trigger

An object event trigger reacts to Dolibarr hooks when a record is created, updated, or deleted. It is the real-time counterpart to Cron for ERP data.

⚡ Configuration

  1. Add an Object event trigger node at the top of the workflow.
  2. Pick the Dolibarr object (invoice, third party, order, etc.).
  3. Select verbs: create, update, delete (one or more).
  4. Activate the workflow.

Run context typically includes ID, event type, and a useful field snapshot.

⚡ Concrete examples

ScenarioObjectVerbDownstream
Welcome new third partyThird partycreateEmail welcome
Invoice validatedCustomer invoiceupdate (validated status)HTTP to warehouse
Order archivedOrderupdateLogic + internal notice
CleanupProductdeleteLogic audit (no blind cascade)

Use Logic If to filter a field (e.g. status == validated) and skip useless runs.

⚡ Performance

An object event on a very busy object (stock line, agenda) can spawn thousands of runs. Mitigations:

  • filter early with Logic;
  • batch via Cron + queue if immediate latency is not required;
  • disable the workflow during bulk Dolibarr imports.

⚡ Multi-entity and rights

The event respects the record’s entity. The run uses hook context rights; ensure a limited user cannot trigger admin actions through Knot.

⚡ Idempotency

A Dolibarr update may fire multiple times (computed field, third-party trigger). Design for duplicates:

  • stable business key;
  • Get + compare before Email or HTTP POST.

Next steps