@salesforce/afv-skills 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/package.json +6 -5
  2. package/skills/accessing-webapp-data/SKILL.md +178 -0
  3. package/skills/agentforce-development/SKILL.md +427 -0
  4. package/skills/agentforce-development/assets/README-legacy.md +89 -0
  5. package/skills/agentforce-development/assets/agent-spec-template.md +90 -0
  6. package/skills/agentforce-development/assets/agents/README.md +45 -0
  7. package/skills/agentforce-development/assets/agents/hello-world.agent +60 -0
  8. package/skills/agentforce-development/assets/agents/multi-topic.agent +105 -0
  9. package/skills/agentforce-development/assets/agents/production-faq.agent +101 -0
  10. package/skills/agentforce-development/assets/agents/production-faq.bundle-meta.xml +4 -0
  11. package/skills/agentforce-development/assets/agents/simple-qa.agent +72 -0
  12. package/skills/agentforce-development/assets/apex/models-api-queueable.cls +225 -0
  13. package/skills/agentforce-development/assets/bundle-meta.xml +23 -0
  14. package/skills/agentforce-development/assets/components/apex-action.agent +52 -0
  15. package/skills/agentforce-development/assets/components/error-handling.agent +58 -0
  16. package/skills/agentforce-development/assets/components/escalation-setup.agent +169 -0
  17. package/skills/agentforce-development/assets/components/flow-action.agent +66 -0
  18. package/skills/agentforce-development/assets/components/n-ary-conditions.agent +110 -0
  19. package/skills/agentforce-development/assets/components/topic-with-actions.agent +40 -0
  20. package/skills/agentforce-development/assets/deterministic-routing.agent +166 -0
  21. package/skills/agentforce-development/assets/escalation-pattern.agent +209 -0
  22. package/skills/agentforce-development/assets/flow-action-lookup.agent +115 -0
  23. package/skills/agentforce-development/assets/hub-and-spoke.agent +104 -0
  24. package/skills/agentforce-development/assets/invocable-apex-template.cls +187 -0
  25. package/skills/agentforce-development/assets/local-info-agent-annotated.agent +355 -0
  26. package/skills/agentforce-development/assets/metadata/basic-prompt-template.promptTemplate-meta.xml +109 -0
  27. package/skills/agentforce-development/assets/metadata/genai-function-apex.xml +92 -0
  28. package/skills/agentforce-development/assets/metadata/genai-function-flow.xml +57 -0
  29. package/skills/agentforce-development/assets/metadata/genai-plugin.xml +72 -0
  30. package/skills/agentforce-development/assets/metadata/http-callout-flow.flow-meta.xml +348 -0
  31. package/skills/agentforce-development/assets/metadata/record-grounded-prompt.promptTemplate-meta.xml +136 -0
  32. package/skills/agentforce-development/assets/minimal-starter.agent +42 -0
  33. package/skills/agentforce-development/assets/patterns/README.md +254 -0
  34. package/skills/agentforce-development/assets/patterns/action-callbacks.agent +178 -0
  35. package/skills/agentforce-development/assets/patterns/advanced-input-bindings.agent +141 -0
  36. package/skills/agentforce-development/assets/patterns/bidirectional-routing.agent +156 -0
  37. package/skills/agentforce-development/assets/patterns/critical-input-collection.agent +244 -0
  38. package/skills/agentforce-development/assets/patterns/delegation-routing.agent +89 -0
  39. package/skills/agentforce-development/assets/patterns/lifecycle-events.agent +127 -0
  40. package/skills/agentforce-development/assets/patterns/llm-controlled-actions.agent +184 -0
  41. package/skills/agentforce-development/assets/patterns/multi-step-workflow.agent +282 -0
  42. package/skills/agentforce-development/assets/patterns/open-gate-routing.agent +286 -0
  43. package/skills/agentforce-development/assets/patterns/procedural-instructions.agent +273 -0
  44. package/skills/agentforce-development/assets/patterns/prompt-template-action.agent +188 -0
  45. package/skills/agentforce-development/assets/patterns/system-instruction-overrides.agent +293 -0
  46. package/skills/agentforce-development/assets/prompt-rag-search.agent +131 -0
  47. package/skills/agentforce-development/assets/template-multi-topic.agent +160 -0
  48. package/skills/agentforce-development/assets/template-single-topic.agent +81 -0
  49. package/skills/agentforce-development/assets/verification-gate.agent +208 -0
  50. package/skills/agentforce-development/references/action-prompt-templates.md +164 -0
  51. package/skills/agentforce-development/references/actions-reference.md +592 -0
  52. package/skills/agentforce-development/references/agent-access-guide.md +72 -0
  53. package/skills/agentforce-development/references/agent-design-and-spec-creation.md +1010 -0
  54. package/skills/agentforce-development/references/agent-metadata-and-lifecycle.md +575 -0
  55. package/skills/agentforce-development/references/agent-script-core-language.md +1218 -0
  56. package/skills/agentforce-development/references/agent-topic-map-diagrams.md +323 -0
  57. package/skills/agentforce-development/references/agent-user-setup.md +526 -0
  58. package/skills/agentforce-development/references/agent-validation-and-debugging.md +803 -0
  59. package/skills/agentforce-development/references/known-issues.md +353 -0
  60. package/skills/agentforce-development/references/minimal-examples.md +67 -0
  61. package/skills/agentforce-development/references/production-gotchas.md +279 -0
  62. package/skills/agentforce-development/references/salesforce-cli-for-agents.md +393 -0
  63. package/skills/agentforce-development/references/version-history.md +23 -0
  64. package/skills/building-webapp-data-visualization/SKILL.md +72 -0
  65. package/skills/building-webapp-data-visualization/implementation/bar-line-chart.md +316 -0
  66. package/skills/building-webapp-data-visualization/implementation/dashboard-layout.md +189 -0
  67. package/skills/building-webapp-data-visualization/implementation/donut-chart.md +181 -0
  68. package/skills/building-webapp-data-visualization/implementation/stat-card.md +150 -0
  69. package/skills/building-webapp-react-components/SKILL.md +96 -0
  70. package/skills/building-webapp-react-components/implementation/component.md +78 -0
  71. package/skills/building-webapp-react-components/implementation/header-footer.md +132 -0
  72. package/skills/building-webapp-react-components/implementation/page.md +93 -0
  73. package/skills/configuring-webapp-csp-trusted-sites/SKILL.md +90 -0
  74. package/skills/configuring-webapp-csp-trusted-sites/implementation/metadata-format.md +281 -0
  75. package/skills/configuring-webapp-metadata/SKILL.md +158 -0
  76. package/skills/creating-webapp/SKILL.md +141 -0
  77. package/skills/deploying-webapp-to-salesforce/SKILL.md +229 -0
  78. package/skills/exploring-webapp-graphql-schema/SKILL.md +149 -0
  79. package/skills/fetching-webapp-rest-api/SKILL.md +167 -0
  80. package/skills/{salesforce-custom-application → generating-custom-application}/SKILL.md +2 -4
  81. package/skills/{salesforce-custom-field → generating-custom-field}/SKILL.md +1 -5
  82. package/skills/{salesforce-custom-lightning-type → generating-custom-lightning-type}/SKILL.md +36 -2
  83. package/skills/{salesforce-custom-object → generating-custom-object}/SKILL.md +1 -1
  84. package/skills/generating-custom-tab/SKILL.md +154 -0
  85. package/skills/generating-experience-lwr-site/SKILL.md +196 -0
  86. package/skills/generating-experience-lwr-site/docs/bootstrap-template-byo-lwr.md +224 -0
  87. package/skills/generating-experience-lwr-site/docs/configure-content-brandingSet.md +131 -0
  88. package/skills/generating-experience-lwr-site/docs/configure-content-route.md +232 -0
  89. package/skills/generating-experience-lwr-site/docs/configure-content-themeLayout.md +141 -0
  90. package/skills/generating-experience-lwr-site/docs/configure-content-view.md +233 -0
  91. package/skills/generating-experience-lwr-site/docs/configure-guest-sharing-rules.md +42 -0
  92. package/skills/generating-experience-lwr-site/docs/handle-component-and-region-ids.md +27 -0
  93. package/skills/generating-experience-lwr-site/docs/handle-ui-components.md +215 -0
  94. package/skills/generating-experience-react-site/SKILL.md +67 -0
  95. package/skills/generating-experience-react-site/docs/configure-metadata-custom-site.md +41 -0
  96. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-bundle.md +17 -0
  97. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience-config.md +21 -0
  98. package/skills/generating-experience-react-site/docs/configure-metadata-digital-experience.md +38 -0
  99. package/skills/generating-experience-react-site/docs/configure-metadata-network.md +72 -0
  100. package/skills/{salesforce-flexipage → generating-flexipage}/SKILL.md +86 -9
  101. package/skills/{salesforce-flow → generating-flow}/SKILL.md +3 -3
  102. package/skills/generating-fragment/SKILL.md +117 -0
  103. package/skills/generating-lightning-app/SKILL.md +423 -0
  104. package/skills/{salesforce-list-view → generating-list-view}/SKILL.md +1 -1
  105. package/skills/generating-permission-set/SKILL.md +174 -0
  106. package/skills/{salesforce-validation-rule → generating-validation-rule}/SKILL.md +1 -1
  107. package/skills/generating-webapp-graphql-mutation-query/SKILL.md +258 -0
  108. package/skills/generating-webapp-graphql-read-query/SKILL.md +253 -0
  109. package/skills/implementing-webapp-file-upload/SKILL.md +396 -0
  110. package/skills/installing-webapp-features/SKILL.md +210 -0
  111. package/skills/managing-webapp-agentforce-conversation-client/SKILL.md +186 -0
  112. package/skills/managing-webapp-agentforce-conversation-client/references/constraints.md +134 -0
  113. package/skills/managing-webapp-agentforce-conversation-client/references/examples.md +132 -0
  114. package/skills/managing-webapp-agentforce-conversation-client/references/style-tokens.md +101 -0
  115. package/skills/managing-webapp-agentforce-conversation-client/references/troubleshooting.md +57 -0
  116. package/skills/switching-org/SKILL.md +28 -0
  117. package/skills/using-webapp-graphql/SKILL.md +324 -0
  118. package/skills/using-webapp-graphql/shared-schema.graphqls +1150 -0
  119. package/skills/apex-class/SKILL.md +0 -253
  120. package/skills/apex-class/examples/AccountDeduplicationBatch.cls +0 -148
  121. package/skills/apex-class/examples/AccountSelector.cls +0 -193
  122. package/skills/apex-class/examples/AccountService.cls +0 -201
  123. package/skills/apex-class/templates/abstract.cls +0 -128
  124. package/skills/apex-class/templates/batch.cls +0 -125
  125. package/skills/apex-class/templates/domain.cls +0 -102
  126. package/skills/apex-class/templates/dto.cls +0 -108
  127. package/skills/apex-class/templates/exception.cls +0 -51
  128. package/skills/apex-class/templates/interface.cls +0 -25
  129. package/skills/apex-class/templates/queueable.cls +0 -92
  130. package/skills/apex-class/templates/schedulable.cls +0 -75
  131. package/skills/apex-class/templates/selector.cls +0 -92
  132. package/skills/apex-class/templates/service.cls +0 -69
  133. package/skills/apex-class/templates/utility.cls +0 -97
  134. package/skills/apex-test-class/SKILL.md +0 -101
  135. package/skills/apex-test-class/references/assertion-patterns.md +0 -209
  136. package/skills/apex-test-class/references/async-testing.md +0 -276
  137. package/skills/apex-test-class/references/mocking-patterns.md +0 -219
  138. package/skills/apex-test-class/references/test-data-factory.md +0 -176
  139. package/skills/deployment-readiness-check/SKILL.md +0 -257
  140. package/skills/deployment-readiness-check/assets/deployment_checklist.md +0 -286
  141. package/skills/deployment-readiness-check/references/rollback_procedures.md +0 -308
  142. package/skills/deployment-readiness-check/scripts/check_metadata.sh +0 -207
  143. package/skills/salesforce-custom-tab/SKILL.md +0 -78
  144. package/skills/salesforce-experience-site/SKILL.md +0 -178
  145. package/skills/salesforce-fragment/SKILL.md +0 -42
  146. package/skills/salesforce-lightning-app-build/SKILL.md +0 -254
  147. package/skills/salesforce-web-app-creating-records/SKILL.md +0 -84
  148. package/skills/salesforce-web-app-feature/SKILL.md +0 -70
  149. package/skills/salesforce-web-app-list-and-create-records/SKILL.md +0 -36
  150. package/skills/salesforce-web-application/SKILL.md +0 -34
