nerdexam
Salesforce

PDI · Question #125

A Salesforce Administrator is creating a record-triggered flow. When certain criteria are met, the flow must call an Apex method to execute complex validation involving several types of objects. When

The correct answer is C. @InvocableMethod. To enable an Apex method to be called from a Salesforce Flow, it must be annotated with @InvocableMethod.

Submitted by krish.m· Apr 18, 2026Logic and Process Automation

Question

A Salesforce Administrator is creating a record-triggered flow. When certain criteria are met, the flow must call an Apex method to execute complex validation involving several types of objects. When creating the Apex method, which annotation should a developer use to ensure the method Can be used within the flow?

Options

  • A@future
  • B@RemoteAction
  • C@InvocableMethod
  • D@AuraEnaled

How the community answered

(50 responses)
  • A
    6% (3)
  • B
    2% (1)
  • C
    90% (45)
  • D
    2% (1)

Why each option

To enable an Apex method to be called from a Salesforce Flow, it must be annotated with `@InvocableMethod`.

A@future

`@future` methods execute asynchronously and are typically used for long-running operations that shouldn't block the main transaction, not for making a method callable from a flow directly.

B@RemoteAction

`@RemoteAction` is used for exposing Apex methods as JavaScript Remoting methods to be called from Visualforce pages, not for use within Flows.

C@InvocableMethodCorrect

The `@InvocableMethod` annotation exposes an Apex method as an invocable action, allowing it to be called directly from Salesforce Flows, Process Builders, and REST APIs. This annotation ensures the method can receive inputs from the flow and execute complex logic.

D@AuraEnaled

`@AuraEnabled` is used to expose Apex methods to Lightning web components or Aura components, not for direct invocation from Flows.

Concept tested: Invocable Apex methods for Salesforce Flows

Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_InvocableMethod.htm

Topics

#Apex Invocable Method#Salesforce Flow#Flow and Apex Integration#Apex Annotations

Community Discussion

No community discussion yet for this question.

Full PDI Practice