---
title: "Trigger Automation"
method: POST
path: "/v1/automations/{id}/trigger"
tags: ["Automation"]
---

# Trigger Automation

`POST /v1/automations/{id}/trigger`

Manually triggers an automation. Automations with a cron trigger can be triggered directly; automations with a GitHub `pull_request.command` trigger can be triggered against a specific pull request by passing `pr`. This creates a new workspace and execution.

## Path parameters

- `id` string, uuid, required

## Request body

- TriggerAutomationRequest — Request body for manually triggering an automation
  - `payload` object — Optional payload to pass to the automation execution
  - `pr` object — Run the automation against a specific pull request. Only allowed for automations with a GitHub `pull_request.command` trigger matching the repository. The PR context is injected into the prompt like any other PR-triggered run.
    - `repository_id` string, uuid, required — The Replicas repository UUID the pull request belongs to
    - `number` integer, required — The pull request number

## Response `200`

Automation triggered successfully

- TriggerAutomationResponse — Response after triggering an automation
  - `execution_id` string, uuid, required — Unique identifier for the execution
  - `workspace_id` string, uuid, nullable, required — The workspace created for this execution

## Other responses

- `400` — Bad request - Missing or invalid parameters
- `401` — Unauthorized - Invalid or missing API key
- `404` — Resource not found
- `500` — Internal server error

---

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