# Autessa Pipelines

Source: https://docs.autessa.com/docs/cdk/pipelines

> Autessa Pipelines, under Build, deploys your Autessa CDK project from GitHub through dev and prod stages with automatic, test-gated or manual promotion and one-click rollback.

# Autessa Pipelines

(Preview)

Autessa Pipelines and the deploy API are in preview. Names and shapes may change before they are generally available.

Pipelines run your Autessa CDK project inside Autessa. Push to GitHub, and the pipeline runs build, diff and deploy for each stage in order, with the promotion rule you choose between stages.

## When to use it

- You want deploys without writing CI workflows.
- You want run history, approvals and rollback in the same place as your agents and apps.
- You want a release to wait until your evals pass.

Already using GitHub Actions? The [deploy action](/docs/cdk/deploy-action.md) runs the same commands.

## Navigating here

Open **Build → Pipelines**.

## Quickstart

1. In **Build → Pipelines**, create a pipeline. Pick the repository and branch.
2. Add stages in order, for example `dev` then `prod`. Each stage maps to a stage in `autessa.stages.yaml`.
3. Choose a promotion rule between each pair of stages.
4. Copy the webhook URL and secret into your GitHub repository's webhook settings, for push events.
5. Push a commit. A run starts.

## Promotion rules

| Rule | What happens at the stage boundary |
| --- | --- |
| `AUTO` | The run moves on as soon as the stage deploys. |
| `AFTER_TESTS` | The run moves on only when an eval scorecard meets your threshold, such as a minimum block rate or grading pass rate. See [Evaluations](/docs/features/evaluations.md). |
| `MANUAL` | A person approves the promotion in the UI. |

## Runs

Each run lists its stages in order, with each stage's status, promotion rule and the deployment it created. A stage's status is one of `PENDING`, `RUNNING`, `WAITING_APPROVAL`, `SUCCEEDED`, `FAILED`, `SKIPPED` or `ROLLED_BACK`. Stages promoted `AFTER_TESTS` also carry the eval scorecard.

- **Promote** moves a waiting run on to the named stage.
- **Roll back** returns a stage to an earlier deployment.

## Start a run from your own CI

You can name a Git ref, or upload the project as a `.tar.gz` (multipart field `project`), instead of using the webhook. Use a deploy key or an API key.

```bash
curl -X POST "https://api.autessa.com/clients/pipelines/V1StGXR8Z5/runs" \
  -H "Authorization: $AUTESSA_DEPLOY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ref":"main"}'
```

| Endpoint | What it does |
| --- | --- |
| `POST /clients/pipelines/{pipelineId}/webhook/github` | The GitHub push webhook. Signed with the pipeline's secret (`X-Hub-Signature-256`). |
| `POST /clients/pipelines/{pipelineId}/runs` | Start a run from an upload or a ref. |
| `GET /clients/pipelines/{pipelineId}/runs` | List runs. |
| `GET /clients/pipelines/{pipelineId}/runs/{runId}` | Get one run. |
| `POST /clients/pipelines/{pipelineId}/runs/{runId}/promote` | Promote to a stage. Body: `{"stage": "prod"}`. |
| `POST /clients/pipelines/{pipelineId}/runs/{runId}/rollback` | Roll a stage back. Body: `{"stage": "prod"}`. |

Full details: [Pipelines API](/docs/reference/pipelines.md).

## Related

- [Autessa CDK](/docs/cdk.md)
- [Commands](/docs/cdk/commands.md)
- [Deploy action](/docs/cdk/deploy-action.md)
- [Evaluations](/docs/features/evaluations.md)

