DocsLifecycle schemaWebhook configuration

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:

FieldTypeRequiredDescription
namestringNoHuman-readable name for the webhook
descriptionstringNoDescription of what the webhook does
statestringYesTrigger state: deployed, error, or torn_down
typestringYesWebhook type: codefresh, docker, or command
envobjectYesEnvironment variables passed to the webhook

Trigger States

StateDescription
deployedLifecycle reached the deployed state
errorBuild or deployment failed
torn_downLifecycle destroyed the Environment

Webhook types

codefresh

Triggers an existing Codefresh pipeline.

FieldTypeRequiredDescription
pipelineIdstringYesCodefresh pipeline ID
triggerstringYesPipeline 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.

FieldTypeRequiredDescription
docker.imagestringYesDocker image to execute
docker.commandarrayNoOverride entrypoint command
docker.argsarrayNoArguments to pass to the command
docker.timeoutnumberNoSeconds, 1–86400 (default: 1800)

command

Runs a shell script in a specified Docker image.

FieldTypeRequiredDescription
command.imagestringYesDocker image to run the script in
command.scriptstringYesShell script to execute
command.timeoutnumberNoSeconds, 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.