---
title: "corestack_deployment_trigger"
url: https://docs.corefinity.com/mcp/tools/corestack_deployment_trigger
type: tool
last_updated: 2026-11-13
feature: deployments
related:
  - https://docs.corefinity.com/api/reference/deployments/create-site-deployment.md
  - https://docs.corefinity.com/guides/sites/code-and-deployments/connect-a-repository.md
---
# corestack_deployment_trigger

**Deploy.** Deploy a row from its connected repository now — its branch, or a branch or commit you name. Scope: write. Long-running: answers with a task.

- Scope: `write`
- Runs as a task: yes

## When to use it

Deploy a row from its connected repository now — its branch, or a branch or commit you name. With several pipeline bindings on the environment, `binding_id` deploys another one than the repository's (`corestack_deployments_pipeline_get` lists them).

Check first with `corestack_deployments_shared_files_check` and tell the person what it found: a deployment stops at linking shared files when the settings file its platform needs (such as `.env` or `app/etc/env.php`) is in neither the shared folder nor the live release, unless the repository includes it, which no check can see before the build; the check names each missing file and where to create it over SFTP or SSH. It only advises: a deployment is never refused for its answer, so start when the person says so, whatever it found.

The call answers a task to follow. When the deployment fails, the task answers `work_failed` with the deployment row in `details`, and the row's `error` is the line the Control Panel shows: for example, a release holding a file that matches known malicious code is stopped before anything is built or changed, and `error` names the file.

With the pre-switch check on (the binding's deploy options), the new release is asked for its home page and up to five listed paths before it goes live; any answer but 200, 301 or 302 stops the deployment before the switch, the live release keeps serving, and `error` names the page and its answer (for example `/ answered 500`).

The first Git deployment of a converted or moved site takes the shared files and folders the live release still holds itself (its `.env`, its uploads, a Bedrock project's `.env` and `web/app/uploads`) into the site's shared folder in place: renamed and linked back, never copied, so the live site keeps them whatever happens. An empty shared folder or file is set aside for them, never removed. It stops before the switch, with `error` saying why, when a shared path holds different content in the live release and in the shared folder (the counts are named; nothing is merged), when the live release reaches it through a link, or when a Bedrock release cannot reach its database. Only a database connection error stops a Bedrock release there (unless the pre-switch check option is on, which stops on any failure): when its WordPress cannot be asked (no WP-CLI, too little memory) or answers anything else, for example because WordPress is not installed in a new database yet, the deployment carries on and the step's output says it was not checked.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `ref` (string, up to 255 characters): A branch or a commit SHA; the connected branch when left out.
- `binding_id` (integer, ≥ 1): Another pipeline binding of the same environment; the repository's when left out.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "binding_id": {
      "description": "Another pipeline binding of the same environment; the repository's when left out.",
      "minimum": 1,
      "type": "integer"
    },
    "ref": {
      "description": "A branch or a commit SHA; the connected branch when left out.",
      "maxLength": 255,
      "type": "string"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "site_id"
  ],
  "type": "object"
}
```

## Refusals

- `forbidden`: the person's role lacks the Create Deployments permission. The message names it and says an owner of the
  company can grant it in Roles; `details.permission` is `createDeployments`. Nothing is changed.
- `pipeline_untranslated`: the pipeline carried over from CoreStack Enterprise is not translated yet; contact support.
- `pipeline_review_pending`: pipeline lines carried over are waiting for review; accept them (corestack_deployments_carryover_accept) first.
- `pipeline_switched_off`: the deployment pipeline this binding needs is switched off; the person should contact Corefinity.
- `tunnels_switched_off`: the build needs tunnels, which are switched off right now; try again later.
- `feature_off`: choosing a binding is not available yet; deploy without `binding_id`.
- `runtime_not_adopted`: the build needs tunnels, which need the row's adopted runtime; adopt it with corestack_runtime_adopt first.
- `invalid_arguments` with `detail_reason` `no_repository` (message: "Connect a repository first"): the site has no repository connected, so there is nothing to deploy; connect one with corestack_deployments_repository_set first. Nothing is created. The `reason` is the one this refusal has always answered; `detail_reason` names it.
- `needs_reauth`: the repository's connection is gone, or no longer belongs to the site's company ("This repository connection no longer belongs to this site's company. Connect the repository again."); bind the repository again through one of the site's own connections (corestack_deployments_repository_set). Nothing is created.
- `site_content_off`: the row's repository holds site content and Corefinity has paused deploying it ("Deploying site content is paused by Corefinity. Nothing was changed."); try again later, or set the repository to `whole_site` with corestack_deployments_repository_set if it holds the whole site. Nothing is created.
- `managed_elsewhere` (message: "This site is managed by another control panel"): another control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_deployment_trigger",
  "arguments": {
    "site_id": 4211,
    "ref": "main"
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_deployment_trigger with site_id 4211, ref main. (Deploy.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [POST /api/corestack/sites/{site}/deployments](https://docs.corefinity.com/api/reference/deployments/create-site-deployment.md)
- Guide: [Connect a repository](https://docs.corefinity.com/guides/sites/code-and-deployments/connect-a-repository.md)
