# Google Cloud Pub/Sub

> Publish and read messages on Google Cloud Pub/Sub, and manage topics, subscriptions and snapshots. Start a workflow for each new message on a subscription, or when a topic or subscription is created.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/google-cloud-pubsub

## Actions

### Acknowledge messages

Mark messages from 'Pull messages' as handled, so Pub/Sub doesn't deliver them again.

**Inputs**

- Subscription (`subscription`, text, required): The pull subscription to read from. Pick one, or give its name from an earlier step.
- Messages (`ack_ids`, list, required): The ack_id of each message, from 'Pull messages' (or the pulled messages themselves).

**Outputs**

- `acknowledged` (number): How many
- `subscription` (text): The subscription's full name

**Example output**

```json
{
  "acknowledged": 1,
  "subscription": "projects/acme-prod/subscriptions/orders-lodol"
}
```

### Check message against schema

Check that a JSON message fits a schema, without publishing it.

**Inputs**

- Schema (`schema`, text, required): The schema to check against.
- Message (`message`, text, required): The message, as JSON.

**Outputs**

- `problem` (text): Why it doesn't fit, in Pub/Sub's words
- `schema` (text): The schema's full name
- `valid` (true/false): Whether the message fits the schema

**Example output**

```json
{
  "problem": "",
  "schema": "projects/acme-prod/schemas/order",
  "valid": true
}
```

### Create snapshot

Save which messages a subscription has handled, to go back to later with 'Replay or skip messages'. Snapshots last at most 7 days.

**Inputs**

- Name (`name`, text, required): The new snapshot's name, such as orders-before-deploy.
- Subscription (`subscription`, text, required): The subscription. Pick one, or give its name from an earlier step.
- Labels (`labels`, object): Labels to give it, such as team: billing. Lowercase letters, numbers, - and _ only.

**Outputs**

- `snapshot` (object): A snapshot

**Example output**

```json
{
  "snapshot": {
    "expire_time": "2026-11-25T09:30:00Z",
    "labels": {},
    "name": "projects/acme-prod/snapshots/orders-before-deploy",
    "snapshot_id": "orders-before-deploy",
    "topic": "projects/acme-prod/topics/orders"
  }
}
```

### Create subscription

Create a pull subscription that receives every message published to a topic from now on.

**Inputs**

- Name (`name`, text, required): The new subscription's name, such as orders-lodol: letters, numbers and - _ . ~ + %, starting with a letter.
- Topic (`topic`, text, required): The topic. Pick one, or give its name from an earlier step.
- Seconds to acknowledge (`ack_deadline_seconds`, number): How long a pulled message has to be acknowledged before Pub/Sub sends it again, 10 to 600 seconds. Pub/Sub's default is 10. From 10 to 600.
- Keep messages for (days) (`retention_days`, number): Keep unacknowledged messages this many days, 1 to 31. Pub/Sub's default is 7. From 1 to 31.
- Only messages where (`message_filter`, text): A filter on attributes, such as attributes.type = "order". It can't be changed later.
- Message ordering (`message_ordering`, true/false): Deliver messages with the same ordering key in the order they were sent.
- Keep acknowledged messages (`retain_acked_messages`, true/false): Keep messages after they're acknowledged, so 'Replay or skip messages' can deliver them again.
- Exactly-once delivery (`exactly_once_delivery`, true/false): Never send a message again once it's acknowledged, or before its deadline passes.
- Dead-letter topic (`dead_letter_topic`, text): Where to send messages that fail too many times. Pub/Sub's own service account needs permission to publish there.
- Tries before dead-lettering (`max_delivery_attempts`, number): How many tries a message gets first, 5 to 100. Defaults to 5. From 5 to 100.
- Delete when unused for (days) (`expires_after_days`, number): Days with no one reading before Pub/Sub deletes the subscription, or 0 to keep it for good. Pub/Sub's default is 31. From 0 to 365.
- Labels (`labels`, object): Labels to give it, such as team: billing. Lowercase letters, numbers, - and _ only.

**Outputs**

- `subscription` (object): A subscription

**Example output**

```json
{
  "subscription": {
    "ack_deadline_seconds": 60,
    "dead_letter_topic": "",
    "delivery_type": "pull",
    "detached": false,
    "exactly_once_delivery": false,
    "expires_after_days": 31,
    "filter": "",
    "labels": {
      "team": "billing"
    },
    "max_delivery_attempts": 0,
    "message_ordering": false,
    "message_retention_days": 7,
    "name": "projects/acme-prod/subscriptions/orders-lodol",
    "retain_acked_messages": false,
    "state": "ACTIVE",
    "subscription_id": "orders-lodol",
    "topic": "projects/acme-prod/topics/orders",
    "topic_id": "orders"
  }
}
```

