Best practices, error handling strategies, and advanced tips for effectively using Agentforce Context Protocol (ACP) backed Invocable Actions in Salesforce Flows.
success
boolean output parameter (highly recommended), always check its value using a Decision element immediately after the Action.
errorMessage
string output when success
is false. Log this message or display it to a user if appropriate.{!$Flow.FaultMessage}
global variable to get details about the error.ACP_Error_Log__c
) with details like Flow name, Action name, input parameters (be mindful of sensitive data), and the error message.@AuraEnabled
constructor and @AuraEnabled
public members for Flow compatibility.List
of inputs and perform operations in bulk.
sendMessage(String channelId, String messageText)
, use sendMessages(List<MessageRequest> requests)
, where MessageRequest
is an Apex class holding channelId
and messageText
.@InvocableMethod(label='...')
annotation, use a clear, descriptive label that indicates the system and the action (e.g., “ACP Slack: Send Message”, “ACP Jira: Create Issue”). This label appears in Flow Builder.slackChannelIdInput
, jiraIssueCreationResponse
).