Sitecore CDP Audience export-Sitecore Connect
Automating Audience Export Delivery with Sitecore Connect
In my previous blog, I explained how to implement Audience Export and discussed challenges related to CDP guest data, along with ways to overcome them. This blog continues from there.
Now that the Audience Export is successfully set up, the next step is to notify Sitecore Connect about the job execution. Sitecore Connect will then fetch the audience data generated by Sitecore CDP. The objective here is simple: retrieve the exported audience data in Sitecore Connect and forward it to any third-party system based on your integration needs.
Solution Overview
We will use Sitecore Connect to:
- Receive a webhook notification when an audience export completes
- Fetch the exported data from Sitecore CDP
- Process and transform the data
- Send it to downstream systems
Step 1: Configure Audience Export Notification
Start by configuring your Audience Export created in my previous blog in Sitecore CDP to notify a Sitecore Connect Recipe endpoint as mentioned below in the screen shot
- Set the webhook recipient (this will be generated in Sitecore Connect in later steps)
- Once the Audience export is completed ,it notify the Sitecore connect recipe attached to it with the payload as such which is received by the Recipe webhook: This ensures Sitecore Connect is triggered whenever the export job completes.
- {
}-
Payload : { },-
apiUrl : https://api-ap-southeast-2-production.boxever.com, -
name : chandanfullaudienexport, -
definitionType : FULL_SYNC, -
status : SUCCESS, -
Client key : ******************, -
Friendly ID : chandanfullaudienexport, -
Audience export ref : 6c32a750-d131-4ae3-b8b1-f2578d85ef9e, -
Audience export execution ref : 058adba1-9eae-4656-bd37-fb086d95e576, -
segmentName : Customers with gross income over 20000, -
executionType : INSTANT_RUN
-
-
params : {}
-
Step 2: Create a Connection in Sitecore Connect
In Sitecore Connect:
- Create a connection to Sitecore CDP
- Once the connection is established, create a Recipe
Step 3: Create a Recipe with Webhook Trigger
The image above illustrates the complete workflow of the recipe, which is explained step by step below.
Generate Webhook & Define Payload Schema
- Go to Create → Recipe
- Choose Trigger from a webhook
- Select Start building → Setup manually
-
Enter an event name (e.g.,
CDP to Connect) - Copy the generated webhook URL (this will be used in CDP)
Configure Payload Schema
Use the following JSON schema:
This schema ensures the webhook payload is properly structured for downstream steps.
Step 4: Link Recipe to Audience Export
Connect the webhook URL generated above to your Audience Export configuration in CDP.
This ensures:
- Every time the export runs, Sitecore Connect receives a notification
- The payload includes the necessary references to fetch the correct data
Step 5: Add Sitecore CDP Action
Now, define what happens after the webhook is triggered.
- Add an Action in an app
- Select Sitecore CDP
- Choose an action such as:
- Audience Export – Get latest files
- Audience Export – – Get latest files (recommended-I have used this one for the blog purpose)
- Audience Export Delta
- Audience Export Delta – Get files by execution ref
Configure the Action
- Map audience Export Execution Ref from webhook payload to the CDP action field
- This ensures the correct export data is retrieved
Step 6: Retrieve Export Output URLs
The CDP action returns URLs pointing to gzipped output files.
To process them:
- Add a Repeat for each step
-
Use the
Exportsarray from the previous step - Configure:
- Repeat mode: Batch
- Batch size: 5000
Step 7: Download Gzipped Files
Inside the loop:
- Add action: Get file from URL (File tools by Workato)
-
Map the
URLfield from the export output
This retrieves the compressed audience data.
Step 8: Extract Gzipped Output
Next, extract the data:
- Add action: Uncompress a file
-
Configure:
- Compression format: Gzip
- Archive format: None
- Map File contents from previous step
Step 9: Transform Output into JSON
After extraction, the output is not immediately usable—it is not properly formatted JSON.
Solution:
- Create a variable
- process the data of the previous step using the function mentioned below. When you select the variable type of string you will get the option to add the fucntion.This function will process the data and store it as as Json array
- Add a Parse JSON action:
- Input: variable output i.e test variable is passed to the Document filed as mentioned below
- Provide a sample document schema
If you look at the sample document, it represents the schema of an individual JSON object embedded within the string returned by the audience export. In other words, each element in the string corresponds to a single guest record.
You can think of it as the JSON structure for one guest profile returned by the export. However, the actual output is not a single object—it is a collection of such objects grouped together.
This schema is wrapped inside an array, meaning the final structure becomes an array of guest JSON objects, where each object follows the same schema as defined in the sample document.
The transformation step is important because the extracted data is initially a raw string and not a properly formatted JSON structure. By applying the parsing step with the sample document schema, the string is converted into a well-structured JSON array.
Mentioned below is the output of the of the recipe job executed when Audience export is completed
Step 10: Send Data to Third-Party Systems
Once the data is parsed:
-
You can forward it to any system:
- CRM
- Marketing automation tools
- Data warehouses
- APIs
This completes the automation pipeline.
Key Takeaways
- Webhooks enable real-time triggering from Sitecore CDP
- Sitecore Connect recipes orchestrate the entire workflow
- Gzipped files require extraction and transformation before use
- JSON parsing is essential for downstream integrations
Conclusion
By integrating Audience Export with Sitecore Connect, you can fully automate the delivery of audience data to external systems. This approach ensures scalability, flexibility, and real-time data flow—key requirements for modern composable architectures.
Comments
Post a Comment