Skip to content

How final actions work

After reading, you know when to build a final action, which kind to build, and what CAB takes care of.

Professional and Ultimate

A final action hands the results of an audience to your organization’s own logic: an Autolaunched Flow or an Apex class. Use one when a built-in action isn’t enough, for example to create tasks, update records, or call another system.

  • Flow. An active Autolaunched Flow without a trigger. You build it in Flow Builder, without code. CAB passes the results into a record collection variable and the other values into the Flow’s input variables. See Create a Flow final action.
  • Apex. A class that implements one of CAB’s final action interfaces. Use it for logic that needs code, such as callouts or complex processing. See Create an Apex final action.

A final action is set up once in CAB Settings, in three steps:

  1. Properties. The name users see, the Flow or Apex class, a description shown before the action runs, and optional settings such as a success message, a custom permission and the batch size.
  2. Object and fields. The audience object the logic is written for, and the fields of the results it reads.
  3. Inputs. The values the logic needs, with optional defaults that users can change when they run it.

Every setting is listed in Flow final actions. A new final action is active as soon as it’s saved.

A final action appears in the menu next to Add to Campaign on the results page when all of these are true:

  • it is active,
  • the audience has the same object as the final action,
  • the user has the custom permission, if the final action names one.

It can also run on a schedule. See Schedule an audience.

Up to the batch size, CAB runs a final action right away. Larger results continue in the background, in parts of the batch size each, and CAB notifies the user when it’s finished. A random subset or a test’s results reach the final action instead of all results. See How actions work.

For Apex, CAB offers two interfaces. With the managed interface, CAB handles the background processing and calls your class once per part. With the legacy interface, your class owns that processing. Outcomes can only be measured on Flows and on classes with the managed interface. See Apex final actions.

On a schedule, a final action can process only the people who joined since its last run. See How delta processing works.

  • Final action. A Flow or Apex class, set up in CAB, that runs on an audience’s results.
  • Input. A value the final action passes to the Flow or class, set by default or by the user who runs it.
  • Batch size. The number of records a final action handles in one go.