---
title: "Pipeline"
url: https://docs.corefinity.com/guides/sites/code-and-deployments/pipeline-stages
type: guide
last_updated: 2026-11-13
feature: deployment-pipeline
related:
  - https://docs.corefinity.com/api/reference/deployments/clear-site-deployment-build-caches.md
  - https://docs.corefinity.com/api/reference/deployments/get-site-deployment-carried-over.md
  - https://docs.corefinity.com/api/reference/deployments/accept-site-deployment-carried-over.md
  - https://docs.corefinity.com/api/reference/deployments/update-site-deployment-options.md
  - https://docs.corefinity.com/api/reference/deployments/get-site-deployment-pipeline.md
  - https://docs.corefinity.com/api/reference/deployments/check-site-deployment-pipeline-lines.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_get.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_stage_update.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_settings_update.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_check.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_copy.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_versions_list.md
---
# Pipeline

See the stages a deployment runs through and change the commands and settings of each.

## Before you start

- You can open the site in **Managed Websites**. Anyone who can open a site can read its pipeline.
- To change the pipeline you are an owner, or your role has **Edit Environment Deployment Pipeline**.
- Each environment has its own pipeline: choose **Production** or **Staging** in the site header first.

## What each stage does

Go to **Managed Websites**, choose the site, then **Deployments** under **Code & backups**. The **Pipeline** card is under **Deployment mode**.

_Screenshot: The Pipeline card marked Three stages, with the Rehearse on Staging button at the top: the rows Build, Database, After deploy and Settings, each with a summary, a label saying From Corefinity's default or Changed here, and an Edit button._

| Row              | Where it runs                                         | What it holds                                                                                                               |
| ---------------- | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **Build**        | On the Corefinity build server                        | A **Preset** for the platform with your own commands around it, or **Custom commands**.                                     |
| **Database**     | In this environment, before the new release goes live | Your database commands and the maintenance page.                                                                            |
| **After deploy** | In this environment, once the new release is live     | Commands such as a cache flush. A failure here marks the deployment **Failed**, and the site keeps serving the new release. |
| **Settings**     |                                                       | The maintenance page, tunnels to the site's services during the build, scheduled tasks and the queue, and timeouts.         |

A row that reads **From Corefinity's default** follows a template and changes when the template does: see [Deployment templates](/guides/sites/code-and-deployments/deployment-templates).

## Change a stage

1. **Open the stage**

   Choose **Edit** on the stage's row. On a stage that follows a template, choose **Change for this environment**.

   _Screenshot: The Build stage of a Magento 2 site: the note that it comes from Corefinity's default, the Change for this environment button, Preset and Custom commands, the preset's fields and its three commands in order._

2. **Add commands and save**

   Enter one command per line, or choose one from **Insert a common command…**, then choose **Save**. The line under the editor counts your commands, and a line that cannot run is listed with the reason.

   _Screenshot: The After-deploy stage changed for this environment: one cache flush command in the editor, the count of commands under it, and the bar at the bottom with Discard and Save._

The next deployment of this environment runs the new stage. To follow the template again, open the stage and choose **Reset to template**.

> **Tip:** Try the change on Staging before it reaches Production: see [Rehearse a pipeline](/guides/sites/code-and-deployments/rehearse-a-pipeline).

## See the run order and earlier versions

1. **Open the run order**

   On the **Pipeline** card, open the **…** menu and choose **Run order and version history**. **Run order** numbers every step of a deployment, from the first build command to the last after-deploy command.

   _Screenshot: The Run order of a Magento 2 pipeline: numbered steps under the headings Build, Release, Database, Switch and After deploy, each with where it runs._

2. **Compare or restore a version**

   Choose **Versions**. Every save is a revision with who saved it and what changed: choose **Diff** to see the change, or **Restore this version** on an earlier revision to bring it back.

   _Screenshot: The Versions list of a pipeline: the newest revision marked Current above the earlier ones, each with when it was saved, by whom and what changed, a Diff link and, on most earlier revisions, Restore this version._

## Automate this

**API:** [Replace a stage of a pipeline](https://docs.corefinity.com/api/reference/deployments/replace-site-deployment-pipeline-stage.md), scope `write`

```bash
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/deployments/pipeline/2210/stages/post_deploy \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "lines": [
      "php artisan queue:restart",
      "php artisan config:cache"
    ],
    "revision": "413c6ef3a8a3ffe9"
  }'
```

**MCP:** [`corestack_deployments_pipeline_stage_update`](https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_stage_update.md), scope `write`

```json
{
  "name": "corestack_deployments_pipeline_stage_update",
  "arguments": {
    "site_id": 4211,
    "stage": "post_deploy",
    "revision": "r-8f2c",
    "lines": [
      "php artisan queue:restart"
    ]
  }
}
```

**Control Panel:** Managed Websites › your site › Code & backups › Deployments ([https://manage.corefinity.com/go/deployment-pipeline](https://manage.corefinity.com/go/deployment-pipeline))

## Related

- [Rehearse a pipeline](/guides/sites/code-and-deployments/rehearse-a-pipeline): Try a pipeline on Staging first.
- [Variables](/guides/sites/code-and-deployments/variables-and-secrets): Give deployment commands a value.
- [Deployment templates](/guides/sites/code-and-deployments/deployment-templates): Set the stages for a platform's sites.