### Create topic

Create a topic to publish messages to.

**Inputs**

- Name (`name`, text, required): The new topic's name, such as orders: letters, numbers and - _ . ~ + %, starting with a letter.
- Labels (`labels`, object): Labels to give it, such as team: billing. Lowercase letters, numbers, - and _ only.
- Keep messages for (days) (`retention_days`, number): Keep published messages this many days (1 to 31) so subscriptions can replay them. Leave empty not to. From 1 to 31.

**Outputs**

- `topic` (object): A topic

**Example output**

```json
{
  "topic": {
    "kms_key_name": "",
    "labels": {
      "team": "billing"
    },
    "message_retention_days": 0,
    "name": "projects/acme-prod/topics/orders",
    "schema": "",
    "state": "ACTIVE",
    "topic_id": "orders"
  }
}
```

### Delete snapshot

Delete a snapshot.

**Inputs**

- Snapshot (`snapshot`, text, required): The snapshot. Pick one, or give its name from an earlier step.

**Outputs**

- `deleted` (true/false): Always true once done
- `snapshot` (text): The full name of the snapshot deleted

**Example output**

```json
{
  "deleted": true,
  "snapshot": "projects/acme-prod/snapshots/orders-before-deploy"
}
```

### Delete subscription

Delete a subscription and the messages waiting on it.

**Inputs**

- Subscription (`subscription`, text, required): The subscription. Pick one, or give its name from an earlier step.

**Outputs**

- `deleted` (true/false): Always true once done
- `subscription` (text): The full name of the subscription deleted

**Example output**

```json
{
  "deleted": true,
  "subscription": "projects/acme-prod/subscriptions/orders-lodol"
}
```

### Delete topic

Delete a topic. Its subscriptions stay but stop receiving messages.

**Inputs**

- Topic (`topic`, text, required): The topic. Pick one, or give its name from an earlier step.

**Outputs**

- `deleted` (true/false): Always true once done
- `topic` (text): The full name of the topic deleted

**Example output**

```json
{
  "deleted": true,
  "topic": "projects/acme-prod/topics/orders"
}
```

### Get subscription

Get a subscription's settings: its topic, deadline, filter and dead-letter topic.

**Inputs**

- Subscription (`subscription`, text, required): The subscription. Pick one, or give its name from an earlier step.

**Outputs**

- `subscription` (object): A subscription

**Example output**

```json
{
  "subscription": {
    "ack_deadline_seconds": 60,
    "dead_letter_topic": "",
    "delivery_type": "pull",
    "detached": false,
    "exactly_once_delivery": false,
    "expires_after_days": 31,
    "filter": "",
    "labels": {
      "team": "billing"
    },
    "max_delivery_attempts": 0,
    "message_ordering": false,
    "message_retention_days": 7,
    "name": "projects/acme-prod/subscriptions/orders-lodol",
    "retain_acked_messages": false,
    "state": "ACTIVE",
    "subscription_id": "orders-lodol",
    "topic": "projects/acme-prod/topics/orders",
    "topic_id": "orders"
  }
}
```

### Get topic

Get a topic's settings and labels.

**Inputs**

- Topic (`topic`, text, required): The topic. Pick one, or give its name from an earlier step.

**Outputs**

- `topic` (object): A topic

**Example output**

```json
{
  "topic": {
    "kms_key_name": "",
    "labels": {
      "team": "billing"
    },
    "message_retention_days": 0,
    "name": "projects/acme-prod/topics/orders",
    "schema": "",
    "state": "ACTIVE",
    "topic_id": "orders"
  }
}
```

### Give messages more time

Give pulled messages more time before Pub/Sub delivers them again, or set 0 to hand them back now.

**Inputs**

- Subscription (`subscription`, text, required): The pull subscription to read from. Pick one, or give its name from an earlier step.
- Messages (`ack_ids`, list, required): The ack_id of each message, from 'Pull messages' (or the pulled messages themselves).
- Seconds from now (`seconds`, number, required): How long until Pub/Sub may deliver them again, 0 to 600. 0 hands them back straight away. From 0 to 600.

**Outputs**

- `messages` (number): How many messages
- `seconds` (number): The new deadline
- `subscription` (text): The subscription's full name

**Example output**

