"Publish Message" node
Google Could Pub/Sub is a messaging service for exchanging event data among applications and services. It lets you create systems of event producers and consumers, called publishers and subscribers. Publishers communicate with subscribers asynchronously by broadcasting events to a topic, without regard to how or when these events are to be processed. Pub/Sub then delivers events to all the subscribers of that topic, and each subscriber has its own logic of reacting to the event.
The integration between Synerise and this tool opens up possibilities of exporting data collected in Synerise. With the Publish Message node, you can push data from Synerise to Pub/Sub in the form of messages published to Pub/Sub queues in the CloudEvents standard. You can use this connection in various scenarios, such as exporting transactions, event data, customer information (such as marketing agreements), results of metrics, aggregates, expressions, reports, and many more to Google Cloud Pub/Sub. This lets you seamlessly integrate Synerise with third-party tools or other Google Tools such as Google Analytics, Google Ads, Google BigQuery, Google Sheets.
During the configuration of the node, you can use Jinjava inserts which let you dynamically refer to the profile attributes and event parameters in the workflow.
Prerequisites
- Set up the Google Cloud Console project and enable the Pub/Sub API for that project.
- Configure publishing and consuming messages in Pub/Sub.
- Become familiar with building message frames in Google Cloud Pub/Sub.
- Become familiar with the CloudEvents standard that Synerise uses to send data.
- Learn how CloudEvents are sent within the Pub/Sub message.
Node configuration
- Click Google Cloud Pub/Sub > Publish Message.
- Click Select connection.
- From the dropdown list, select the connection.
- If no connections are available or you want to create a new one, see Create a connection.
- If you selected an existing connection, proceed to defining the integration settings.
Create a connection
To allow the data exchange, establish a connection between Synerise and Google Cloud Pub/Sub.
- At the bottom of the Select connection dropdown list, click Add connection.
- On the pop-up, click Sign in with Google.
- Select a Google account which has:
- Access to the project and topic in Google Cloud Pub/Sub that you want to use.
- Permissions to publish messages in that project and topic.
- Follow the instructions on the interface.
- After successful authentication, click Next.
- In the Connection name field, enter the name of the connection.
It’s used to find the connection on the list. - Click Apply.
Result: A connection is created and selected.
Define the integration settings
In this step, fill in the form that allows you to publish a message in Google Cloud Pub/Sub in CloudEvents standard.
-
In the Project ID field, enter the unique identifier of your project in Google Cloud Console.
You can learn how to find the project ID here. -
In the Topic ID field, enter the unique identifier of the topic (a named resource that represents a feed of messages). Learn more about creating and managing topics.
-
In the Attributes (optional) field, enter a JSON key-value object with message attributes.
This can be used to filter messages in the subscription. Learn more about building the “attributes” object. The Attributes object can contain up to 100 attributes.Click here to see example of Attributes object{ "cardID": "XXX" }
-
In the CloudEvent type field, enter the type of data sent in the CloudEvent.
Learn more about CloudEvent types. -
In the Data (optional) field, enter the event data.
It will be sent to Pub/Sub as thedata
object in a CloudEvent JSON Object. The CloudEvent object will be automatically encoded with base64 and sent as thedata
field in a Pub/Sub Message.Click here to see example of the Data field{ "name": "John", "age": 30, "hasCard": true }
-
Confirm the settings by clicking Apply.
When publishing the message in CloudEvents standard to Pub/Sub, Synerise ads the following parameters automatically to data
object in the message body:
specversion
with the value1.0
,type
with the value entered in CloudEvent type field,time
with the time of publishing the message,source
with the value/synerise/automation/{workflowID}
, where{workflowID}
part is replaced with the ID of the automation workflow,id
with the unique hash generated automatically,datacontenttype
with the valueapplication/json; charset=utf-8
,subject
with/synerise/automation/journeyId/{journeyID}
value, where{journeyID}
is replaced with the ID of the automation journey.
Example of use
Refer to this use case to see how you can use this node: