M3-S1 — Composed automation: chains across modules, failures and announcements
Section titled “M3-S1 — Composed automation: chains across modules, failures and announcements”| Module | M3 — Advanced automation |
| After this session you can | Make one event in one module start dependable work in another, with failures reported and repeats harmless. |
| Time | Facilitated: 46 min · On your own: 46 min |
| Before you start | M2-S1: Employee Onboarding and Onboarding Checklists exist. The starter application of Layla Samir waits at Respond to job offer, with Hala Mansour as its contact person. Signed in as yourself; Hala Mansour in a private window. |
| Go deeper | Chain reactions · Execute Custom Action · Where it runs and who it acts as |
◆ Orientation (1 min) — When one event must start work elsewhere
Section titled “◆ Orientation (1 min) — When one event must start work elsewhere”In ACD you chained two reactions on one entity with Reaction Succeeded, chose Triggering Space and an Event Executor Type, and learned that the loop guard runs each action once per chain. Here the chain leaves its entity and its module. When a candidate signs (R-01), the starter’s reaction creates the employee; your chain must then start an onboarding checklist in IT’s module, report to HR if that fails, and never create two checklists for one hire.
▤ Concept (5 min) — Four ways to compose, and three rules
Section titled “▤ Concept (5 min) — Four ways to compose, and three rules”The four tools
Section titled “The four tools”| Tool | What it does | Use it for |
|---|---|---|
| Reaction Succeeded / Reaction Failed | Runs a reaction after another one succeeded, or after its action failed | A sequence, and the branch that handles a failure |
| Execute Custom Action | Calls a named Custom Action reaction: a Local action in the same module, or an External action in any module, passing Parameters | Making one specific thing happen in another module |
| Announce Event / On Event Announced | Broadcasts a named announcement; any number of reactions, on any entity, respond | Telling whoever is interested, now or later |
| Event Source Type Relation | Runs a reaction on this entity when the event happens on a related record | Reacting to a linked record’s change |
An external custom action is a small contract between two modules: the callee owns the action and its parameters; the caller decides when to call and what to pass. When Contextual is off, the action runs once, on no record, using its parameters. When it is on, the caller gives a Scope (Self, Relation, Expression or Pointer) that finds the record to run on; finding none is not an error, it simply does nothing. A UI action can only run from a button; another reaction cannot call it.
flowchart LR S["Sign contract<br/>(Hala)"] --> R4["Add a new employee<br/>(starter: creates the Employee)"] R4 -->|Reaction Succeeded| C["Call Start onboarding<br/>Execute Custom Action"] C -->|"parameters:<br/>name, email, start date"| X["Start onboarding<br/>(External action, IT's module)<br/>creates a checklist"] C -->|Reaction Succeeded| M["Mark onboarding started<br/>Onboarding started = on"] C -->|Reaction Failed| F["Onboarding call failed<br/>notify HR"]
What to notice: IT’s module does not know who calls Start onboarding, and HR’s module does not know how a checklist is built; the parameters are the whole contract.
Rule 1: every follow-up may run twice
Section titled “Rule 1: every follow-up may run twice”The platform may occasionally run a follow-up reaction twice for one run of the first, for example after a restart. A follow-up that creates something must therefore be harmless the second time. The usual pattern is a marker on the source record: the caller runs only while the marker is off (its Filter), and a further reaction turns the marker on after success.
Rule 2: the executor is a security decision
Section titled “Rule 2: the executor is a security decision”Event Executor Type decides whose authority the action uses. System has full rights; use it when the action must do something the triggering person may not do, such as creating a record in another team’s module, and keep such reactions few and named. Executor acts with the rights of the person whose action set it off, so their limits still apply. Manager acts as their manager. Never choose System just to make a permission error go away.
Rule 3: check that it ran
Section titled “Rule 3: check that it ran”A failed reaction shows no error to the person who set it off. Look on the Reactions tab (each reaction’s succeeded and failed counts), in Administration › Monitoring › Reaction Logs (every run, with each action’s input, output and error, for system administrators), or in a view whose Entry history shows Reaction history. A chained reaction must exist and be active before the first one runs, should use Triggering Space, and can use the first reaction’s data only for about ten minutes.
⛏ Lab (32 min) — The hire chain
Section titled “⛏ Lab (32 min) — The hire chain”Goal. When Hala Mansour records Layla Samir’s signature, an onboarding checklist for Layla appears in IT’s module, once, and HR is told if it cannot be created.
Before you start. Signed in as yourself.
The callee, in IT’s module
- Open Employee Onboarding › Onboarding Checklists › Reactions › New Reaction and select +. Name Start onboarding.
- Event Custom Action. Custom action level External action. Turn Contextual off.
- Turn on Parameters. Give the dialog a Dialog Name Onboarding details, set Fields Source to Inline Entity, and describe three fields here: Employee name (Text), Employee email (Text), Start date (Date).
- Action Type Create Data Entry in Onboarding Checklists. Fill Employee name, Employee email and Start date from the three parameters. Confirm.
The marker, on HR’s side
- Edit Job Application. In the Add employee block, add a Switch field Onboarding started. Save with Save and Save Changes. (A new optional field does not affect applications in progress.)
The caller and its two follow-ups
- Open Job Application › Reactions › New Reaction › +. Name Call Start onboarding. Event Reaction Succeeded, entity Job Application, reaction Add a new employee.
- Execution Spaces Triggering Space; Event Executor Type System (HR staff may not create records in IT’s module, and this one reaction must).
- Filter: Onboarding started is not true.
- Action Type Execute Custom Action. Under External Actions, pick Start onboarding. Under Parameters, bind Employee name to the field Full name, Employee email to Email, Start date to Available from. Confirm.
- Add Mark onboarding started: Event Reaction Succeeded of Call Start onboarding; Triggering Space; Action Type Update Data Entry, Choose update mode Self, Onboarding started Manual on. Confirm.
- Add Onboarding call failed: Event Reaction Failed of Call Start onboarding; Triggering Space; Action Type Send Notification to the group HR, title Onboarding did not start for {{name}}, with name mapped to Full name. Confirm.
Screenshot pending The Execute Custom Action settings of Call Start onboarding, with Start onboarding picked under External Actions and its three parameters bound to Full name, Email and Available from What to notice: the action lives in another module, and the only thing passed across is the three parameters; the hint confirms that a non-contextual action runs once with them.
Prove it
- As Hala Mansour, open Layla Samir’s application from the Inbox and select Sign contract. The application moves to Add employee.
- As yourself, open Administration › Monitoring › Reaction Logs and find the runs of Add a new employee, Call Start onboarding and Mark onboarding started, each succeeded.
- Open Onboarding Checklists: one checklist, Layla Samir, with her email and start date, status Open. Open her application: Onboarding started is on.
Screenshot pending Reaction Logs filtered to the Job Application entity, showing Add a new employee, Call Start onboarding and Mark onboarding started as succeeded runs What to notice: three runs in order, all succeeded, and no run of Onboarding call failed; the log is where you prove a chain, because nobody sees an error on screen.
Check.
- Start onboarding is an External action, not contextual, with three parameters, creating a checklist.
- Call Start onboarding runs on Reaction Succeeded of Add a new employee, as System, filtered on Onboarding started not true.
- Mark onboarding started and Onboarding call failed follow it on success and failure.
- One checklist exists for Layla Samir, and her application shows Onboarding started on.
- Reaction Logs shows the three succeeded runs.
Pass condition. One Sign contract produces exactly one onboarding checklist in IT’s module, the application is marked, and the chain’s runs are visible in Reaction Logs.
If something goes wrong
| What you see | What to do |
|---|---|
| Start onboarding is not offered under External Actions | Its Custom action level is not External action, or it is deactivated. |
| The checklist exists but is empty | A parameter is not bound in step 9, or the callee’s Create Data Entry does not use it. Parameters you leave unbound are passed empty. |
| Call Start onboarding never runs | It was created after Layla’s step was reached, or it names the wrong reaction, or it is not on Triggering Space. |
| HR got Onboarding did not start | Open the failed run in Reaction Logs and read the action’s error. |
| Two checklists for Layla | Mark onboarding started did not run, or the filter in step 8 is missing. Delete the extra checklist and check both. |
Model answer
The chain has four reactions in two modules. IT owns Start onboarding (External action, not contextual, three parameters, creates the checklist). HR owns the call (Call Start onboarding, Reaction Succeeded of Add a new employee, System, filtered on the marker), the success follow-up that sets the marker, and the failure follow-up that tells HR. System is used once, for the one action HR’s people may not do themselves. A second run of the call finds the marker on and does nothing, so a repeated run is harmless.
◇ Worked scenario (1 min) — Payroll wants to know too
Section titled “◇ Worked scenario (1 min) — Payroll wants to know too”Two weeks later, Finance asks that every hire also open a payroll setup task in their module, and the Facilities team says it may want a desk booking “at some point”. Decide before reading on.
Option A: a second external action call from Job Application, to Finance’s module. It works for Finance today. Facilities would need a third call later, and HR’s module would end up naming every team that cares about a hire.
Option B: an announcement. HR’s chain announces Candidate hired (Announce Event) once. Finance builds its own On Event Announced reaction; Facilities adds one when it is ready. HR’s module never changes again.
The decision. B, for the new listeners: they are several and not all known. Keep the onboarding call as it is, because IT’s action needs parameters and a failure branch that HR wants to hear about, and an announcer is never told whether anyone listened. The rule: one known listener that must succeed: call it; several or unknown listeners: announce.
✓ Practice (6 min) — Check your design
Section titled “✓ Practice (6 min) — Check your design”A reaction in the Projects module must recalculate a budget in the Finance module, passing the project’s amount. What do you build in Finance?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
A follow-up reaction creates an invoice when an order’s first reaction succeeds. Once in a while an order gets two invoices. What is the robust fix?
Check your answer
The correct answer is C. Open the explanation under each option to see why.
A builder sets a reaction’s executor to System because people kept getting permission errors when it updated a confidential field. What is the concern?
Check your answer
The correct answer is A. Open the explanation under each option to see why.
When a contract is signed, Legal, Finance and possibly Facilities each need to start their own work, and none of their results matter to the contracts team. Which design keeps the contracts module unchanged as teams join?
Check your answer
The correct answer is B. Open the explanation under each option to see why.
If the External action Start onboarding fails, the person who selected Sign contract sees an error message on the application.
Check your answer
The correct answer is B (False). Open the explanation under each option to see why.
↺ Recap (1 min) — Automation that crosses boundaries
Section titled “↺ Recap (1 min) — Automation that crosses boundaries”You built a chain that crosses modules through an external custom action, reports its own failure, cannot create a duplicate, and uses the System executor exactly once, on purpose. You know when an announcement is better.
Next. In M3-S2 you write the formulas the rest of the module relies on: calculated, locked and conditional fields.