I’m trying to propagate OpenTelemetry trace context through a Genesys Cloud Architect flow that uses the GetExternalContactAction data action. The goal is to correlate the external lookup latency with the upstream voice conversation span.
The data action is configured to call our internal customer service API via a REST proxy. I’ve injected the traceparent and tracestate headers into the outbound request using a custom JavaScript snippet in the data action’s pre-processing step. Here’s the relevant part of the snippet:
const traceContext = dataInput.traceContext; // Passed from previous step
if (traceContext) {
request.headers['traceparent'] = traceContext.traceparent;
request.headers['tracestate'] = traceContext.tracestate;
}
The issue is that the GetExternalContactAction seems to strip or ignore custom headers when making the actual HTTP request to the external endpoint. I’ve verified this by logging the request payload in our backend service, and the trace headers are missing. The standard headers like Content-Type are present, but our custom ones are gone.
I’ve checked the data action configuration in the Architect UI. The “Headers” section allows adding static key-value pairs, but there’s no obvious way to bind dynamic values from the data input to the request headers. I tried using the expression syntax ${dataInput.traceContext.traceparent} in the header value field, but it gets sent literally as a string, not resolved.
Is there a way to dynamically inject headers into the GetExternalContactAction outbound request? Or is this a known limitation where custom headers aren’t supported for security reasons? I need this for distributed tracing, so falling back to logging correlation IDs and parsing logs later is not an option for us. We need real-time span propagation.
Any workarounds or hidden configuration options I might be missing? I’ve scoured the documentation and it doesn’t mention dynamic header injection for this specific action type.