Set Participant Data action not persisting custom variables in IVR flow

Could someone explain why custom variables set via the ‘Set Participant Data’ action in my IVR flow are not persisting to subsequent nodes?

Background

I am using the Genesys Cloud Architect API to update an IVR flow. I added a ‘Set Participant Data’ action to store a custom variable user_segment.

Issue

The action executes without error, but when I try to read user_segment in the next decision node, it is null. Here is the JSON snippet for the action:

{
 "actionType": "setData",
 "data": {
 "user_segment": "{{flowVars.segment}}"
 }
}

Troubleshooting

I verified flowVars.segment has a value. I also tried using participantData key, but it still fails. Am I missing a scope parameter?

TL;DR: Verify variable scope.

Check your action configuration. Genesys Cloud isolates IVR variables from conversation-level data. Use conversationData for persistence across nodes. Here is the correct payload structure for the API:

{
 "id": "set_participant_data_action_id",
 "settings": {
 "variableName": "user_segment",
 "sourceType": "conversationData"
 }
}

This happens because the sourceType mismatch in the action definition. Fix the payload with the snippet below. See KB-9921 for details.

{
 "settings": {
 "variableName": "user_segment",
 "sourceType": "conversationData"
 }
}