Google Cloud Pub/Sub

App · 20 actions

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.

Actions

ActionWhat it does
Acknowledge messagesMark messages from 'Pull messages' as handled, so Pub/Sub doesn't deliver them again.
Check message against schemaCheck that a JSON message fits a schema, without publishing it.
Create snapshotSave which messages a subscription has handled, to go back to later with 'Replay or skip messages'.
Create subscriptionCreate a pull subscription that receives every message published to a topic from now on.
Create topicCreate a topic to publish messages to.
Delete snapshotDelete a snapshot.
Delete subscriptionDelete a subscription and the messages waiting on it.
Delete topicDelete a topic.
Get subscriptionGet a subscription's settings: its topic, deadline, filter and dead-letter topic.
Get topicGet a topic's settings and labels.
Give messages more timeGive pulled messages more time before Pub/Sub delivers them again, or set 0 to hand them back now.
List schemasList the message schemas in your project.
List snapshotsList the snapshots in your project.
List subscriptionsList the subscriptions in your project, or those on one topic.
List topicsList the topics in your project.
Publish messageSend a message to a topic, for every subscription on it to receive.
Pull messagesRead messages waiting on a pull subscription.
Replay or skip messagesMove a subscription to a moment or a snapshot: messages published before it count as handled, later ones are delivered again.
Update subscriptionChange a subscription's settings or add labels.
Update topicAdd labels to a topic, or change how long it keeps messages.

Acknowledge messages

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

Inputs

SubscriptionsubscriptiontextRequired
The pull subscription to read from. Pick one, or give its name from an earlier step.
Messagesack_idslistRequired
The ack_id of each message, from 'Pull messages' (or the pulled messages themselves).

Outputs

