---
schema_version: "1"
id: 39b39c31e9273ac0fb4aa2911e172f631bd5ff3cb9be42536aeab59b8e52b23d
title: Action Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_Invocable_Action.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 65099e03f833d10390b59e086fb8e3d837e82d695c75f9194a486a851c9356ce
description: Contains methods to create, update, and retrieve information about invocable actions.Creates an empty invocation in preparation for calling an invocable action. After you create the invocation, you can add parameters to the invocation.Clears the existing invocations from the action.Creates a copy of the Invocable.Action.Creates a wrapper for the specified version of a custom invocable action in a specified package namespace.Creates a wrapper for a custom invocable action in a specified package namespace.Creates a wrapper for a custom invocable action.Creates a wrapper for a standard invocable action.Creates a wrapper for a standard invocable action.Gets metadata related to an invocable action.Gets the name of an invocable action.Gets the namespace of a custom invocable action.Gets the type of an invocable action.Gets the version of an invocable action.Invokes an invocable action from Apex code.Determines whether an invocable action is a standard invocable action.Sets a value for an invocable action parameter.Initializes the invocations for an action from a pre-existing list of invocations.
---
# Action Class

Contains methods to create, update, and retrieve information about invocable actions.

## Namespace

[Invocable](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Invocable.htm "The Invocable namespace provides classes for calling invocable actions from Apex.")

## Usage

The getDescribe() method returns detailed metadata about an invocable action, including its inputs, outputs, and configuration. Because this method retrieves comprehensive describe information, it can have performance implications. Use getDescribe() judiciously, especially in performance-sensitive contexts such as loops or frequently executed code paths.

When calling createStandardAction() or createCustomAction(), the version parameter is optional. If you don't specify a version, the base version of the action is used.

## Example

// Create an action and get its metadata
Invocable.Action action = Invocable.Action.createStandardAction('someActionName');
List<Invocable.Action.DescribeResult> describeResults = action.getDescribe();

for (Invocable.Action.DescribeResult dr : describeResults) {
    System.debug('Action Name: ' + dr.getName());
    System.debug('Action Label: ' + dr.getLabel());
    System.debug('Description: ' + dr.getDescription());
    System.debug('Has Callout: ' + dr.getHasCallout());

    // Access input parameters
    if (dr.getInputs() != null) {
        for (Invocable.Action.InputParameter input : dr.getInputs()) {
            System.debug('Input: ' + input.getName() + ' (' + input.getType() + ')');
            System.debug('Required: ' + input.getRequired());
            System.debug('Description: ' + input.getDescription());
        }
    }

    // Access output parameters
    if (dr.getOutputs() != null) {
        for (Invocable.Action.OutputParameter output : dr.getOutputs()) {
            System.debug('Output: ' + output.getName() + ' (' + output.getType() + ')');
        }
    }
}

- **[Action Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_methods)**

#### See Also

