Process Automation and Logic28% of the exam

Combining Flow and Apex for business logic

How to expose Apex to Flow with @InvocableMethod and @InvocableVariable, why invocable actions take and return lists that line up with the flow's interviews, how flows start from Apex, and where to draw the line between the flow and the code.

Official exam objective
Given a scenario, use declarative functionality and Apex together to automate business logic.

~7 min read · 7 practice questions ·

What the exam expects

  • Make Apex available to Flow Builder as an Apex action with @InvocableMethod, and pass structured inputs and outputs with @InvocableVariable.
  • Apply the invocable rules: static, public or global, one per class, one list parameter, a list result that matches the inputs in size and order.
  • Predict how a record-triggered flow calls an Apex action for 200 records, and which limits the action shares.
  • Start a flow from Apex with the Flow.Interview class.
  • Given a scenario, decide which part of the logic stays in the flow and which moves to Apex.

Key terms: invocable method (an Apex method annotated @InvocableMethod that runs as an action); Apex action (the Action element in Flow Builder that calls it); invocable variable (a field of a request or response class annotated @InvocableVariable); flow interview (one running instance of a flow); bulkification (grouping many interviews' work into one operation).

Key facts

Method modifiers
Detail
static, and public or global; outer class only
Per class
Detail
Only one @InvocableMethod
Other annotations
Detail
Only @Deprecated can accompany @InvocableMethod
Parameters
Detail
At most one, and it is a list or a list of lists
Outputs
Detail
Same size and order as the inputs
Running user
Detail
Needs access to the Apex class via profile or permission set
Invocable variables
Detail
public or global members; required defaults to false; name matches the flow, case-sensitive
Process.Plugin
Detail
Legacy; no bulk operations; @InvocableMethod recommended
Limit hit by one interview
Detail
All interviews in the transaction fail and roll back
Interview.start() limits
Detail
Shared with the other operations in the transaction
Sources for this section (5)
  • Why must an invocable method return its results in the same order as its inputs?
  • When do you need `@InvocableVariable`?
  • What happens to the other interviews when one interview in a bulk flow transaction hits a governor limit?
  • Why does a subscriber org's Flow Builder not show a public invocable method from a managed package?

The questions are free to read. Answers with their sources and self-grading are included with the pack.

Keep reading with the Platform Developer pack

  • Core concepts
  • Exam traps
  • Worked scenario

The pack includes:

  • All 21 lessons of the Platform Developer guide, with reading progress
  • Interactive decision walks and step-by-step sequence steppers
  • Inline practice questions and one-click topic practice (7 questions for this lesson)
  • An official source cited for every claim
  • An AI tutor that answers from the guide
  • Unlimited timed practice exams

Practice for the Platform Developer exam