Set Participant Data action overwrites custom variables in Architect flow

Weird issue with the Set Participant Data action in our Architect flow. It seems to be overwriting existing custom variables instead of merging them. I’m trying to pass userTier and priority through an IVR flow to a downstream integration.

Here is the JSON payload I’m sending via the REST endpoint:

{
 "data": {
 "userTier": "Gold",
 "priority": "High"
 }
}

I expected priority to be added to the participant data, but userTier gets wiped out. The flow completes with a 200 OK, but the downstream webhook only receives priority.

  • Environment: Genesys Cloud Architect v2
  • Action: Set Participant Data
  • Input: JSON object with custom key-value pairs
  • Expected: Merge behavior
  • Actual: Overwrite behavior

I’ve tried using the merge option in the action configuration, but it doesn’t seem to work. Any ideas on how to preserve existing variables while adding new ones?

The Set Participant Data action behaves exactly like a full object replacement in the Architect flow engine. It doesn’t merge fields. When you send that JSON payload, the entire data object for that participant gets swapped out. Any existing variables like callDuration or previous userTier values vanish because the new object only contains the two keys you provided.

You have to pull the current state first, mutate it locally, and then push the whole thing back. The SDK doesn’t do partial updates on participant data for you. Here is how you handle it in the flow.

First, add a “Get Participant Data” action to grab the existing state. Store it in a flow variable, say existingData. Then use an Architect expression or a simple JavaScript snippet if you are in a script task to merge your new values.

// Example logic if using a Script Task
var newData = {
 userTier: "Gold",
 priority: "High"
};

// Merge existing data with new data
var mergedData = Object.assign({}, existingData, newData);

// Return the merged object to be used in the Set Participant Data action
return mergedData;

If you are sticking to pure Architect expressions, you need to manually reconstruct the object. It’s tedious but necessary. You’d reference each existing field explicitly:

{"userTier": "Gold", "priority": "High", "previousVar": ${participant.data.previousVar}}

Make sure you include every field you want to keep. The API endpoint /api/v2/interactions/participants/{participantId} follows the same pattern. A PUT request replaces the resource. A PATCH request is available for some fields but participant data merging is tricky there too. Sticking to the full object replacement pattern is safer. It avoids random 409 conflicts where the platform rejects your update because an internal timestamp or state version has changed since you read it. Always read, merge, write. It’s the only way to keep the state consistent.