Apex Actions for AI Agents

The following Apex actions are available for use with AI agents.

Note:

The Start Project Tasks, Complete Project Tasks, Create Assignment and Assign Resource, Find Assignments for Resource, Split Assignment to Assignment, Split Assignment to Resource Request, and Swap Resource on Assignment actions are supported for Salesforce Flow. The other actions are not supported for Salesforce Flow.

Assignment Apex Actions

Assignment Apex Actions
Apex Action Apex Class Purpose
Create Assignment and Assign Resource CreateAssignmentAndAssignResourceAction Creates an assignment by assigning the specified resource to the specified resource request.
Find Assignments for Resource FindAssignmentsForResourceAction Returns a resource's assignments within an optional date range and billable status.
Split Assignment to Assignment SplitAssignmentToAssignmentAction Splits an assignment into two assignments, assigning the new segment to a different resource.
Split Assignment to Resource Request SplitAssignmentToResourceRequestAction Splits an assignment into a new resource request starting on a specified date.
Swap Resource on Assignment SwapResourceOnAssignmentAction Swaps the resource assigned to an assignment.
Search Resources for Record SearchResourcesForRecordAction Returns the resources that match a resource request or assignment record.

Timecard and Project Task Apex Actions

Timecard and Project Task Apex Actions
Apex Action Apex Class Purpose
Create Plan for Assignment Reallocation pse_AssignmentReallocationPlanAction Creates a plan to reallocate assignments from a user's request.
Execute Plan pse_PlanExecutionAction Executes a smart action plan. This works in conjunction with any action that creates a plan.
Suggest Timecards SuggestTimecardsAction Returns a resource's scheduled assignments, and optional scheduled hours, so an AI agent can suggest which assignments to log time against. This action does not create timecards.
Save Timecards SaveTimecardsAction Creates or updates a resource's weekly timecards from an AI agent.
Submit Timecards SubmitTimecardsAction Submits a resource's weekly timecards for approval from an AI agent.
Start Project Tasks StartProjectTasksAction Marks a set of project tasks as started. All task IDs are validated and started together as a single all-or-none batch.
Complete Project Tasks CompleteProjectTasksAction Marks a set of project tasks as completed. All task IDs are validated and completed together as a single all-or-none batch.

Inputs and Outputs for the Create Plan for Assignment Reallocation Apex Action

The Create Plan for Assignment Reallocation Apex action includes the following inputs and outputs.

Inputs

The Create Plan for Assignment Reallocation Apex action has the following inputs for each plan passed to it.

Inputs for Create Plan for Assignment Reallocation Apex Action
Input Required or Optional Description
Utterance Required The natural language request provided by the user that the plan is created from.

Outputs

The Create Plan for Assignment Reallocation Apex action has the following outputs for each plan passed to it.

Outputs for Create Plan for Assignment Reallocation Apex Action
Output Description
Data Rendering A JSON string that represents how data is rendered for the user.
Error Details Details of any errors creating the plan, if any arise.
Smart Action Plan Summary The summary of the smart action plan.
Smart Action Plan ID The ID of the smart action plan record that relates to the request.

Inputs and Outputs for the Execute Plan Apex Action

The Execute Plan Apex action includes the following inputs and outputs.

Inputs

The Execute Plan Apex action has the following inputs for each plan passed to it.

Inputs for Execute Plan Apex Action
Input Required or Optional Description
Additional Required Input Optional Natural language input to provide any additional information that is required to continue with the plan execution.
Plan ID or Name Required The ID or name of the plan to execute.

Outputs

The Create Plan for Assignment Reallocation Apex action has the following outputs for each plan passed to it.

Outputs for Execute Plan Apex Action
Output Description
Data Rendering A JSON string that represents how data is rendered for the user.
Error Details Details of any errors creating the plan, if any arise.
Execution Summary The summary of the plan execution.
Result Data A JSON string that represents output data from the execution.