---
schema_version: "1"
id: 862851affad103d309d8cdc3f96db307a10eb3e517d5c3f8ae71ee24a9711bbc
title: Call Apex Code from a Process
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/process_action_apex.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.process_action_apex.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ea531025dcf9c16a46f88fa445e82ffe354fd76c0bc1d877886bea3ce22c8b7c
description: Add customized functionality to your process by calling Apex from the process.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Call Apex Code from a Process

Add customized functionality to your process by calling Apex from the process.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic (<a href="https://help.salesforce.com/s/articleView?id=xcloud.overview_edition_lex_only.htm&amp;language=en_US" target="_blank">not available in all orgs</a>) and Lightning Experience</td></tr><tr class="" id="process_action_apex__d5091e516"><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d260365e77">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="" id="process_action_apex__d5091e977">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d260365e77 ">To create, edit, or view processes:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d260365e77 ">
              <p>Manage Flow</p>
              <p>AND</p>
              <p style="margin-bottom:0;">View All Data</p>
            </td>

          </tr>
        </tbody>
      </table>

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_important.png)

Important Support and updates for Process Builder have ended as of December 31, 2025. This means that support won't be provided for any process and bugs in the Process Builder product won't be fixed. See [Workflow Rules & Process Builder End of Support](https://help.salesforce.com/s/articleView?id=001096524&type=1&language=en_US).

After December 31, 2025, existing processes continue to run, and you can activate, deactivate, and edit them; however, we recommend using Flow Builder. To migrate existing processes, plan your [switch to Flow Builder](https://help.salesforce.com/s/articleView?id=platform.flow_migrate_to_flow_learning_map.htm&release=264.0.0&type=5 "Flow Builder combines the capabilities of workflow rules and Process Builder in a single point-and-click tool, making it easier to create a triggered process. If you created triggered processes with workflow rules or Process Builder, use the Migrate to Flow tool to move them to Flow Builder. Start by migrating and testing in a sandbox environment before moving your new flows to production.") and use the [Migrate to Flow](https://help.salesforce.com/s/articleView?id=platform.flow_migrate_to_flow.htm&release=264.0.0&type=5 "Use the Migrate to Flow tool to convert your Process Builder processes and workflow rules into Flow Builder, including scheduled actions. The tool also supports partial migration of processes for most actions.") tool. For new automations, create flows in [Flow Builder](https://help.salesforce.com/s/articleView?id=platform.flow.htm&release=264.0.0&type=5 "Automation reduces repetitive work and helps your team complete tasks faster and more accurately. With Flow Builder, you can build simple or complex automations, forms, and guided experiences with no code. You can add forms to Salesforce pages and Experience sites, and launch flows using buttons, record triggers, or schedules.").

After you’ve created an action and selected “Apex” for the type, fill in the relevant fields to add the action to your process.

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_important.png)

Important To use this action in a process, ask your developer to annotate the appropriate method with `@InvocableMethod`. For details, see “`InvocableMethod` Annotation” in the Apex Developer Guide.

The Apex class and the process are executed by the user whose action triggered the process.

1. Enter a name for this action. This text appears on the canvas and helps you differentiate this action from others in your process. The name truncates to fit on the canvas.
2. Choose an Apex class by entering the name of the class to filter results or select a class from the dropdown list.
3. If the class includes an invocable variable, you can manually enter values or reference field values from a related record.
    
    The value must match the variable’s data type. You can set values for sObject and primitive type list variables only.
    
    - To set values for sObject variables and sObject list values, reference an object’s related records, for example, all child contact records associated with the Account object that started the process.
    - To set a value for a primitive list variable (String, Integer, Time, and so on), select the String value type and enter a value in the text input field. You can’t pass multiple values to lists.
4. Click **Save**.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_note.png)
    
    Note If you define an Apex action in your process and then modify the Apex class by adding a standard field reference (for example, User.Phone), the Apex action is no longer visible in the process and must be added again.