Execute Flow
Run an autolaunched Salesforce flow in the background from an Avonni component, without opening a dialog or leaving the page.
Overview
The Execute Flow interaction starts an autolaunched flow when a user interacts with a component on your Experience Site — clicking a button, a row action, a header action, an item in a list. Nothing opens on screen: the flow runs server-side, does its work (updating records, calculating a value, calling out to another system), and the page the user is on stays exactly where it is.
Configure it like any other interaction. Experience Builder has no Interactions tab, so the setting lives inside the editor for the event you're wiring up — a button's On Click, a row action's On Click, a column header action's On Click — where you select Execute Flow as the interaction Type.
Unlike those two interactions, the flow does not have to sit on a page of your site: Execute Flow starts it server-side, so no site page hosts it and nothing has to be published for it to be found.
Configuration
Flow API Name
The flow to run. The list offers the autolaunched flows in your org by their Label, not their API name, and can be searched. Set it first: the three settings below stay hidden until it is.
Flow Input Variables
The values passed into the flow before it starts, one entry per variable. See below.
On Finish
The interactions to run once the flow has finished successfully. Accepted interactions are Show Toast and Refresh All Queries.
On Error
The interactions to run if the flow fails. Accepted interactions are Show Toast and Refresh All Queries.
Flow Input Variables
Each entry maps one of the flow's input variables. The variable must be marked Available for input in Flow Builder, and its API name is case-sensitive.
Name: the flow variable to set. The list offers the input variables of the selected flow.
Value: the value to assign. What this input offers depends on the editor you are in. In a row or item editor — a Data Table row action, a list item, a tree grid column header action — you can choose Custom to type a static value, or pick one of the record fields the component supplies at that point, which inserts a
{{Record.<Field>}}token so each row or item passes its own value; those field options come from the component's Query data source. In the Button, Banner, Metric and header-action editors there is no record behind the click, so Value is a plain text input.Type: the data type of the value — Text (the default), Number, Boolean, Date, Date/Time or Salesforce Object. Choose Custom to enter a type that is not in the list.
Object API Name: the object the value represents, for example
AccountorContact. Requires Type to be Salesforce Object.Allow Multiple Values (collection): turn this on when the value is a collection rather than a single value.
Only Name and Value are sent to the flow. Type, Object API Name and Allow Multiple Values (collection) describe the value to the component so it can resolve the token before the call — they do not tell the flow anything, and they cannot fix a mismatch with how the variable is declared in Flow Builder.
On Finish and On Error
On Finish is where you tell the user what happened and bring the page up to date — a Show Toast confirming the action, a Refresh All Queries so the components on the page re-read the records the flow changed.
On Error covers the opposite case. If you configure no Show Toast there, the component shows its own error toast, titled "Error while executing the flow", pointing at the two usual causes: the flow is not active, or the user running it does not have access to it.
Example
A Data Table lists the cases a portal user has open, and you want a row action that hands the case to the support queue.
In Flow Builder, create an autolaunched flow — labelled
Escalate Case, API nameEscalate_Case— with a text input variablerecordIdmarked Available for input, an Update Records element that sets the case's status and queue, then save and activate it.In Experience Builder, select the Data Table and map a column with Type set to Action. Under Row Actions, add an entry with a Label of
Escalateand a Name ofescalate.In that action's On Click, set Type to Execute Flow and pick Escalate Case in Flow API Name — the list shows each flow's Label.
Under Flow Input Variables, add one entry: Name
recordId, Value Record: Case ID, Type Text. The Value options are named after the field labels of the table's query.Under On Finish, add a Show Toast ("Case escalated") and a Refresh All Queries so the table reloads with the new status.
Clicking Escalate on a row now runs the flow for that case, with no dialog in the way.
Troubleshooting
The Name list under Flow Input Variables is empty. The flow is not active. Flow API Name lists inactive flows alongside active ones, but the input variables are read from the flow's active version — an inactive flow has none, so there is nothing to offer. Activate the flow in Flow Builder, then reopen the editor.
Nothing happens when I try the interaction in the builder or in site preview. That is expected: Execute Flow is skipped there and a toast says so. Publish the site and try it as a site user.
The flow runs for me but not for site users. Check that the site's guest or portal user profile has access to the flow itself and to the records it reads and writes.
Important Considerations
The flow must be active. An inactive flow fails when a site user triggers it, with nothing to warn you in the builder.
Site users need access to the flow and to the records it touches. A flow that runs for you as an admin can still fail for a guest or portal user.
Variable names must match exactly between the flow and the interaction, including case.
No output variables. In Experience Sites the interaction does not read values back out of the flow. Pick up what the flow changed with a Refresh All Queries in On Finish instead.
Last updated
Was this helpful?
