Create Agentforce Action
sf_create_agent_actionCreates an Agentforce Action (GenAiFunction) to expose an existing Flow or Apex class as a capability for an agent. Call once per flow or class, then link actions to the agent topic.
Instructions
Creates an Agentforce Action (GenAiFunction) — step 2 of the agent setup sequence. Call this once per capability (once per flow, once per Apex class). IMPORTANT by type: For Flow — the flow must already exist as an Active AutoLaunchedFlow (use sf_create_flow with flowType='AutoLaunchedFlow' and status='Active' first). For ApexClass — the class must already exist AND have @InvocableMethod (use sf_create_apex_class first). The 'reference' is the exact API name of the flow or class. After ALL actions are created, call sf_create_agent_topic (passing all action API names in 'actions' array), then sf_create_agent_planner. Do not stop between steps.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Action type: 'Flow' (AutoLaunchedFlow only — must be Active), 'ApexClass' (must have @InvocableMethod), 'PromptTemplate', etc. | |
| label | Yes | Action label | |
| inputs | No | Input parameter mappings | |
| agentName | No | Parent agent API name — optional and informational only, NOT written to the action XML. Safe to omit. | |
| reference | Yes | Exact API name of the resource to invoke. For Flow: the flow API name (e.g. 'Get_Account_Details'). For ApexClass: the class name (e.g. 'AccountHelper'). For PromptTemplate: the template API name. Must already exist in Salesforce. | |
| topicName | No | Parent topic API name — optional and informational only, NOT written to the action XML. Safe to omit. You must still pass this action's API name (actionName) in the 'actions' array when calling sf_create_agent_topic. | |
| actionName | Yes | Action API name. Letters, numbers, underscores. Remember this name — you must pass it in the 'actions' array when calling sf_create_agent_topic. | |
| description | Yes | What this action does — used by the AI to decide when to invoke it |