Webhook configuration
Configure webhooks that start automated actions after Environment events.
Webhooks start automated actions at specified Environment states. Configure
them in environment.webhooks in lifecycle.yaml.
The Webhooks feature page contains examples and execution behavior.
See Webhooks for more information.
Shared fields
All webhook types share these 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 | Lifecycle reached the deployed state |
error | Build or deployment failed |
torn_down | Lifecycle destroyed the Environment |
Webhook types
codefresh
Triggers an existing Codefresh pipeline.
| Field | Type | Required | Description |
|---|---|---|---|
pipelineId | string | Yes | Codefresh pipeline ID |
trigger | string | Yes | Pipeline trigger name |
Set both pipelineId and trigger. If a value is missing, the webhook fails
when it runs.
docker
Runs a Docker image in 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 | Seconds, 1–86400 (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 | Seconds, 1–86400 (default: 1800) |
Template variables
Use template variables in env. For example, {{api_publicUrl}} inserts a
dynamic value from a Service.
See Template variables for the full list.
Lifecycle does not resolve cloud secret references in webhook env. The Job
or pipeline receives literal text for values such as
{{aws:path:key}}. Do not commit credentials or secret-bearing
webhook URLs. Use a credential-delivery mechanism supported by the target Job
or pipeline.