# Defining a pool

Pools are defined by creating a pool definition file. The file can be placed in a directory within your repository. \\

The below configuration details a pool with tag 'DEV-POOL' allocated with 20 scratch orgs. Read on below to understand other configurations that are available

```
{
    "tag": "DEV-POOL",
    "maxAllocation": 20,
    "expiry": 10,
    "batchSize": 10,
    "configFilePath": "config/project-scratch-def.json",
    "relaxAllIPRanges": true,
    "installAll": true,
    "enableSourceTracking": true,
    "retryOnFailure": true,
    "succeedOnDeploymentErrors": true,
    "fetchArtifacts": {
        "npm": {
            "scope": "myproject",
    }
}
```

The latest JSON schema for scratch org pool configuration can be found[ here.](https://github.com/dxatscale/sfpowerscripts/blob/main/packages/core/resources/pooldefinition.schema.json)​\
\
The `pool prepare` command accepts a JSON configuration file that defines settings and attributes of the scratch org pool. The properties accepted by the configuration file are shown in the table below.

| Property                            | Type    | Description                                                                                                           |
| ----------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------- |
| tag                                 | string  | Name used to identify the scratch org pool                                                                            |
| waitTime                            | int     | Minutes the command should wait for a scratch org to be created, Default is 6 minutes                                 |
| expiry                              | int     | Number of days for which the scratch orgs are active                                                                  |
| maxAllocation                       | int     | Maximum capacity of the pool                                                                                          |
| batchSize                           | int     | Number of processes for creating scratch orgs in parallel                                                             |
| configFilePath                      | string  | Path to scratch org definition JSON file                                                                              |
| succeedOnDeploymentErrors           | boolean | Whether to persist scratch org to the pool for a deployment error, default:true                                       |
| snapshotPool                        | string  | Name of the earlier prepared scratch org pool that can be utilized by this pool, to prepare pools in multiple stages. |
| installAll                          | boolean | Install all package artifacts, in addition to the managed package dependencies                                        |
| releaseConfigFile                   | string  | Path to a release config file to create pools with selected packages. Use in conjunction with installAll              |
| enableSourceTracking                | boolean | Enable source tracking by deploying packages using source:push and persisting source tracking files                   |
| disableSourcePackageOverride        | boolean | Disable overriding unlocked packages as source packages, Rather install unlocked packages as unlocked                 |
| relaxAllIPRanges                    | boolean | Relax all IP addresses, allowing all global access to scratch orgs                                                    |
| ipRangesToBeRelaxed                 | array   | Range of IP addresses that can access the scratch orgs                                                                |
| retryOnFailure                      | boolean | Retry installation of a package on a failed deployment                                                                |
| maxRetryCount                       | number  | Maximum number of times a package should be retried while deploying to a scratchorg, The default is 2                 |
| preDependencyInstallationScriptPath | string  | Path to a script file that need to be executed before dependent packages are installed in a scratch org               |
| postDeploymentScriptPath            | string  | Path to a script file that need to be exectued after all the packages (dependencies+repository) is installed          |
| enableVlocity                       | boolean | Enable vlocity settings and config deployment. Please note it doesnt install vlocity managed package"                 |
| fetchArtifacts                      | object  | Fetch artifacts, to be deployed to scratch orgs, from an artifact registry                                            |
| fetchArtifacts.artifactFetchScript  | string  | Path to the shell script containing logic for fetching artifacts from a universal registry, if not using npm          |
| fetchArtifacts.npm                  | object  | Fetch artifacts from NPM registry                                                                                     |
| fetchArtifacts.npm.scope            | string  | Scope of the NPM package                                                                                              |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flxbl.io/flxbl/sfp/sfp-community/environment-management/pools/scratch-org-pools/defining-a-pool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
