Subscribes to a Google Cloud Pub/Sub subscription and yields events.
from_google_cloud_pubsub project_id=string, subscription_id=string, [metadata_field=field]Description
Section titled “Description”The operator emits one event per Pub/Sub message with a single field message
containing the message payload as a string.
project_id = string
Section titled “project_id = string”The project to connect to. This must be the project ID, not the display name.
subscription_id = string
Section titled “subscription_id = string”The subscription to subscribe to.
metadata_field = field (optional)
Section titled “metadata_field = field (optional)”When set, delivery metadata is attached at the given field path. Each event then also contains a record with this schema:
{ message_id: string, // Pub/Sub message ID publish_time: time, // Message publish time attributes: { // Record containing all attributes of the message key: string ... }}Examples
Section titled “Examples”Consume messages and parse JSON
Section titled “Consume messages and parse JSON”from_google_cloud_pubsub project_id="amazing-project-123456", subscription_id="my-subscription"this = message.parse_json()Collect metadata alongside the message
Section titled “Collect metadata alongside the message”from_google_cloud_pubsub project_id="amazing-project-123456", subscription_id="my-subscription", metadata_field=metadata{ message: "some text", metadata: { message_id: "0", publish_time: 2025-12-12T17:05:07.324958101Z, attributes: {}, }}