```json
{
  "messages": 1,
  "seconds": 120,
  "subscription": "projects/acme-prod/subscriptions/orders-lodol"
}
```

### List schemas

List the message schemas in your project.

**Inputs**

- How many (`limit`, number): The most to return, up to 1,000. Defaults to 100. From 1 to 1000.

**Outputs**

- `count` (number): How many schemas were returned
- `schemas` (list): The schemas

**Example output**

```json
{
  "count": 1,
  "schemas": [
    {
      "name": "projects/acme-prod/schemas/order",
      "revision_id": "a1b2c3d4",
      "schema_id": "order",
      "type": "AVRO"
    }
  ]
}
```

### List snapshots

List the snapshots in your project.

**Inputs**

- How many (`limit`, number): The most to return, up to 1,000. Defaults to 100. From 1 to 1000.

**Outputs**

- `count` (number): How many snapshots were returned
- `snapshots` (list): The snapshots

**Example output**

```json
{
  "count": 1,
  "snapshots": [
    {
      "expire_time": "2026-11-25T09:30:00Z",
      "labels": {},
      "name": "projects/acme-prod/snapshots/orders-before-deploy",
      "snapshot_id": "orders-before-deploy",
      "topic": "projects/acme-prod/topics/orders"
    }
  ]
}
```

### List subscriptions

List the subscriptions in your project, or those on one topic.

**Inputs**

- Topic (`topic`, text): Only subscriptions on this topic. Leave empty for all.
- How many (`limit`, number): The most to return, up to 1,000. Defaults to 100. From 1 to 1000.

**Outputs**

- `count` (number): How many subscriptions were returned
- `subscriptions` (list): The subscriptions

**Example output**

```json
{
  "count": 1,
  "subscriptions": [
    {
      "ack_deadline_seconds": 60,
      "dead_letter_topic": "",
      "delivery_type": "pull",
      "detached": false,
      "exactly_once_delivery": false,
      "expires_after_days": 31,
      "filter": "",
      "labels": {
        "team": "billing"
      },
      "max_delivery_attempts": 0,
      "message_ordering": false,
      "message_retention_days": 7,
      "name": "projects/acme-prod/subscriptions/orders-lodol",
      "retain_acked_messages": false,
      "state": "ACTIVE",
      "subscription_id": "orders-lodol",
      "topic": "projects/acme-prod/topics/orders",
      "topic_id": "orders"
    }
  ]
}
```

### List topics

List the topics in your project.

**Inputs**

- How many (`limit`, number): The most to return, up to 1,000. Defaults to 100. From 1 to 1000.

**Outputs**

- `count` (number): How many topics were returned
- `topics` (list): The topics

**Example output**

```json
{
  "count": 1,
  "topics": [
    {
      "kms_key_name": "",
      "labels": {
        "team": "billing"
      },
      "message_retention_days": 0,
      "name": "projects/acme-prod/topics/orders",
      "schema": "",
      "state": "ACTIVE",
      "topic_id": "orders"
    }
  ]
}
```

### Publish message

Send a message to a topic, for every subscription on it to receive.

**Inputs**

- Topic (`topic`, text, required): The topic. Pick one, or give its name from an earlier step.
- Message (`message`, text): The message text, such as JSON. Can be left empty when attributes are given.
- Attributes (`attributes`, object): Name and value pairs sent with the message, such as type: order. Subscriptions can filter on them.
- Ordering key (`ordering_key`, text): Messages with the same key, such as a customer ID, arrive in the order they were sent, on subscriptions with message ordering on.

**Outputs**

- `message_id` (text): The new message's ID
- `topic` (text): The full name of the topic it went to

**Example output**

```json
{
  "message_id": "13792847109283",
  "topic": "projects/acme-prod/topics/orders"
}
```

### Pull messages

Read messages waiting on a pull subscription. They're acknowledged unless you turn that off, so they aren't delivered again.

**Inputs**

- Subscription (`subscription`, text, required): The pull subscription to read from. Pick one, or give its name from an earlier step.
- At most (`max_messages`, number): The most messages to read, up to 1,000. Defaults to 10; Pub/Sub may return fewer. From 1 to 1000.
- Acknowledge them (`auto_acknowledge`, true/false): Mark the messages handled straight away (on by default). Turn off to acknowledge them in a later step, before the subscription's deadline. Default: `true`.

**Outputs**

- `acknowledged` (true/false): Whether the messages were acknowledged
- `count` (number): How many messages were returned
- `messages` (list): The messages read

**Example output**