@@ -0,0 +1,109 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Prompt Template: Basic Template
4
+
5
+ Use Case: Create reusable prompts for Einstein/Agentforce
6
+ - Standardize prompt patterns across org
7
+ - Include variable bindings from records
8
+ - Use in agents, flows, or Apex
9
+
10
+ Template Types:
11
+ - salesGeneration: Generate content (emails, summaries)
12
+ - fieldCompletion: Suggest field values
13
+ - recordSummary: Summarize records
14
+ - flexPrompt: General purpose
15
+
16
+ Setup Steps:
17
+ 1. Replace all {{placeholder}} values
18
+ 2. Define input variables and their sources
19
+ 3. Deploy to org
20
+ 4. Use in Agent Actions or Flows
21
+
22
+ File Location: force-app/main/default/promptTemplates/{{TemplateName}}.promptTemplate-meta.xml
23
+ -->
24
+ <PromptTemplate xmlns="http://soap.sforce.com/2006/04/metadata">
25
+ <!-- API Name -->
26
+ <fullName>{{TemplateName}}</fullName>
27
+
28
+ <!-- Display name -->
29
+ <masterLabel>{{TemplateLabel}}</masterLabel>
30
+
31
+ <!-- Description of template purpose -->
32
+ <description>{{TemplateDescription}}</description>
33
+
34
+ <!--
35
+ Template Type:
36
+ - salesGeneration: Generate sales content
37
+ - fieldCompletion: Predict/suggest field values
38
+ - recordSummary: Summarize record data
39
+ - flexPrompt: General purpose (most flexible)
40
+ -->
41
+ <type>flexPrompt</type>
42
+
43
+ <!-- Active status -->
44
+ <isActive>true</isActive>
45
+
46
+ <!--
47
+ The Prompt Content:
48
+ Use {!variableName} for variable substitution.
49
+ Keep prompts clear, specific, and well-structured.
50
+ -->
51
+ <promptContent>
52
+ You are an AI assistant helping with {{UseCaseDescription}}.
53
+
54
+ Context:
55
+ {!contextVariable}
56
+
57
+ Task:
58
+ {{TaskDescription}}
59
+
60
+ Instructions:
61
+ 1. {{Instruction1}}
62
+ 2. {{Instruction2}}
63
+ 3. {{Instruction3}}
64
+
65
+ Please provide a helpful response based on the context above.
66
+ </promptContent>
67
+
68
+ <!--
69
+ Input Variables:
70
+ Define variables that can be bound to record fields or runtime values.
71
+ -->
72
+ <promptTemplateVariables>
73
+ <developerName>contextVariable</developerName>
74
+ <promptTemplateVariableType>freeText</promptTemplateVariableType>
75
+ <isRequired>true</isRequired>
76
+ </promptTemplateVariables>
77
+
78
+ <!--
79
+ Variable Types:
80
+ - freeText: User-provided text input
81
+ - recordField: Bound to a specific field on a record
82
+ - relatedList: Data from related records
83
+ - resource: Static resource content
84
+
85
+ Example recordField variable:
86
+ <promptTemplateVariables>
87
+ <developerName>accountName</developerName>
88
+ <promptTemplateVariableType>recordField</promptTemplateVariableType>
89
+ <objectType>Account</objectType>
90
+ <fieldName>Name</fieldName>
91
+ <isRequired>true</isRequired>
92
+ </promptTemplateVariables>
93
+ -->
94
+
95
+ <!--
96
+ USAGE IN AGENT ACTIONS:
97
+
98
+ Option 1: Via GenAiFunction
99
+ Create GenAiFunction with invocationTargetType="prompt"
100
+ pointing to this template.
101
+
102
+ Option 2: Via Flow
103
+ Use "Prompt Template" action in Flow,
104
+ then wrap Flow in Agent Script action.
105
+
106
+ Option 3: Via Apex
107
+ Use ConnectApi.Einstein.evaluatePrompt() method.
108
+ -->
109
+ </PromptTemplate>
@@ -0,0 +1,92 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ GenAiFunction Template: Apex Invocation (Agent Builder UI / GenAiPlannerBundle ONLY)
4
+
5
+ ⚠️ NOT NEEDED for AiAuthoringBundle (Agent Script).
6
+ If using Agent Script (.agent files), use `target: "apex://ClassName"` directly
7
+ in your topic's actions block. See SKILL.md for details.
8
+
9
+ Use Case: Register Apex @InvocableMethod as an agent action in Agent Builder UI
10
+ - Required ONLY for GenAiPlannerBundle / Agent Builder UI path
11
+ - Works with GenAiPlugin (Topic) for organization
12
+
13
+ Prerequisites:
14
+ 1. Apex class with @InvocableMethod annotation must be deployed first
15
+ 2. GenAiPlugin (Topic) to organize functions (optional but recommended)
16
+
17
+ Setup Steps:
18
+ 1. Replace all {{placeholder}} values
19
+ 2. Deploy Apex class first
20
+ 3. Create input/schema.json and output/schema.json (see below)
21
+ 4. Deploy this GenAiFunction bundle
22
+ 5. Optionally deploy GenAiPlugin to group functions
23
+
24
+ Bundle Structure:
25
+ force-app/main/default/genAiFunctions/
26
+ └── {{FunctionName}}/
27
+ ├── {{FunctionName}}.genAiFunction-meta.xml (this file)
28
+ ├── input/
29
+ │ └── schema.json (input parameters)
30
+ └── output/
31
+ └── schema.json (output parameters)
32
+
33
+ IMPORTANT (API v66.0):
34
+ - Only these XML elements are valid: description, invocationTarget,
35
+ invocationTargetType, isConfirmationRequired, masterLabel
36
+ - Do NOT use: <capability>, <genAiFunctionParameters>,
37
+ <genAiFunctionInputs>, <genAiFunctionOutputs>, <developerName>
38
+ - Input/output schemas go in schema.json files, NOT inline XML
39
+ -->
40
+ <GenAiFunction xmlns="http://soap.sforce.com/2006/04/metadata">
41
+ <description>{{FunctionDescription}}</description>
42
+ <invocationTarget>{{ApexClassName}}</invocationTarget>
43
+ <invocationTargetType>apex</invocationTargetType>
44
+ <isConfirmationRequired>{{true|false}}</isConfirmationRequired>
45
+ <masterLabel>{{FunctionLabel}}</masterLabel>
46
+ </GenAiFunction>
47
+
48
+ <!--
49
+ input/schema.json example:
50
+ {
51
+ "required": ["{{inputParam1}}"],
52
+ "properties": {
53
+ "{{inputParam1}}": {
54
+ "title": "{{Input Param 1 Label}}",
55
+ "description": "{{Input Param 1 Description}}",
56
+ "lightning:type": "lightning__textType",
57
+ "lightning:isPII": false,
58
+ "copilotAction:isUserInput": true
59
+ }
60
+ },
61
+ "lightning:type": "lightning__objectType"
62
+ }
63
+
64
+ output/schema.json example:
65
+ {
66
+ "properties": {
67
+ "{{outputParam1}}": {
68
+ "title": "{{Output Param 1 Label}}",
69
+ "description": "{{Output Param 1 Description}}",
70
+ "lightning:type": "lightning__textType",
71
+ "lightning:isPII": false,
72
+ "copilotAction:isDisplayable": true,
73
+ "copilotAction:isUsedByPlanner": true
74
+ }
75
+ },
76
+ "lightning:type": "lightning__objectType"
77
+ }
78
+
79
+ Lightning types:
80
+ - lightning__textType (String)
81
+ - lightning__numberType (Number/Decimal)
82
+ - lightning__booleanType (Boolean)
83
+ - lightning__dateType (Date)
84
+ - lightning__dateTimeStringType (DateTime — TDD validated v2.1.0)
85
+ - lightning__currencyType (Currency)
86
+
87
+ APEX CLASS REQUIREMENTS:
88
+ - Must be global or public with sharing
89
+ - Method must have @InvocableMethod annotation
90
+ - Input/output use @InvocableVariable wrapper classes
91
+ - Parameter names in schema.json must match @InvocableVariable field names
92
+ -->
@@ -0,0 +1,57 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ GenAiFunction Template: Flow Invocation (Agent Builder UI / GenAiPlannerBundle ONLY)
4
+
5
+ ⚠️ NOT NEEDED for AiAuthoringBundle (Agent Script).
6
+ If using Agent Script (.agent files), use `target: "flow://FlowApiName"` directly
7
+ in your topic's actions block. See SKILL.md for details.
8
+
9
+ Use Case: Register Autolaunched Flow as an agent action in Agent Builder UI
10
+ - Required ONLY for GenAiPlannerBundle / Agent Builder UI path
11
+ - Supports HTTP callouts via Flow HTTP actions
12
+ - Works well with External Services
13
+
14
+ Prerequisites:
15
+ 1. Autolaunched Flow must be deployed and active first
16
+ 2. Flow must have defined input/output variables
17
+
18
+ Setup Steps:
19
+ 1. Replace all {{placeholder}} values
20
+ 2. Deploy Autolaunched Flow first
21
+ 3. Create input/schema.json and output/schema.json (see genai-function-apex.xml for format)
22
+ 4. Deploy this GenAiFunction bundle
23
+
24
+ Bundle Structure:
25
+ force-app/main/default/genAiFunctions/
26
+ └── {{FunctionName}}/
27
+ ├── {{FunctionName}}.genAiFunction-meta.xml (this file)
28
+ ├── input/
29
+ │ └── schema.json (input parameters)
30
+ └── output/
31
+ └── schema.json (output parameters)
32
+
33
+ IMPORTANT (API v66.0):
34
+ - Only these XML elements are valid: description, invocationTarget,
35
+ invocationTargetType, isConfirmationRequired, masterLabel
36
+ - Do NOT use: <capability>, <genAiFunctionParameters>,
37
+ <genAiFunctionInputs>, <genAiFunctionOutputs>, <developerName>
38
+ - Input/output schemas go in schema.json files, NOT inline XML
39
+ -->
40
+ <GenAiFunction xmlns="http://soap.sforce.com/2006/04/metadata">
41
+ <description>{{FunctionDescription}}</description>
42
+ <invocationTarget>{{FlowApiName}}</invocationTarget>
43
+ <invocationTargetType>flow</invocationTargetType>
44
+ <isConfirmationRequired>{{true|false}}</isConfirmationRequired>
45
+ <masterLabel>{{FunctionLabel}}</masterLabel>
46
+ </GenAiFunction>
47
+
48
+ <!--
49
+ FLOW REQUIREMENTS:
50
+ 1. Flow Type: Autolaunched Flow (NOT Screen Flow)
51
+ 2. Input Variables: Must be marked "Available for input"
52
+ 3. Output Variables: Must be marked "Available for output"
53
+ 4. Variable names in schema.json must match Flow variable names exactly
54
+ 5. Flow must be Active
55
+
56
+ See genai-function-apex.xml for input/schema.json and output/schema.json format examples.
57
+ -->
@@ -0,0 +1,72 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ GenAiPlugin Template: Agent Topic/Plugin Container
4
+
5
+ Use Case: Organize GenAiFunctions into logical groups (Topics)
6
+ - Groups related functions together
7
+ - Provides topic-level instructions
8
+ - Maps to Agent Script topic concepts
9
+
10
+ Note: GenAiPlugin is the metadata equivalent of a "topic" in Agent Script.
11
+ Use this when you want to organize functions deployed via metadata
12
+ rather than Agent Script.
13
+
14
+ Setup Steps:
15
+ 1. Replace all {{placeholder}} values
16
+ 2. Deploy GenAiFunctions first
17
+ 3. Deploy this GenAiPlugin
18
+
19
+ File Location: force-app/main/default/genAiPlugins/{{PluginName}}.genAiPlugin-meta.xml
20
+ -->
21
+ <GenAiPlugin xmlns="http://soap.sforce.com/2006/04/metadata">
22
+ <!-- Display name for the topic/plugin -->
23
+ <masterLabel>{{PluginLabel}}</masterLabel>
24
+
25
+ <!-- Description shown in Agent Builder -->
26
+ <description>{{PluginDescription}}</description>
27
+
28
+ <!-- Developer name (API name) -->
29
+ <developerName>{{PluginDeveloperName}}</developerName>
30
+
31
+ <!--
32
+ Plugin Instructions:
33
+ Natural language instructions for how the agent should use
34
+ functions in this plugin. Similar to topic instructions in Agent Script.
35
+ -->
36
+ <pluginInstructions>
37
+ {{Instructions for the agent on how to use functions in this topic.
38
+ Include guidance on when to use specific functions,
39
+ how to handle edge cases, and any constraints.}}
40
+ </pluginInstructions>
41
+
42
+ <!--
43
+ Plugin Type:
44
+ - Standard: Regular function grouping
45
+ - Copilot: For Salesforce Copilot-specific plugins
46
+ -->
47
+ <pluginType>Standard</pluginType>
48
+
49
+ <!--
50
+ Associated Functions:
51
+ List the GenAiFunction developer names that belong to this plugin.
52
+ -->
53
+ <genAiFunctions>
54
+ <function>{{GenAiFunction1DeveloperName}}</function>
55
+ </genAiFunctions>
56
+ <genAiFunctions>
57
+ <function>{{GenAiFunction2DeveloperName}}</function>
58
+ </genAiFunctions>
59
+
60
+ <!--
61
+ AGENT BUILDER INTEGRATION:
62
+
63
+ After deploying GenAiPlugin:
64
+ 1. Open Agent Builder in Setup
65
+ 2. Navigate to Topics
66
+ 3. Your plugin appears as a Topic
67
+ 4. Associated functions are available as Actions
68
+
69
+ This provides an alternative to Agent Script for more
70
+ complex deployments or when you need metadata-level control.
71
+ -->
72
+ </GenAiPlugin>
@@ -0,0 +1,348 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ HTTP Callout Flow Template for Agent Actions
4
+
5
+ Use Case: Create Flow-based API actions for agents
6
+ - Enables external API calls from Agent Script
7
+ - Uses Named Credential for secure auth
8
+ - Works with flow:// target in Agent Script
9
+
10
+ Pattern:
11
+ Agent Script → flow://{{FlowName}} → HTTP Callout → External API
12
+
13
+ Prerequisites:
14
+ 1. Named Credential configured for API auth
15
+ 2. sf-integration skill used to create Named Credential
16
+
17
+ Setup Steps:
18
+ 1. Replace all {{placeholder}} values
19
+ 2. Deploy Named Credential first
20
+ 3. Deploy this Flow
21
+ 4. Reference in Agent Script: target: "flow://{{FlowApiName}}"
22
+
23
+ File Location: force-app/main/default/flows/{{FlowApiName}}.flow-meta.xml
24
+ -->
25
+ <Flow xmlns="http://soap.sforce.com/2006/04/metadata">
26
+ <!-- API Name -->
27
+ <fullName>{{FlowApiName}}</fullName>
28
+
29
+ <!-- Display label -->
30
+ <label>{{FlowLabel}}</label>
31
+
32
+ <!-- Description -->
33
+ <description>HTTP callout to {{ExternalSystemName}} for agent actions</description>
34
+
35
+ <!-- Autolaunched Flow (required for agent actions) -->
36
+ <processType>AutoLaunchedFlow</processType>
37
+
38
+ <!-- API Version -->
39
+ <apiVersion>66.0</apiVersion>
40
+
41
+ <!-- Active status -->
42
+ <status>Active</status>
43
+
44
+ <!--
45
+ =========================================
46
+ INPUT VARIABLES
47
+ Must be marked "Available for Input"
48
+ =========================================
49
+ -->
50
+ <variables>
51
+ <name>input_param_1</name>
52
+ <dataType>String</dataType>
53
+ <isCollection>false</isCollection>
54
+ <isInput>true</isInput>
55
+ <isOutput>false</isOutput>
56
+ <value>
57
+ <stringValue></stringValue>
58
+ </value>
59
+ </variables>
60
+
61
+ <!-- Add more input variables as needed -->
62
+ <!--
63
+ <variables>
64
+ <name>input_param_2</name>
65
+ <dataType>String</dataType>
66
+ <isCollection>false</isCollection>
67
+ <isInput>true</isInput>
68
+ <isOutput>false</isOutput>
69
+ </variables>
70
+ -->
71
+
72
+ <!--
73
+ =========================================
74
+ OUTPUT VARIABLES
75
+ Must be marked "Available for Output"
76
+ =========================================
77
+ -->
78
+ <variables>
79
+ <name>output_result</name>
80
+ <dataType>String</dataType>
81
+ <isCollection>false</isCollection>
82
+ <isInput>false</isInput>
83
+ <isOutput>true</isOutput>
84
+ </variables>
85
+
86
+ <variables>
87
+ <name>output_status</name>
88
+ <dataType>String</dataType>
89
+ <isCollection>false</isCollection>
90
+ <isInput>false</isInput>
91
+ <isOutput>true</isOutput>
92
+ </variables>
93
+
94
+ <variables>
95
+ <name>output_error</name>
96
+ <dataType>String</dataType>
97
+ <isCollection>false</isCollection>
98
+ <isInput>false</isInput>
99
+ <isOutput>true</isOutput>
100
+ </variables>
101
+
102
+ <!--
103
+ =========================================
104
+ HTTP CALLOUT ACTION
105
+ Core Action for making HTTP requests
106
+ =========================================
107
+ -->
108
+ <actionCalls>
109
+ <name>HTTP_Callout</name>
110
+ <label>Call External API</label>
111
+ <locationX>176</locationX>
112
+ <locationY>158</locationY>
113
+
114
+ <!-- HTTP Callout Core Action -->
115
+ <actionType>httpCallout</actionType>
116
+
117
+ <!--
118
+ Named Credential for authentication
119
+ Format: callout:NamedCredentialName
120
+ -->
121
+ <actionName>callout:{{NamedCredentialName}}</actionName>
122
+
123
+ <!-- Continue on error to handle gracefully -->
124
+ <connector>
125
+ <targetReference>Check_Response</targetReference>
126
+ </connector>
127
+
128
+ <faultConnector>
129
+ <targetReference>Handle_Error</targetReference>
130
+ </faultConnector>
131
+
132
+ <!-- HTTP Method: GET, POST, PUT, PATCH, DELETE -->
133
+ <inputParameters>
134
+ <name>method</name>
135
+ <value>
136
+ <stringValue>{{GET|POST|PUT|PATCH|DELETE}}</stringValue>
137
+ </value>
138
+ </inputParameters>
139
+
140
+ <!-- API Endpoint path (appended to Named Credential base URL) -->
141
+ <inputParameters>
142
+ <name>url</name>
143
+ <value>
144
+ <elementReference>API_Endpoint</elementReference>
145
+ </value>
146
+ </inputParameters>
147
+
148
+ <!-- Request body (for POST/PUT/PATCH) -->
149
+ <inputParameters>
150
+ <name>body</name>
151
+ <value>
152
+ <elementReference>Request_Body</elementReference>
153
+ </value>
154
+ </inputParameters>
155
+
156
+ <!-- Response body -->
157
+ <outputParameters>
158
+ <assignToReference>Response_Body</assignToReference>
159
+ <name>responseBody</name>
160
+ </outputParameters>
161
+
162
+ <!-- Response status code -->
163
+ <outputParameters>
164
+ <assignToReference>Response_Status_Code</assignToReference>
165
+ <name>statusCode</name>
166
+ </outputParameters>
167
+ </actionCalls>
168
+
169
+ <!--
170
+ =========================================
171
+ FORMULAS
172
+ Build request URL and body
173
+ =========================================
174
+ -->
175
+ <formulas>
176
+ <name>API_Endpoint</name>
177
+ <dataType>String</dataType>
178
+ <!-- Build endpoint with input parameters -->
179
+ <expression>"/{{apiPath}}/" &amp; {!input_param_1}</expression>
180
+ </formulas>
181
+
182
+ <formulas>
183
+ <name>Request_Body</name>
184
+ <dataType>String</dataType>
185
+ <!-- Build JSON request body -->
186
+ <expression>'{"param1": "' &amp; {!input_param_1} &amp; '"}'</expression>
187
+ </formulas>
188
+
189
+ <!--
190
+ =========================================
191
+ PRIVATE VARIABLES
192
+ For internal flow processing
193
+ =========================================
194
+ -->
195
+ <variables>
196
+ <name>Response_Body</name>
197
+ <dataType>String</dataType>
198
+ <isCollection>false</isCollection>
199
+ <isInput>false</isInput>
200
+ <isOutput>false</isOutput>
201
+ </variables>
202
+
203
+ <variables>
204
+ <name>Response_Status_Code</name>
205
+ <dataType>Number</dataType>
206
+ <isCollection>false</isCollection>
207
+ <isInput>false</isInput>
208
+ <isOutput>false</isOutput>
209
+ <scale>0</scale>
210
+ </variables>
211
+
212
+ <!--
213
+ =========================================
214
+ DECISION: Check Response Status
215
+ =========================================
216
+ -->
217
+ <decisions>
218
+ <name>Check_Response</name>
219
+ <label>Check Response Status</label>
220
+ <locationX>176</locationX>
221
+ <locationY>278</locationY>
222
+
223
+ <defaultConnector>
224
+ <targetReference>Set_Error_Output</targetReference>
225
+ </defaultConnector>
226
+ <defaultConnectorLabel>Error</defaultConnectorLabel>
227
+
228
+ <rules>
229
+ <name>Success</name>
230
+ <conditionLogic>and</conditionLogic>
231
+ <conditions>
232
+ <leftValueReference>Response_Status_Code</leftValueReference>
233
+ <operator>GreaterThanOrEqualTo</operator>
234
+ <rightValue>
235
+ <numberValue>200</numberValue>
236
+ </rightValue>
237
+ </conditions>
238
+ <conditions>
239
+ <leftValueReference>Response_Status_Code</leftValueReference>
240
+ <operator>LessThan</operator>
241
+ <rightValue>
242
+ <numberValue>300</numberValue>
243
+ </rightValue>
244
+ </conditions>
245
+ <connector>
246
+ <targetReference>Set_Success_Output</targetReference>
247
+ </connector>
248
+ <label>Success (2xx)</label>
249
+ </rules>
250
+ </decisions>
251
+
252
+ <!--
253
+ =========================================
254
+ ASSIGNMENTS: Set Output Variables
255
+ =========================================
256
+ -->
257
+ <assignments>
258
+ <name>Set_Success_Output</name>
259
+ <label>Set Success Output</label>
260
+ <locationX>50</locationX>
261
+ <locationY>398</locationY>
262
+
263
+ <assignmentItems>
264
+ <assignToReference>output_result</assignToReference>
265
+ <operator>Assign</operator>
266
+ <value>
267
+ <elementReference>Response_Body</elementReference>
268
+ </value>
269
+ </assignmentItems>
270
+ <assignmentItems>
271
+ <assignToReference>output_status</assignToReference>
272
+ <operator>Assign</operator>
273
+ <value>
274
+ <stringValue>Success</stringValue>
275
+ </value>
276
+ </assignmentItems>
277
+ </assignments>
278
+
279
+ <assignments>
280
+ <name>Set_Error_Output</name>
281
+ <label>Set Error Output</label>
282
+ <locationX>302</locationX>
283
+ <locationY>398</locationY>
284
+
285
+ <assignmentItems>
286
+ <assignToReference>output_status</assignToReference>
287
+ <operator>Assign</operator>
288
+ <value>
289
+ <stringValue>Error</stringValue>
290
+ </value>
291
+ </assignmentItems>
292
+ <assignmentItems>
293
+ <assignToReference>output_error</assignToReference>
294
+ <operator>Assign</operator>
295
+ <value>
296
+ <elementReference>Response_Body</elementReference>
297
+ </value>
298
+ </assignmentItems>
299
+ </assignments>
300
+
301
+ <assignments>
302
+ <name>Handle_Error</name>
303
+ <label>Handle Callout Error</label>
304
+ <locationX>440</locationX>
305
+ <locationY>278</locationY>
306
+
307
+ <assignmentItems>
308
+ <assignToReference>output_status</assignToReference>
309
+ <operator>Assign</operator>
310
+ <value>
311
+ <stringValue>Error</stringValue>
312
+ </value>
313
+ </assignmentItems>
314
+ <assignmentItems>
315
+ <assignToReference>output_error</assignToReference>
316
+ <operator>Assign</operator>
317
+ <value>
318
+ <stringValue>HTTP callout failed</stringValue>
319
+ </value>
320
+ </assignmentItems>
321
+ </assignments>
322
+
323
+ <!-- Flow start -->
324
+ <start>
325
+ <locationX>50</locationX>
326
+ <locationY>0</locationY>
327
+ <connector>
328
+ <targetReference>HTTP_Callout</targetReference>
329
+ </connector>
330
+ </start>
331
+
332
+ <!--
333
+ AGENT SCRIPT USAGE:
334
+
335
+ actions:
336
+ call_api:
337
+ description: "Calls external API"
338
+ inputs:
339
+ param1: string
340
+ description: "Input parameter"
341
+ outputs:
342
+ result: string
343
+ description: "API response"
344
+ status: string
345
+ description: "Success or Error"
346
+ target: "flow://{{FlowApiName}}"
347
+ -->
348
+ </Flow>