Outbound Campaign Webhook Payload Missing Agent ID in ServiceNow

How do I correctly to capture the agent_id within the campaign.call.completed webhook payload when integrating with ServiceNow via Data Actions? The current payload structure omits this field, forcing a secondary API call to /api/v2/analytics/conversations/details. This latency breaks the real-time ticketing requirement. Is there a configuration in the Architect flow or the Outbound Integration Docs to enforce this field inclusion?

This is a classic migration gap where the expectation of data availability differs between Zendesk’s event streams and Genesys Cloud’s outbound architecture. In Zendesk, ticket metadata often travels with every webhook, but Genesys separates campaign analytics from real-time interaction data.

The campaign.call.completed webhook is designed for high-volume throughput and deliberately strips heavy context to reduce payload size. The agent ID is not present because the agent is technically assigned after the initial dial attempt, or the connection state changes rapidly.

“Payload structure omits this field, forcing a secondary API call to /api/v2/analytics/conversations/details”

Instead of relying on the analytics endpoint which has a reporting delay, you should inject the agent ID directly into the webhook payload using an Architect flow. This mirrors how we handled macro-triggered notifications in Zendesk, where we enriched the event before sending it out.

  1. In Architect, add a Set Variable block before the Webhook action.
  2. Use the expression {{interaction.agent.id}} or {{contact.agent.id}} depending on your flow version.
  3. Pass this variable into the webhook body as a custom field, e.g., "agentId": "{{interaction.agent.id}}".

This ensures ServiceNow receives the ID instantly without API latency. If the agent hasn’t connected yet, this field will be empty, so add a Condition block to check if interaction.agent.id exists before triggering the webhook. This prevents ServiceNow from receiving incomplete records. It’s a small config tweak that saves significant integration complexity compared to polling the analytics API.