```json
{
  "acknowledged": true,
  "count": 1,
  "messages": [
    {
      "ack_id": "RVNEUAYWLF1GSFE3GQhoUQ5PXiM_NSAoRRIJB08CKF15MEorQVh0Dk",
      "attributes": {
        "type": "order"
      },
      "data": "{\"order_id\": \"A-1001\", \"total\": 42.5}",
      "data_encoding": "text",
      "delivery_attempt": 0,
      "message_id": "13792847109283",
      "ordering_key": "",
      "publish_time": "2026-11-18T09:30:00.123Z"
    }
  ]
}
```

### Replay or skip messages

Move a subscription to a moment or a snapshot: messages published before it count as handled, later ones are delivered again.

**Inputs**

- Subscription (`subscription`, text, required): The subscription. Pick one, or give its name from an earlier step.
- To this time (`to_time`, date and time): Skip everything before this moment, and replay what came after it (only messages the subscription still keeps). Give this or a snapshot.
- To this snapshot (`snapshot`, text): Go back to the state a snapshot saved. Give this or a time.

**Outputs**

- `snapshot` (text): The snapshot it was moved to, if one was given
- `subscription` (text): The subscription's full name
- `time` (text): The moment it was moved to, if a time was given

**Example output**

```json
{
  "snapshot": "",
  "subscription": "projects/acme-prod/subscriptions/orders-lodol",
  "time": "2026-11-18T09:00:00Z"
}
```

### Update subscription

Change a subscription's settings or add labels. Fields left empty stay as they are.

**Inputs**

- Subscription (`subscription`, text, required): The subscription. Pick one, or give its name from an earlier step.
- Seconds to acknowledge (`ack_deadline_seconds`, number): How long a pulled message has to be acknowledged before Pub/Sub sends it again, 10 to 600 seconds. Pub/Sub's default is 10. From 10 to 600.
- Keep messages for (days) (`retention_days`, number): Keep unacknowledged messages this many days, 1 to 31. From 1 to 31.
- Keep acknowledged messages (`retain_acked_messages`, true/false): Keep messages after they're acknowledged, so 'Replay or skip messages' can deliver them again.
- Exactly-once delivery (`exactly_once_delivery`, true/false): Never send a message again once it's acknowledged, or before its deadline passes.
- Dead-letter topic (`dead_letter_topic`, text): Where to send messages that fail too many times. Pub/Sub's own service account needs permission to publish there.
- Tries before dead-lettering (`max_delivery_attempts`, number): How many tries a message gets first, 5 to 100. Defaults to 5. From 5 to 100.
- Delete when unused for (days) (`expires_after_days`, number): Days with no one reading before Pub/Sub deletes the subscription, or 0 to keep it for good. Pub/Sub's default is 31. From 0 to 365.
- Labels (`labels`, object): Labels to add or change, such as team: billing. Lowercase letters, numbers, - and _ only.

**Outputs**

- `subscription` (object): A subscription

**Example output**

```json
{
  "subscription": {
    "ack_deadline_seconds": 60,
    "dead_letter_topic": "",
    "delivery_type": "pull",
    "detached": false,
    "exactly_once_delivery": false,
    "expires_after_days": 31,
    "filter": "",
    "labels": {
      "team": "billing"
    },
    "max_delivery_attempts": 0,
    "message_ordering": false,
    "message_retention_days": 7,
    "name": "projects/acme-prod/subscriptions/orders-lodol",
    "retain_acked_messages": false,
    "state": "ACTIVE",
    "subscription_id": "orders-lodol",
    "topic": "projects/acme-prod/topics/orders",
    "topic_id": "orders"
  }
}
```

### Update topic

Add labels to a topic, or change how long it keeps messages. Fields left empty stay as they are.

**Inputs**

- Topic (`topic`, text, required): The topic. Pick one, or give its name from an earlier step.
- Labels (`labels`, object): Labels to add or change, such as team: billing. Lowercase letters, numbers, - and _ only.
- Keep messages for (days) (`retention_days`, number): Keep published messages this many days (1 to 31), or 0 to stop keeping them. From 0 to 31.

**Outputs**

- `changed` (true/false): False if nothing needed changing, so nothing was sent
- `topic` (object): A topic

**Example output**

```json
{
  "changed": true,
  "topic": {
    "kms_key_name": "",
    "labels": {
      "team": "billing"
    },
    "message_retention_days": 0,
    "name": "projects/acme-prod/topics/orders",
    "schema": "",
    "state": "ACTIVE",
    "topic_id": "orders"
  }
}
```
