---
title: "POST /v1/{+workflow}:triggerPubsubExecution"
method: POST
path: "/v1/{+workflow}:triggerPubsubExecution"
tags: ["projects"]
---

# POST /v1/{+workflow}:triggerPubsubExecution

`POST /v1/{+workflow}:triggerPubsubExecution`

Triggers a new execution using the latest revision of the given workflow by a Pub/Sub push notification.

## Path parameters

- `workflow` string, required

## Request body

- TriggerPubsubExecutionRequest — Request for the TriggerPubsubExecution method.
  - `subscription` string — Required. The subscription of the Pub/Sub push notification. Format: projects/{project}/subscriptions/{sub}
  - `message` PubsubMessage — A message that is published by publishers and consumed by subscribers. The message must contain either a non-empty data field or at least one attribute. Note that client libraries represent this object differently depending on the language. See the corresponding [client library documentation](https://cloud.google.com/pubsub/docs/reference/libraries) for more information. See [quotas and limits] (https://cloud.google.com/pubsub/quotas) for more information about message limits.
    - `attributes` object — Optional. Attributes for this message. If this field is empty, the message must contain non-empty data. This can be used to filter messages on the subscription.
    - `publishTime` string, google-datetime — The time at which the message was published, populated by the server when it receives the `Publish` call. It must not be populated by the publisher in a `Publish` call.
    - `orderingKey` string — Optional. If non-empty, identifies related messages for which publish order should be respected. If a `Subscription` has `enable_message_ordering` set to `true`, messages published with the same non-empty `ordering_key` value will be delivered to subscribers in the order in which they are received by the Pub/Sub system. All `PubsubMessage`s published in a given `PublishRequest` must specify the same `ordering_key` value. For more information, see [ordering messages](https://cloud.google.com/pubsub/docs/ordering).
    - `data` string, byte — Optional. The message data field. If this field is empty, the message must contain at least one attribute.
    - `messageId` string — ID of this message, assigned by the server when the message is published. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a `PubsubMessage` via a `Pull` call or a push delivery. It must not be populated by the publisher in a `Publish` call.
  - `GCPCloudEventsMode` string — Required. LINT: LEGACY_NAMES The query parameter value for __GCP_CloudEventsMode, set by the Eventarc service when configuring triggers.
  - `deliveryAttempt` integer — The number of attempts that have been made to deliver this message. This is set by Pub/Sub for subscriptions that have the "dead letter" feature enabled, and hence provided here for compatibility, but is ignored by Workflows.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/workflowexecutions.md) · [All operations](https://skmtc.dev/google/apis/workflowexecutions/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/workflowexecutions/revisions/f7306ae7ff72/schema)