- [_Apex Developer Guide_: InvocableMethod Annotation](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/apex_classes_annotation_InvocableMethod.htm "Apex Developer Guide: InvocableMethod Annotation - HTML (New Window)")
- [_Salesforce Help_: Launch a Flow from Apex](https://help.salesforce.com/s/articleView?id=platform.flow_distribute_system_apex_invoke_a_flow_from_apex.htm&language=en_US "Salesforce Help: Launch a Flow from Apex - HTML (New Window)")

## Action Methods

These methods are for Action.

- **[addInvocation()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_addInvocation)**  
    Creates an empty invocation in preparation for calling an invocable action. After you create the invocation, you can add parameters to the invocation.
- **[clearInvocations()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_clearInvocations)**  
    Clears the existing invocations from the action.
- **[clone()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_clone)**  
    Creates a copy of the Invocable.Action.
- **[createCustomAction(type, namespace, name, version)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_createCustomAction)**  
    Creates a wrapper for the specified version of a custom invocable action in a specified package namespace.
- **[createCustomAction(type, namespace, name)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#unique_1380094124)**  
    Creates a wrapper for a custom invocable action in a specified package namespace.
- **[createCustomAction(type, name)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_createCustomAction_2)**  
    Creates a wrapper for a custom invocable action.
- **[createStandardAction(type, version)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_createStandardAction_2)**  
    Creates a wrapper for a standard invocable action.
- **[createStandardAction(type)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_createStandardAction)**  
    Creates a wrapper for a standard invocable action.
- **[getDescribe()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_getDescribe)**  
    Gets metadata related to an invocable action.
- **[getName()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_getName)**  
    Gets the name of an invocable action.
- **[getNamespace()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_getNamespace)**  
    Gets the namespace of a custom invocable action.
- **[getType()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_getType)**  
    Gets the type of an invocable action.
- **[getVersion()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_getVersion)**  
    Gets the version of an invocable action.
- **[invoke()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_invoke)**  
    Invokes an invocable action from Apex code.
- **[isStandard()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_isStandard)**  
    Determines whether an invocable action is a standard invocable action.
- **[setInvocationParameter(parameterName, parameterValue)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_setInvocationParameter)**  
    Sets a value for an invocable action parameter.
- **[setInvocations(invocations)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action.htm#apex_Invocable_Action_setInvocations)**  
    Initializes the invocations for an action from a pre-existing list of invocations.

### addInvocation()

Creates an empty invocation in preparation for calling an invocable action. After you create the invocation, you can add parameters to the invocation.

#### Signature

public Invocable.Action addInvocation()

#### Return Value

Type: [Invocable.Action](#apex_class_Invocable_Action "Contains methods to create, update, and retrieve information about invocable actions.")

### clearInvocations()

Clears the existing invocations from the action.

#### Signature

public Invocable.Action clearInvocations()

#### Return Value

Type: [Invocable.Action](#apex_class_Invocable_Action "Contains methods to create, update, and retrieve information about invocable actions.")

### clone()

Creates a copy of the Invocable.Action.

#### Signature

public Object clone()

#### Return Value

Type: Object

### createCustomAction(type, namespace, name, version)

Creates a wrapper for the specified version of a custom invocable action in a specified package namespace.

#### Signature

public static Invocable.Action createCustomAction(String type, String namespace, String name, String version)

#### Parameters

- **type**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Type of invocable action.
- **namespace**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Namespace where the invocable action is located.
- **name**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Name for the custom invocable action.
- **version**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Version of the invocable action.

#### Return Value

Type: [Invocable.Action](#apex_class_Invocable_Action "Contains methods to create, update, and retrieve information about invocable actions.")

### createCustomAction(type, namespace, name)

Creates a wrapper for a custom invocable action in a specified package namespace.

#### Signature

public static Invocable.Action createCustomAction(String type, String namespace, String name)

#### Parameters

- **type**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Type of invocable action.
- **namespace**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Namespace where the invocable action is located.
- **name**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Name
    
    for the custom invocable action.

#### Return Value

Type: [Invocable.Action](#apex_class_Invocable_Action "Contains methods to create, update, and retrieve information about invocable actions.")

### createCustomAction(type, name)

Creates a wrapper for a custom invocable action.

#### Signature

public static Invocable.Action createCustomAction(String type, String name)

#### Parameters

- **type**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Type of invocable action.
- **name**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Name
    
    for the custom invocable action.

#### Return Value

Type: [Invocable.Action](#apex_class_Invocable_Action "Contains methods to create, update, and retrieve information about invocable actions.")

### createStandardAction(type, version)

Creates a wrapper for a standard invocable action.

#### Signature

public static Invocable.Action createStandardAction(String type, String version)

#### Parameters

- **type**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Type of invocable action.
- **version**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Version of the invocable action.

#### Return Value

Type: [Invocable.Action](#apex_class_Invocable_Action "Contains methods to create, update, and retrieve information about invocable actions.")

### createStandardAction(type)

Creates a wrapper for a standard invocable action.

#### Signature

public static Invocable.Action createStandardAction(String type)

#### Parameters

- **type**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Type of invocable action.

#### Return Value

Type: [Invocable.Action](#apex_class_Invocable_Action "Contains methods to create, update, and retrieve information about invocable actions.")

### getDescribe()

Gets metadata related to an invocable action.

#### Signature

public List<Invocable.Action.DescribeResult> getDescribe()

#### Return Value

Type: [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list "Contains methods for the List collection type.")<[Invocable.Action.DescribeResult](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action_DescribeResult.htm#apex_class_Invocable_Action_DescribeResult "Contains methods to get metadata about invocable actions.")\>

### getName()

Gets the name of an invocable action.

#### Signature

public String getName()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

Name of the invocable action.

### getNamespace()

Gets the namespace of a custom invocable action.

#### Signature

public String getNamespace()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

Namespace of the custom invocable action.

### getType()

Gets the type of an invocable action.

#### Signature

public String getType()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

Type of invocable action.

### getVersion()

Gets the version of an invocable action.

#### Signature

public String getVersion()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

Version of the invocable action.

### invoke()

Invokes an invocable action from Apex code.

#### Signature

public List<Invocable.Action.Result> invoke()

#### Return Value

Type: List<[Invocable.Action.Result](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Invocable_Action_Result.htm#apex_class_Invocable_Action_Result "Contains methods to retrieve results from invocable actions called from Apex code.")\>

### isStandard()

Determines whether an invocable action is a standard invocable action.

#### Signature

public Boolean isStandard()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")

This method returns true if the invocable action is a standard invocable action.

### setInvocationParameter(parameterName, parameterValue)

Sets a value for an invocable action parameter.

#### Signature

public Invocable.Action setInvocationParameter(String parameterName, Object parameterValue)

#### Parameters

- **parameterName**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    Name of the invocable action parameter to set.
- **parameterValue**:
    
    Type: Object
    
    Value to set the invocable action parameter to.

#### Return Value

Type: [Invocable.Action](#apex_class_Invocable_Action "Contains methods to create, update, and retrieve information about invocable actions.")

### setInvocations(invocations)

Initializes the invocations for an action from a pre-existing list of invocations.

#### Signature

public Invocable.Action setInvocations(List<Map<String,ANY>> invocations)

#### Parameters

- **invocations**:
    
    Type: [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list "Contains methods for the List collection type.")<[Map](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_map.htm#apex_methods_system_map "Contains methods for the Map collection type.")<[String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type."),ANY>>
    
    List of invocations for the invocable action.

#### Return Value

Type: [Invocable.Action](#apex_class_Invocable_Action "Contains methods to create, update, and retrieve information about invocable actions.")