---
title: "Create compute environment"
method: POST
path: "/compute-envs"
tags: ["compute-envs"]
---

# Create compute environment

`POST /compute-envs`

Creates a new compute environment. Append `?workspaceId` to create the environment in a workspace context.

## Query parameters

- `workspaceId` integer

## Request body

- CreateComputeEnvRequest
  - `computeEnv` ComputeEnvComputeConfig
    - `config` union, required
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `cliPath` string
        - `computeJobRole` string
        - `computeQueue` string
        - `dragenInstanceType` string
        - `dragenQueue` string
        - `executionRole` string
        - `forge` ForgeConfig
          - `allocStrategy` 'BEST_FIT' | 'BEST_FIT_PROGRESSIVE' | 'SPOT_CAPACITY_OPTIMIZED' | 'SPOT_PRICE_CAPACITY_OPTIMIZED'
          - `allowBuckets` string[]
          - `arm64Enabled` boolean
          - `bidPercentage` integer
          - `disposeOnDeletion` boolean
          - `dragenAmiId` string
          - `dragenEnabled` boolean
          - `dragenInstanceType` string
          - `ebsAutoScale` boolean
          - `ebsBlockSize` integer
          - `ebsBootSize` integer
          - `ec2KeyPair` string
          - `ecsConfig` string
          - `efsCreate` boolean
          - `efsId` string
          - `efsMount` string
          - `fargateHeadEnabled` boolean
          - `fsxMount` string
          - `fsxName` string
          - `fsxSize` integer
          - `fusionEnabled` boolean
          - `gpuEnabled` boolean
          - `imageId` string
          - `instanceTypes` string[]
          - `maxCpus` integer
          - `minCpus` integer
          - `securityGroups` string[]
          - `subnets` string[]
          - `type` 'SPOT' | 'EC2'
          - `vpcId` string
        - `forgedResources` object[]
        - `fusion2Enabled` boolean
        - `fusionSnapshots` boolean
        - `headJobCpus` integer
        - `headJobMemoryMb` integer
        - `headJobRole` string
        - `headQueue` string
        - `logGroup` string
        - `lustreId` string
        - `nvnmeStorageEnabled` boolean
        - `region` string
        - `storageType` string
        - `volumes` string[]
        - `waveEnabled` boolean
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `allowBuckets` string[]
        - `arm64Enabled` boolean
        - `ebsBootSize` integer
        - `ec2KeyPair` string
        - `forgedResources` object[]
        - `fusion2Enabled` boolean
        - `gpuEnabled` boolean
        - `imageId` string
        - `instanceProfileArn` string
        - `instanceType` string
        - `logGroup` string
        - `region` string
        - `schedConfig` SchedConfig
          - `provisioningModel` 'spot' | 'spotFirst' | 'ondemand'
        - `schedEnabled` boolean
        - `securityGroups` string[]
        - `subnetId` string
        - `waveEnabled` boolean
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `defaultDataRetentionPolicy` boolean
        - `instanceTypeSize` 'SMALL' | 'MEDIUM' | 'LARGE'
        - `region` string
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `bootDiskImage` string
        - `bootDiskSizeGb` integer
        - `computeJobsInstanceTemplate` string
        - `computeJobsMachineType` string[]
        - `copyImage` string
        - `cpuPlatform` string
        - `debugMode` integer
        - `fusion2Enabled` boolean
        - `fusionSnapshots` boolean
        - `headJobCpus` integer
        - `headJobInstanceTemplate` string
        - `headJobMemoryMb` integer
        - `labels` object
        - `location` string
        - `machineType` string
        - `network` string
        - `networkTags` string[]
        - `nfsMount` string
        - `nfsTarget` string
        - `projectId` string
        - `serviceAccount` string
        - `spot` boolean
        - `sshDaemon` boolean
        - `sshImage` string
        - `subnetwork` string
        - `usePrivateAddress` boolean
        - `waveEnabled` boolean
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `arm64Enabled` boolean
        - `bootDiskSizeGb` integer
        - `forgedResources` object[]
        - `fusion2Enabled` boolean
        - `gpuEnabled` boolean
        - `imageId` string
        - `instanceType` string
        - `projectId` string
        - `region` string
        - `serviceAccountEmail` string
        - `waveEnabled` boolean
        - `zone` string
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `autoPoolMode` boolean
        - `deleteJobsOnCompletion` 'on_success' | 'always' | 'never'
        - `deleteJobsOnCompletionEnabled` boolean, nullable
        - `deletePoolsOnCompletion` boolean
        - `deleteTasksOnCompletion` boolean, nullable
        - `forge` AzBatchForgeConfig
          - `autoScale` boolean
          - `containerRegIds` string[]
          - `disposeOnDeletion` boolean
          - `dualPoolConfig` boolean
          - `headPool` AzBatchPoolConfig — Azure Batch pool configuration for head or worker pool
            - `autoScale` boolean
            - `vmCount` integer
            - `vmType` string
          - `vmCount` integer
          - `vmType` string
          - `workerPool` AzBatchPoolConfig — Azure Batch pool configuration for head or worker pool
            - `autoScale` boolean
            - `vmCount` integer
            - `vmType` string
        - `fusion2Enabled` boolean
        - `headJobCpus` integer, nullable — Number of CPU slots reserved on the head pool VM for the Nextflow head job. Defaults to 1 so multiple head jobs can share a head pool VM; increase to dedicate more CPU and memory to each head job.
        - `headJobMemoryMb` integer, nullable — Memory in MiB reserved for the Nextflow head job container. When omitted, the value is derived from the head pool VM size as the per-slot share (vmMemory / vmCpus) multiplied by the requested slot count.
        - `headPool` string
        - `jobMaxWallClockTime` string, nullable — Maximum wall clock time for Azure Batch jobs before automatic termination. Accepts human-readable duration syntax (e.g., '7d', '1d1h1m'). Defaults to 7d when not specified. Maximum: 180 days.
        - `managedIdentityClientId` string, nullable
        - `managedIdentityHeadResourceId` string, nullable
        - `managedIdentityPoolClientId` string, nullable
        - `managedIdentityPoolResourceId` string, nullable
        - `region` string
        - `subnetId` string, nullable — Azure VNet subnet resource ID for private network isolation. Requires Entra (service principal) credentials.
        - `terminateJobsOnCompletion` boolean, nullable
        - `tokenDuration` string
        - `waveEnabled` boolean
        - `workerPool` string
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `dataCollectionEndpoint` string
        - `dataCollectionRuleId` string
        - `forgedResources` MapEntryStringString[]
          - `key` string
          - `value` string
        - `fusion2Enabled` boolean
        - `instanceType` string
        - `logTableName` string
        - `logWorkspaceId` string
        - `managedIdentityClientId` string
        - `managedIdentityId` string
        - `networkId` string
        - `region` string
        - `resourceGroup` string
        - `subscriptionId` string
        - `waveEnabled` boolean
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `computeQueue` string
        - `headJobOptions` string
        - `headQueue` string
        - `hostName` string
        - `launchDir` string
        - `maxQueueSize` integer
        - `perJobMemLimit` boolean
        - `perTaskReserve` boolean
        - `port` integer
        - `propagateHeadJobOptions` boolean
        - `unitForLimits` string
        - `userName` string
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `computeQueue` string
        - `headJobOptions` string
        - `headQueue` string
        - `hostName` string
        - `launchDir` string
        - `maxQueueSize` integer
        - `port` integer
        - `propagateHeadJobOptions` boolean
        - `userName` string
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `computeServiceAccount` string
        - `headJobCpus` integer
        - `headJobMemoryMb` integer
        - `headPodSpec` string
        - `headServiceAccount` string
        - `namespace` string
        - `podCleanup` 'on_success' | 'always' | 'never'
        - `server` string
        - `servicePodSpec` string
        - `sslCert` string
        - `storageClaimName` string
        - `storageMountPath` string
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `clusterName` string — The AWS EKS cluster name
        - `computeServiceAccount` string
        - `fusion2Enabled` boolean
        - `headJobCpus` integer
        - `headJobMemoryMb` integer
        - `headPodSpec` string
        - `headServiceAccount` string
        - `namespace` string
        - `podCleanup` 'on_success' | 'always' | 'never'
        - `region` string — AWS region
        - `server` string
        - `servicePodSpec` string
        - `sslCert` string
        - `storageClaimName` string
        - `storageMountPath` string
        - `waveEnabled` boolean
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `clusterName` string — The GKE cluster name
        - `computeServiceAccount` string
        - `fusion2Enabled` boolean
        - `headJobCpus` integer
        - `headJobMemoryMb` integer
        - `headPodSpec` string
        - `headServiceAccount` string
        - `namespace` string
        - `podCleanup` 'on_success' | 'always' | 'never'
        - `region` string — The GKE cluster region - or - zone
        - `server` string
        - `servicePodSpec` string
        - `sslCert` string
        - `storageClaimName` string
        - `storageMountPath` string
        - `waveEnabled` boolean
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `computeQueue` string
        - `headJobOptions` string
        - `headQueue` string
        - `hostName` string
        - `launchDir` string
        - `maxQueueSize` integer
        - `port` integer
        - `propagateHeadJobOptions` boolean
        - `userName` string
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `computeQueue` string
        - `headJobOptions` string
        - `headQueue` string
        - `hostName` string
        - `launchDir` string
        - `maxQueueSize` integer
        - `port` integer
        - `propagateHeadJobOptions` boolean
        - `userName` string
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `computeQueue` string
        - `headJobOptions` string
        - `headQueue` string
        - `hostName` string
        - `launchDir` string
        - `maxQueueSize` integer
        - `port` integer
        - `propagateHeadJobOptions` boolean
        - `userName` string
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `fusion2Enabled` boolean
        - `schedConfig` SchedConfig
          - `provisioningModel` 'spot' | 'spotFirst' | 'ondemand'
        - `schedEnabled` boolean
        - `waveEnabled` boolean
      - object
        - `discriminator` string — property to select the compute config platform
        - `environment` ConfigEnvVariable[]
          - `compute` boolean
          - `head` boolean
          - `name` string
          - `value` string
        - `nextflowConfig` string
        - `postRunScript` string — Add a script that executes after all Nextflow processes have completed. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `preRunScript` string — Add a script that executes in the nf-launch script prior to invoking Nextflow processes. See [Pre and post-run scripts](https://docs.seqera.io/platform-cloud/launch/advanced#pre-and-post-run-scripts).
        - `workDir` string — Compute environment working directory
        - `bootDiskSizeGb` integer
        - `copyImage` string
        - `debugMode` integer
        - `headJobCpus` integer
        - `headJobMemoryMb` integer
        - `labels` object
        - `location` string
        - `nfsMount` string
        - `nfsTarget` string
        - `preemptible` boolean
        - `projectId` string
        - `region` string
        - `sshDaemon` boolean
        - `sshImage` string
        - `usePrivateAddress` boolean
        - `zones` string[]
    - `credentialsId` string
    - `dateCreated` string, date-time
    - `deleted` boolean
    - `description` string
    - `id` string
    - `lastUpdated` string, date-time
    - `lastUsed` string, date-time
    - `message` string
    - `name` string, required
    - `orgId` integer
    - `platform` 'aws-batch' | 'aws-cloud' | 'seqeracompute-platform' | 'google-batch' | 'google-cloud' | 'azure-batch' | 'azure-cloud' | 'k8s-platform' | 'eks-platform' | 'gke-platform' | 'uge-platform' | 'slurm-platform' | 'lsf-platform' | 'altair-platform' | 'moab-platform' | 'local-platform' | 'google-lifesciences', required
    - `primary` boolean
    - `status` 'CREATING' | 'AVAILABLE' | 'DISABLED' | 'DELETING' | 'ERRORED' | 'INVALID' | 'DELETED'
    - `workspaceId` integer
  - `labelIds` integer[]

## Response `200`

OK

- CreateComputeEnvResponse
  - `computeEnvId` string

## Other responses

- `400` — Bad request
- `403` — Operation not allowed

## Changes

> 7 revisions in range; 1 not diffed.

- **2026-04-20** `b2b5cc41d473` — 2 breaking, 23 info
  - added `#/components/schemas/JobCleanupPolicy` to the `computeEnv/config/oneOf[subschema #6: Azure Batch configuration]/deleteJobsOnCompletion` request property `allOf` list
  - the `computeEnv/config/oneOf[subschema #4: Google Batch service configuration]/computeJobsMachineType` request property type/format changed from `string`/`` to `array`/``
  - added the new optional request property `computeEnv/config/oneOf[subschema #16: Local execution configuration]/schedConfig`
  - added the new optional request property `computeEnv/config/oneOf[subschema #2: AWS Cloud configuration]/schedConfig`
  - …21 more
- **2026-03-17** `58c125675f01` — 6 info
  - added the new optional request property `computeEnv/config/oneOf[subschema #2: AWS Cloud configuration]/schedEnabled`
  - added the new optional request property `computeEnv/config/oneOf[subschema #4: Google Batch service configuration]/bootDiskImage`
  - added the new optional request property `computeEnv/config/oneOf[subschema #4: Google Batch service configuration]/computeJobsMachineType`
  - added the new optional request property `computeEnv/config/oneOf[subschema #4: Google Batch service configuration]/networkTags`
  - …2 more
- …earlier changes not shown

[Full history](https://skmtc.dev/seqeralabs/apis/seqera-api/changes/compute-envs/post.md)

---

[API](https://skmtc.dev/seqeralabs/apis/seqera-api.md) · [All operations](https://skmtc.dev/seqeralabs/apis/seqera-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/seqeralabs/seqera-api/revisions/b2b5cc41d473/schema)
