Automations
An automation rule makes something happen on its own: when a record is created, saved, reaches a value, is submitted or cancelled, or every day or hour; only when a condition holds; then create a record (one per table row if wanted), update the record or a linked one, run one of the record's actions, notify people, give a to-do, or call a webhook, with mapped values. Every hand-off between the four flows is a rule your company can switch on, change or replace.
To open: Administration › Automation › Automations (/palbon-trade-finance/automations). System Managers design rules; Trade Finance Managers may also manage them.
1. The shipped rules
| Rule | When | Does | Shipped |
|---|---|---|---|
| Draft a contract for each leg when a trade is confirmed | Trade status becomes Confirmed | Creates a Trade Contract per leg (legs without a contract) with the trade's and leg's terms, then fills it from its template; writes it back into the leg | Off |
| Draft a surveyor work order for each leg when a trade is confirmed | Trade status becomes Confirmed | Creates a Surveyor Work Order per leg, to the leg's surveyor | Off |
| Draft the purchase LC when a trade is confirmed | Trade status becomes Confirmed | Creates a draft import Letter of Credit for the purchase leg (LC payment terms, no credit yet): amount = price × quantity, the ports, latest shipment = laycan end | Off |
| Copy the sale LC's documents and conditions into its purchase LC | Sale credit status becomes Advised, with its back-to-back pair set | Copies the 46A and 47A tables into the purchase credit; stops the advice if the copy fails | Off |
| Create the voyage when a nomination is accepted | Nomination status becomes Accepted, no voyage yet | Creates the Voyage and writes it back into the nomination | Off |
| Prepare document instructions when an LC is issued or advised | Credit status becomes Issued or Advised | Creates the Document Instruction of the leg from the credit | Off |
| Tell the group ERP when a trade is confirmed | Trade status becomes Confirmed | Calls a webhook (set your ERP's address) | Off |
| Tell trade finance 3 days before a presentation deadline | Daily | Notifies Trade Finance Executives and Managers about live credits (Issued, Advised, Amended) whose presentation deadline is within 3 days: {lcnumber}: documents must be presented by {presentationdeadline} (copy it with 1 day for D-1) | On |
| Tell trade finance when a credit expires within 7 days | Daily | Notifies them about live or presented credits expiring within 7 days | On |
The list shows each rule with When a … …, its run count and Last run failed when it did. Switch on / Switch off from the list.
2. Make or change a rule
New rule (or open one). The editor has three parts.
2.1 When
| Setting | Use |
|---|---|
| Rule name, Description | For example Draft the contracts when a trade is confirmed |
| When a (record type) | The record that triggers it |
| Trigger | On Create, On Save, When Value Becomes (a field reaches a value), When Field Changes, On Submit, On Cancel, Daily, Hourly |
| Field, Becomes | For value triggers, for example status becomes Confirmed (also Workflow state) |
| Only when | Conditions on the record's fields (all or any). No rule: it runs on every matching event. Daily and hourly rules run over the records the condition selects, once per record each day (or hour) |
| Order | Which rule runs first when several fire together |
2.2 Then
| Action | Settings |
|---|---|
| Create Record | Record type to create; One for each row of a table (with Only the rows where); Keep the new record in a field of this record (or of the row) |
| Update This Record | The values below |
| Update Linked Record | Through the link field |
| Run Record Action | Action of the record (for example generate_mt700, propose_amendment, run_checks); the rule lists the actions allowed |
| Notify | Roles and Message with {field} placeholders, for example {lcnumber} must be presented by {presentationdeadline} |
| Create To-Do | Roles and message |
| Webhook | Webhook address: the record is posted as JSON |
| Then run on the new record | An action to run on a created record (for example fillfromtemplate) |
| Stop the save if the rule fails | Otherwise a failure is logged and the user's save goes ahead |
| Run Without The User's Permissions | Only a System Manager can set it; by default a rule runs with the permissions of the person whose action triggered it |
2.3 Values
Each row sets one field of the target:
| From | Value | Example |
|---|---|---|
| Field | A field of the record, or row.<field> of the table row |
commodity, row.price |
| Fixed Value | A constant | Draft |
| Template | Text with {field} placeholders |
{trade_title} - {row.leg_type} |
| Formula | Arithmetic on doc. and row. |
(row.price or 0) * (row.quantity or doc.quantity or 0) |
| Linked Field | link_field.field of a linked record |
company.company_name, load_port.port_name |
| Today, Now, Current User | – | |
| Copy Table | A table of the record copied whole | documents_required |
If empty keeps a value someone already entered.
3. Try before switching on
- Save the rule (off).
- Try on a record: choose a record. The app shows what the saved rule would do on it (The condition holds or The condition does not hold: nothing would happen, and the records and values it would create or change). Nothing is changed.
- Switch it on.
4. Safety
- A rule never repeats a step for the same record and row: a retry or a second save never makes a second contract or credit.
- Rules cannot loop: a rule triggered by another rule stops after three levels.
- Last runs on the rule, and Administration › Automation › Automation Run, show every run with its result and error.
- A failed rule never blocks the user's save unless it says Stop the save if the rule fails.