acknowledgednumber
How many
subscriptiontext
The subscription's full name
Example output
{
  "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

SchemaschematextRequired
The schema to check against.
MessagemessagetextRequired
The message, as JSON.

Outputs

problemtext
Why it doesn't fit, in Pub/Sub's words
schematext
The schema's full name
validtrue/false
Whether the message fits the schema
Example output
{
  "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

NamenametextRequired
The new snapshot's name, such as orders-before-deploy.
SubscriptionsubscriptiontextRequired
The subscription. Pick one, or give its name from an earlier step.
Labelslabelsobject
Labels to give it, such as team: billing. Lowercase letters, numbers, - and _ only.

Outputs

snapshotobject
A snapshot
Example output
{
  "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

NamenametextRequired
The new subscription's name, such as orders-lodol: letters, numbers and - _ . ~ + %, starting with a letter.
TopictopictextRequired
The topic. Pick one, or give its name from an earlier step.
Seconds to acknowledgeack_deadline_secondsnumber
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_daysnumber
Keep unacknowledged messages this many days, 1 to 31. Pub/Sub's default is 7.From 1 to 31.
Only messages wheremessage_filtertext
A filter on attributes, such as attributes.type = "order". It can't be changed later.
Message orderingmessage_orderingtrue/false
Deliver messages with the same ordering key in the order they were sent.
Keep acknowledged messagesretain_acked_messagestrue/false
Keep messages after they're acknowledged, so 'Replay or skip messages' can deliver them again.
Exactly-once deliveryexactly_once_deliverytrue/false
Never send a message again once it's acknowledged, or before its deadline passes.
Dead-letter topicdead_letter_topictext
Where to send messages that fail too many times. Pub/Sub's own service account needs permission to publish there.
Tries before dead-letteringmax_delivery_attemptsnumber
How many tries a message gets first, 5 to 100. Defaults to 5.From 5 to 100.
Delete when unused for (days)expires_after_daysnumber
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.
Labelslabelsobject
Labels to give it, such as team: billing. Lowercase letters, numbers, - and _ only.

Outputs

subscriptionobject
A subscription
Example output
{
  "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

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

Outputs

topicobject
A topic
Example output
{
  "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

SnapshotsnapshottextRequired
The snapshot. Pick one, or give its name from an earlier step.

Outputs

deletedtrue/false
Always true once done
snapshottext
The full name of the snapshot deleted
Example output
{
  "deleted": true,
  "snapshot": "projects/acme-prod/snapshots/orders-before-deploy"
}

Delete subscription

Delete a subscription and the messages waiting on it.

Inputs

SubscriptionsubscriptiontextRequired
The subscription. Pick one, or give its name from an earlier step.

Outputs

deletedtrue/false
Always true once done
subscriptiontext
The full name of the subscription deleted
Example output
{
  "deleted": true,
  "subscription": "projects/acme-prod/subscriptions/orders-lodol"
}

Delete topic

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

Inputs

TopictopictextRequired
The topic. Pick one, or give its name from an earlier step.

Outputs

deletedtrue/false
Always true once done
topictext
The full name of the topic deleted
Example output
{
  "deleted": true,
  "topic": "projects/acme-prod/topics/orders"
}

Get subscription

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

Inputs

SubscriptionsubscriptiontextRequired
The subscription. Pick one, or give its name from an earlier step.

Outputs

subscriptionobject
A subscription
Example output
{
  "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

TopictopictextRequired
The topic. Pick one, or give its name from an earlier step.

Outputs

topicobject
A topic
Example output
{
  "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

SubscriptionsubscriptiontextRequired
The pull subscription to read from. Pick one, or give its name from an earlier step.
Messagesack_idslistRequired
The ack_id of each message, from 'Pull messages' (or the pulled messages themselves).
Seconds from nowsecondsnumberRequired
How long until Pub/Sub may deliver them again, 0 to 600. 0 hands them back straight away.From 0 to 600.

Outputs

messagesnumber
How many messages
secondsnumber
The new deadline
subscriptiontext
The subscription's full name
Example output
{
  "messages": 1,
  "seconds": 120,
  "subscription": "projects/acme-prod/subscriptions/orders-lodol"
}

List schemas

List the message schemas in your project.

Inputs

How manylimitnumber
The most to return, up to 1,000. Defaults to 100.From 1 to 1000.

Outputs

countnumber
How many schemas were returned
schemaslist
The schemas
Example output
{
  "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 manylimitnumber
The most to return, up to 1,000. Defaults to 100.From 1 to 1000.

Outputs

countnumber
How many snapshots were returned
snapshotslist
The snapshots
Example output
{
  "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

Topictopictext
Only subscriptions on this topic. Leave empty for all.
How manylimitnumber
The most to return, up to 1,000. Defaults to 100.From 1 to 1000.

Outputs

countnumber
How many subscriptions were returned
subscriptionslist
The subscriptions
Example output
{
  "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 manylimitnumber
The most to return, up to 1,000. Defaults to 100.From 1 to 1000.

Outputs

countnumber
How many topics were returned
topicslist
The topics
Example output
{
  "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

TopictopictextRequired
The topic. Pick one, or give its name from an earlier step.
Messagemessagetext
The message text, such as JSON. Can be left empty when attributes are given.
Attributesattributesobject
Name and value pairs sent with the message, such as type: order. Subscriptions can filter on them.
Ordering keyordering_keytext
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_idtext
The new message's ID
topictext
The full name of the topic it went to
Example output
{
  "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

SubscriptionsubscriptiontextRequired
The pull subscription to read from. Pick one, or give its name from an earlier step.
At mostmax_messagesnumber
The most messages to read, up to 1,000. Defaults to 10; Pub/Sub may return fewer.From 1 to 1000.
Acknowledge themauto_acknowledgetrue/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

acknowledgedtrue/false
Whether the messages were acknowledged
countnumber
How many messages were returned
messageslist
The messages read
Example output
{
  "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

SubscriptionsubscriptiontextRequired
The subscription. Pick one, or give its name from an earlier step.
To this timeto_timedate 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 snapshotsnapshottext
Go back to the state a snapshot saved. Give this or a time.

Outputs

snapshottext
The snapshot it was moved to, if one was given
subscriptiontext
The subscription's full name
timetext
The moment it was moved to, if a time was given
Example output
{
  "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

SubscriptionsubscriptiontextRequired
The subscription. Pick one, or give its name from an earlier step.
Seconds to acknowledgeack_deadline_secondsnumber
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_daysnumber
Keep unacknowledged messages this many days, 1 to 31.From 1 to 31.
Keep acknowledged messagesretain_acked_messagestrue/false
Keep messages after they're acknowledged, so 'Replay or skip messages' can deliver them again.
Exactly-once deliveryexactly_once_deliverytrue/false
Never send a message again once it's acknowledged, or before its deadline passes.
Dead-letter topicdead_letter_topictext
Where to send messages that fail too many times. Pub/Sub's own service account needs permission to publish there.
Tries before dead-letteringmax_delivery_attemptsnumber
How many tries a message gets first, 5 to 100. Defaults to 5.From 5 to 100.
Delete when unused for (days)expires_after_daysnumber
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.
Labelslabelsobject
Labels to add or change, such as team: billing. Lowercase letters, numbers, - and _ only.

Outputs

subscriptionobject
A subscription
Example output
{
  "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

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

Outputs

changedtrue/false
False if nothing needed changing, so nothing was sent
topicobject
A topic
Example output
{
  "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"
  }
}

On this page