Execute Action – running another action¶
The command "Execute Action" runs another action on the current record and waits until it is done. Use it to split a long action into named parts and to reuse steps in several actions. This page is for administrators who build actions.
1. At a glance¶
| Purpose | Run a stored action as one step of this action |
| Typical use | Reusable steps ("Send confirmation"), keeping long actions readable, choosing an action at runtime |
| Where in the editor | Toolbar menu "Flow" → "Execute Action" |
| Needs a user interface | No (the called action may) |
| Needs a current record | No – the called action gets the current record if there is one |
| Related | Action variables, Switch |
2. Settings¶
The settings are on the tab "General", below "Display Name", "Description" and "Execution Condition" (see Actions), and on the tab "Arguments".
| Setting | Meaning | Default / Required |
|---|---|---|
| "Reference Type" | "Default": a fixed action. "Expression": the action is determined at runtime. | Default |
| "Action" | The action to run (with "Default") | Required with "Default" |
| "Action Ref" | Expression that returns the action to run (with "Expression"): its id or its "Name" | Required with "Expression" |
The tab "Arguments" (only with "Default") lists the values handed to the called action. Each entry has:
| Part | Meaning |
|---|---|
| "Argument" | An input parameter of the called action (see Action variables) |
| "Value" | Expression for the value, evaluated in this action against the current record |
3. Behaviour¶
- The action to run is determined. With "Expression", the result is tried as an id first, then as the "Name" of an action; if several actions have that name, an action of the current record's entity wins over one without entity. If no action is found, this action ends (without an error).
- The execution condition of the called action is checked against the current record. If it is false, a user in the browser sees its error message and this action ends.
- The called action receives:
- the current record – the same record object, including unsaved changes;
- the arguments, evaluated now;
- the special variables of this action (mail data, iteration counters, …). It does not see the other variables of this action.
- The called action runs completely, including its pre and post commands. This action waits.
- If the called action ran to completion, its output parameters are handed back. In the expression
editors of this action they appear as
<Action>.<Variable>. If this action had no current record and the called action ended on one, that record becomes the current record. - If the called action ended early or failed, this action ends the same way.
The loop protection applies: an action that would run nested within itself more often than its "Max Recursion Depth" allows is not started, and this action ends with an error (see Actions).
4. Examples¶
Reusable confirmation mail. The action "Send order confirmation" (entity "Order") has the input parameter "Recipient" and sends a mail. Two actions call it:
| Calling action | "Argument" | "Value" |
|---|---|---|
| "Confirm order" (button) | Recipient | field "Customer e-mail" |
| "Resend confirmation" (app bar) | Recipient | the variable "Alternative address" from a popup |
Result of a calculation. The action "Compute discount" has the output parameter "Discount". After Execute Action, an Update Entity Record sets the field "Discount" to the variable "Compute discount.Discount".
Action chosen by data. "Reference Type" "Expression", "Action Ref" = the field "Follow-up action" of a process step, which holds the "Name" of an action.
5. Limitations¶
- With "Expression", the tab "Arguments" is not shown – an action chosen at runtime cannot receive arguments, only the special variables.
- The called action works on the same record object. If it changes the current record with Go To Record or Create Entity Record, this action still continues on its own current record afterwards.
- Output parameters are only offered in the editor for actions selected with "Default".