Newer Version Available
Get Access to Scratch Orgs That Have Agentforce
If you don’t already have a Partner Business Org (PBO), join the Salesforce Partner Community and request a PBO.
If you’re new to creating scratch orgs, follow these steps to complete the one-time Dev Hub setup in your PBO. The Dev Hub is a feature within an org that lets you create and manage scratch orgs, second-generation managed packages (2GP), and namespaces.
- Enable the Dev Hub and 2GP
- Create a Developer Edition org using Environment Hub
- Create a namespace in the Developer Edition org
- Link that namespace from your PBO. Linking the namespace lets you create 2GP packages that use that namespace.
As of September 16, 2024, all active Partner PBOs can create scratch orgs with Agentforce and Prompt Builder. Agentforce and Prompt Builder can be enabled for scratch orgs that are associated with a Dev Hub in a PBO.
| Partners with active PBO orgs | Enabled as of September 16, 2024 |
| New PBO orgs (Trial or Active) | Automatically enabled when created |
To create a scratch org with Agentforce and Prompt Builder enabled, use this sample project-scratch-def.json file (or simply add the feature and setting shown in this sample to your existing scratch org definition file).
1{
2 "orgName": "GenAI Scratch Org",
3 "edition": "Partner Developer",
4 "features": ["Einstein1AIPlatform"],
5 "settings": {
6 "einsteinGptSettings" : {
7 "enableEinsteinGptPlatform" : true
8 }
9 }
10}To create a scratch org with the Einstein1AIPlatform feature, the scratch org you create must be a Partner Developer edition.
To create a scratch org, run this Salesforce CLI command. Update the definition-file name, alias, and target-dev-hub alias as needed.
1sf org create scratch --definition-file config/my-agentforce-project-scratch-def.json --alias MyScratchOrg --set-default --target-dev-hub MyHubScratch Orgs with both Agentforce and Data Cloud
For some use cases such as prompt templates that use RAG, Retrievers, and BYO LLM, a scratch org that has both GenAI and Data Cloud functionality enabled is required.
Only include Data Cloud if it’s required. Specifying Data Cloud in a scratch org significantly increases the time it takes for a scratch org creation to complete.
1{
2 "orgName": "GenAI & Data Cloud Scratch Org",
3 "edition": "Partner Developer",
4 "features": ["CustomerDataPlatform", "CustomerDataPlatformLite","Einstein1AIPlatform"],
5 "settings": {
6 "einsteinGptSettings" : {
7 "enableEinsteinGptPlatform" : true
8 }
9 "customerDataPlatformSettings": {
10 "enableCustomerDataPlatform": true
11 }
12 }
13}Set up Agentforce in your Scratch Org
After your scratch org is created, follow these steps to start developing with Agentforce.
- Enable Agents and Einstein Copilot for Salesforce manually in the scratch org.
- Assign user permissions.
- To use prompt templates with your Agent Actions, assign prompt template permissions.