We can enable and create an Agentforce org using our Trailhead account, and as our agent expired, we had to create another org using the Trailhead account. But now, with the Spring ’25 release, we can create an agent org using our normal Salesforce developer org by creating scratch orgs.
In this tutorial, we will learn about scratch orgs in Salesforce and how to create Agentforce-enabled scratch orgs from Salesforce Developer Edition. So, with the scratch orgs, it will be very helpful to use an agent-enabled org in Salesforce.
Scratch Org in Salesforce
A Scratch Org in Salesforce is a temporary Salesforce environment used for development and testing. It is a new playground where we can test new features, write code, or configure settings before deploying changes to production without affecting our main Salesforce org. It is mainly used in Salesforce DX (Developer Experience).
It will be available for a limited time (maximum 30 days), and we can create multiple scratch orgs, test different things, and then delete them when we’re done.
The scratch org can be created using the production org as well as the developer org. So if we have a normal developer org, we can create a scratch org from that, and in that scratch org, we can specify the feature that will ensure the agent force is enabled in our org.
Create Agentforce-Enabled Scratch Orgs From Salesforce Developer Edition
In the steps below, I will explain the prerequisites and how to create Agentforce-enabled scratch orgs from the Salesforce developer edition.
To understand the prerequisites, you can visit the Agentforce Developer Guide. There, we have details on what we need to create a scratch org in Salesforce.
Firstly, we need a CLI, so make sure that you have Salesforce CLI installed and that you have authorisation to the dev hub in your system. I will explain all of this in the steps below.
Scratch or Definition File
After that, below, I have given the most important file, the scratch or definition file, and here you will see that it has Einstein’s one API platform feature added. So with this feature, the scratch that we are going to create will have Agentforce enabled.
Also, we have an Einstein GPT setting, so here we are enabling the Einstein GPT Platform. This is the same step that we used to take from the Einstein Setup, where we used to turn on the Einstein Copilot.
{
"orgName": "Agentforce scratch org",
"edition": "Developer",
"features": ["EnableSetPasswordInApi","Einstein1AIPlatform"],
"settings": {
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
},
"mobileSettings": {
"enableS1EncryptedStoragePref2": false
},
"einsteinGptSettings" : {
"enableEinsteinGptPlatform" : true
}
}
}Now open the IDE you have. I have installed VS Code. If you create an SFDX project, you will have a config folder within it, and you will also have the project scratch definition. JSON file. Now you need to copy the above scratch or definition file and paste it into the scratch definition JSON file, which is inside the Config.

Make sure that the org that you are authorising has dev hub enabled. So the org that I’m trying to authorise right now does have dev hub enabled. That’s why I will be able to authorise that org.
Click the Enable Dev Hub toggle button and slide right to enable Dev Hub.

After that, to create the scratch org, we also need to authorise to a dev hub. For that, open the command palette and choose SFDX: Authorise a Dev Hub. Then provide any alias and press the Enter key.
After that, it will redirect to the Salesforce org login page.

Here, you need to enter credentials of your regular Salesforce developer org edition, or you will get a confirmation screen asking if you want to allow the Salesforce Org to connect to VS Code. There, you need to click the Allow button.

After that, you will be connected to the Salesforce org using VS Code and receive an Authentication Successful message. Also, this is not a Trailhead module, but a normal Salesforce developer.

We already enabled the dev hub in this org, which is why we were able to use it as a dev hub. Another point is that for a developer org like this, which is a normal Salesforce developer org, we can only have three active scratch orgs.
So, make sure that your developer org does not have more than three active scratch orgs. To check the active scratch orgs, search for Scratch Orgs in the App Launcher.
We have higher limits in the Production Org, but with the developer, we can only have three active scratch orgs.

We don’t have any active scratch orgs, so we can create almost three active scratch orgs in this developer account.
If you already have three scratch orgs and want to create another one, you must first delete one of the orgs from active orgs.

Create Scratch Org From Salesforce Developer Edition
Navigate to the VS Code or IDE you are using, open the command palette (Ctrl+Shift+P), search for Scratch Org, and select SFDX: Create a Default Scratch Org. After that, select the file location and provide an alias.

After that, provide how many days we want to use Scratch org. Here, I provided 30 days, and if you want to delete it before expiry, you can.

Now, as you navigate to the active scratch org again, you will see that one scratch org has been created.

How to Open a Scratch Org
To open it in VS Code, just run the command open default org because that scratch org is currently set as our default org. In the image below, you can see the URL we have for the scratch org mentioned.
The very important thing is that this scratch.org does have Agentforce enabled.

Enable Agentforce in Scratch Org in Salesforce
In the Quick Find search for the Einstein Setup, since we had already made that setting true, you will see that it is already enabled here. This is because in the scratch definition file, we declared EinsteinGPTPlatform: true.

After that, again, in the Quick Find search for Agents. Then, turn on the Agentforce toggle button. As you enable Agentforce, you will see the Agentforce (Default) in the Agent Name and that Type in Employee, which means this one will be available for internal Salesforce employees.
Also, in this org, we can see we have permission to create multiple agents by clicking on the New Agent button.
Now, open the Agentforce (Default) to customise and add to the Salesforce CRM for internal employees.

Here, you can see the details of an Agentforce agent. Currently, this agent is not activated. Click the Open in Builder button to customise and activate the agent. As you open it in the Builder, you will see the Topics, Instructions, and standard Actions of this agent.

Now, to use this agent in Salesforce CRM, we need to activate it by clicking on the Active button.

After activating the Agentforce agent, navigate to any app, object, or anywhere in Salesforce UI, and you will see the Agentforce icon. Here, I have opened the Sales application.
Now, if you have any queries or want to retrieve data from Salesforce, you just need to click on the Agentforce icon and ask questions in natural language.
In the image below, you can see that I asked about opportunity records, and the agent displayed the answer in that chat.

In this way, we can enable and activate the Agentforce or Einstein Copilot in the Salesforce Scratch org that we created from the Developer edition.
Conclusion
I hope you have got an idea about I Scratch Org in Salesforce and how to create Agentforce-enabled scratch orgs from Salesforce Developer Edition.
In that, I have explained how to create and enable a scratch org from a developer edition org and how to enable Agentforce in the scratch org. So, with the scratch orgs, it will be very helpful to use an agent-enabled org in Salesforce.
You may like to read:
- Build Sales Email Prompt Template in Salesforce Agentforce
- Create Custom Action Using Flow For Agentforce in Salesforce
- Agentforce for Developers in Salesforce
- Field Generation Prompt Template in Salesforce Agentforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.