Webhooks Configuration
Schema reference for configuring webhooks to automate actions on deployment events
Webhooks allow you to trigger automated actions when an environment reaches certain states. They are configured under environment.webhooks in your lifecycle.yaml.
For detailed use cases, examples, and execution behavior, see the Webhooks guide.
Common Fields
All webhook types share these common fields:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Human-readable name for the webhook |
description | string | No | Description of what the webhook does |
state | string | Yes | Trigger state: deployed, error, or torn_down |
type | string | Yes | Webhook type: codefresh, docker, or command |
env | object | Yes | Environment variables passed to the webhook |
Trigger States
| State | Description |
|---|---|
deployed | All services successfully deployed and running |
error | Build or deployment failed |
torn_down | Environment has been destroyed |
Webhook Types
codefresh
Triggers an existing Codefresh pipeline.
| Field | Type | Required | Description |
|---|---|---|---|
pipelineId | string | Yes | Codefresh pipeline ID |
trigger | string | No | Pipeline trigger name |
docker
Runs a Docker image as a Kubernetes job.
| Field | Type | Required | Description |
|---|---|---|---|
docker.image | string | Yes | Docker image to execute |
docker.command | array | No | Override entrypoint command |
docker.args | array | No | Arguments to pass to the command |
docker.timeout | number | No | Max execution time in seconds (default: 1800) |
command
Runs a shell script in a specified Docker image.
| Field | Type | Required | Description |
|---|---|---|---|
command.image | string | Yes | Docker image to run the script in |
command.script | string | Yes | Shell script to execute |
command.timeout | number | No | Max execution time in seconds (default: 1800) |
Template Variables
You can use template variables like {{api_publicUrl}} in the env section to reference dynamic values from your services.
See the Template Variables guide for the complete list of available variables.