Skip to content

deployment_service_create

Create a service inside an environment.

Tool

deployment_service_create

Create a service inside an environment.

Create a service in an existing environment from a git branch, a container image, or a static build. Requires product-scoped write access. Choose persistent mode for a running service or scheduled mode for a job; mode cannot change after creation. Returns: `{ id, environmentId, name, slug, source, ... }` — a service object, not a deployment id. Typical sequence: deployment_service_create → deployment_deployment_list with the returned service id → deployment_deployment_get with a deployment id from that list. Fails when: scheduled mode is combined with containerPort, replicas, or scaleToZero. Replace the example environmentId with your environment's UUID.

Arguments

NameTypeRequiredDescription
modestringpersistent keeps a service running; scheduled runs a job. Cannot change after creation.default: persistent
namestringService name, 1–80 characters. The example uses api.
slugstringURL slug, 1–40 characters.
canvasobjectPosition on the environment canvas, with numeric x and y fields.
probesobjectReadiness and liveness checks. Each configured check requires a path starting with /; timing fields use seconds.default: {}
sourceobjectSource object: type is git, image, or static. Git requires branch; image requires registry and tag. The example uses the main branch; replace it with your branch and supply the repository details for your source.
commandstring | nullShell command for a scheduled run, 1–4096 characters. Omit it or use null to run the image entrypoint.
tracingstringTracing instrumentation: off, node, or python. Applied when a deployment builds the workload.default: off
replicasintegerNumber of replicas, 0–50. Persistent mode only.
schedulestring | nullFive-field UTC cron expression: minute hour day-of-month month day-of-week. Use null for a job that runs only on demand.
resourcesobjectCPU and memory limits, supplied as strings in limits.cpu and limits.memory.
containerPortintegerContainer port, 1–65535. Persistent mode only.
environmentIdstringUUID of the existing environment. Replace the example UUID with yours.
jobTimeoutSecintegerMaximum duration of a scheduled run, in seconds, from 60 to 86400. A run exceeding this limit is terminated.
jobConcurrencystringWhen a previous run is still active: forbid skips the next run, allow runs both, and replace terminates the previous run.

Try it

Create a service called api in my staging environment from the main branch of my repo.

When to use

Create a service in an existing environment from a git branch, a container image, or a static build. Requires product-scoped write access. Choose persistent mode for a running service or scheduled mode for a job; mode cannot change after creation. Returns: `{ id, environmentId, name, slug, source, ... }` — a service object, not a deployment id. Typical sequence: deployment_service_create → deployment_deployment_list with the returned service id → deployment_deployment_get with a deployment id from that list. Fails when: scheduled mode is combined with containerPort, replicas, or scaleToZero. Replace the example environmentId with your environment's UUID.

Example

Ask your agent something like this:

Create a service called api in my staging environment from the main branch of my repo.

The agent will invoke deployment_service_create with these arguments:

{
  "environmentId": "11111111-1111-4111-8111-111111111111",
  "name": "api",
  "source": {
    "type": "git",
    "branch": "main"
  }
}

Esc

Start typing to search the docs.

navigateselect