---
title: "create gcp trigger"
method: POST
path: "/w/{workspace}/gcp_triggers/create"
tags: ["gcp_trigger"]
---

# create gcp trigger

`POST /w/{workspace}/gcp_triggers/create`

## Path parameters

- `workspace` string, required

## Request body

- GcpTriggerData — Data for creating or updating a Google Cloud Pub/Sub trigger.
  - `gcp_resource_path` string, required — Path to the GCP resource containing service account credentials for authentication.
  - `subscription_mode` 'existing' | 'create_update', required — The mode of subscription. 'existing' means using an existing GCP subscription, while 'create_update' involves creating or updating a new subscription.
  - `topic_id` string, required — Google Cloud Pub/Sub topic ID to subscribe to.
  - `subscription_id` string — Google Cloud Pub/Sub subscription ID.
  - `base_endpoint` string — Base URL for push delivery endpoint.
  - `delivery_type` 'push' | 'pull' — Delivery mode for messages. 'push' for HTTP push delivery where messages are sent to a webhook endpoint, 'pull' for polling where the trigger actively fetches messages.
  - `delivery_config` PushConfig — Configuration for push delivery mode.
    - `audience` string — The audience claim for OIDC tokens used in push authentication.
    - `authenticate` boolean, required — If true, push messages will include OIDC authentication tokens.
  - `path` string, required — The unique Windmill path for this trigger. Must be of the form `u/<user>/<path>` or `f/<folder>/<path>`. This is the trigger object path, not the HTTP route path.
  - `script_path` string, required — Path to the script or flow to execute when a message is received.
  - `is_flow` boolean, required — True if script_path points to a flow, false if it points to a script.
  - `mode` 'enabled' | 'disabled' | 'suspended' — job trigger mode
  - `auto_acknowledge_msg` boolean — If true, automatically acknowledge messages after processing.
  - `ack_deadline` integer — Time in seconds within which the message must be acknowledged. If not provided, defaults to the subscription's acknowledgment deadline (600 seconds).
  - `error_handler_path` string — Path to a script or flow to run when the triggered job fails.
  - `error_handler_args` ScriptArgs — The arguments to pass to the script or flow
  - `retry` Retry — unresolved $ref
  - `permissioned_as` string — The user or group this trigger runs as. Used during deployment to preserve the original trigger owner.
  - `preserve_permissioned_as` boolean — When true and the caller is a member of the 'wm_deployers' group, preserves the original permissioned_as value instead of overwriting it.
  - `labels` string[]

## Response `201`

gcp trigger created

---

[API](https://skmtc.net/windmill/apis/windmill-api.md) · [All operations](https://skmtc.net/windmill/apis/windmill-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/windmill/windmill-api/revisions/5f7e0c3a8f59/schema)
