Generative AI Apex Actions

The following generative AI Apex actions are available in Customer Success Cloud. These actions use AI to generate content based on the records you provide. For more information about Apex actions, see the Salesforce Help.

Generative AI Apex Actions in Customer Success Cloud
Category Apex Action Apex Class Purpose
Success Plans Generate Success Plan from Opportunity ActionGenAiSuccessPlanFromOpp Generates a success plan summary, challenges, and risks from an opportunity using AI.
Success Plans Generate Objectives ActionGenAiGenerateObjectives Generates objectives for a success plan using AI.
Success Plans Generate Objective KPIs ActionGenerateObjectiveKPIs Generates AI-powered KPIs for objectives within a success plan.
Expansion Opportunities Identify Expansion Opportunities IdentifyExpansionOpportunitiesAction Identifies cross-sell expansion opportunities for a single account and creates work suggestions.

Inputs and Outputs for the Generate Success Plan from Opportunity Apex Action

The Generate Success Plan from Opportunity Apex action includes the following inputs and outputs.

Inputs

The Generate Success Plan from Opportunity Apex action has the following inputs.

Inputs for the Generate Success Plan from Opportunity Apex Action
Input Required or Optional Description
OpportunityId Required The ID of the opportunity to use as the source for generating the success plan summary, challenges, and risks.
Mode Optional Whether the generated success plan is saved or returned for verification. Set this input to Save to create the success plan from the opportunity, or to Verify to return the content as text without saving anything. The default is Verify. Unrecognized values cause an error and prevent generation or saving. In Save mode, the action returns an error if the opportunity is already associated with a success plan.
PlanName Optional The name to give the new success plan. This input is required in Save mode, because the generated content does not supply a name, and it is ignored in Verify mode.

Outputs

The Generate Success Plan from Opportunity Apex action returns a response object with the following properties. Which properties are populated depends on the Mode input, where Verify returns the generated content without saving it and Save creates the success plan and returns its ID.

Outputs for the Generate Success Plan from Opportunity Apex Action
Property Type Description
Summary String The AI-generated summary of the success plan. This property is populated only in Verify mode.
ChallengesAndRisks String The AI-generated challenges and risks identified from the opportunity. This property is populated only in Verify mode.
SuccessPlanId Id The ID of the success plan record that was created, with the generated summary, challenges, and risks in place. This property is populated only in Save mode.

Inputs and Outputs for the Generate Objectives Apex Action

The Generate Objectives Apex action includes the following inputs and outputs.

Inputs

The Generate Objectives Apex action has the following inputs.

Inputs for the Generate Objectives Apex Action
Input Required or Optional Description
SuccessPlanId Required The ID of the success plan to generate objective records for.
Mode Optional Whether the generated objectives are saved or returned for verification. Set this input to Save to create the objectives against the success plan, or to Verify to return them as text without saving anything. The default is Verify. Unrecognized values cause an error and prevent generation or saving.

Outputs

The Generate Objectives Apex action returns a response object with the following properties. Which properties are populated depends on the Mode input, where Verify returns the generated content without saving it and Save creates the objectives and returns their IDs.

Outputs for the Generate Objectives Apex Action
Property Type Description
Objectives String A JSON representation of the list of generated objective records. This property is populated only in Verify mode.
ObjectiveIds List<Id> The IDs of the objective records that were created. This property is populated only in Save mode, and it is empty when no objectives are needed.

Inputs and Outputs for the Generate Objective KPIs Apex Action

The Generate Objective KPIs Apex action includes the following inputs and outputs.

Inputs

The Generate Objective KPIs Apex action has the following inputs.

Inputs for the Generate Objective KPIs Apex Action
Input Required or Optional Description
ObjectiveIds Required The list of objective IDs for which to generate objective KPIs. You can specify up to ten objectives.
SuccessPlanId Required The ID of the success plan that contains the specified objective records.
Mode Optional Whether the generated objective KPIs are saved or returned for verification. Set this input to Save to create the objective KPIs against their objectives, or to Verify to return them as unsaved records without saving anything. The default is Verify. If an unrecognized value is supplied, the action sets IsSuccess to false and populates ErrorMessage with the reason.

Outputs

The Generate Objective KPIs Apex action returns a response object with the following properties. Which properties are populated depends on the Mode input, where Verify returns the generated records without saving them and Save creates the objective KPIs and returns their IDs.

Outputs for the Generate Objective KPIs Apex Action
Property Type Description
IsSuccess Boolean Indicates whether the action completed successfully.
GeneratedKPIs List (Collection of Objective KPI records) The AI-generated objective KPI records. This property is populated only in Verify mode, and the records are not saved.
GeneratedKPIIds List<Id> The IDs of the objective KPI records that were created. This property is populated only in Save mode.
ErrorMessage String The error message returned if the action does not complete successfully.

Inputs and Outputs for the Identify Expansion Opportunities Apex Action

The Identify Expansion Opportunities Apex action includes the following inputs and outputs. The enabled strategies run together in a single background job, so the action returns as soon as the job is enqueued. A notification is raised only when a work suggestion is created, so a frequent scheduled run doesn't produce empty notifications. The action doesn't return the work suggestions themselves. Review those in the Work Suggestions list on the account.

Inputs

The Identify Expansion Opportunities Apex action has the following inputs.

Inputs for the Identify Expansion Opportunities Apex Action
Input Required or Optional Description
AccountId Required The ID of the account to identify expansion opportunities for.
EventDescription Optional A description of the event driving the identification, used to determine which policy applies. If it's left empty, Customer Success Cloud builds a description from the account's industry, annual revenue, and billing country.
Strategies Optional The identification strategies to run, as a list of one or more of the following values: ProductNeedFit, Whitespace. If it's left empty, all strategies run, matching the record-page action. An unrecognized strategy name returns an error and creates no work suggestions.

Outputs

The Identify Expansion Opportunities Apex action returns a response object with the following properties.

Outputs for the Identify Expansion Opportunities Apex Action
Property Type Description
IsSuccess Boolean Indicates whether the identification completed successfully.
QueueableJobId String The ID of the background job that runs the expansion opportunity identification.
ErrorMessages String Any error messages generated while identifying expansion opportunities. Errors are returned to the flow rather than shown to a user.