The Session Tracing Data Model (STDM) captures telemetry for Agentforce sessions in Data 360, providing visibility into agent execution and runtime behavior. This guide helps administrators and developers use STDM to trace session execution, monitor variable updates, inspect user and agent interactions, investigate action failures, review LLM prompts and responses, identify recurring execution patterns, and discover opportunities to optimize prompts, actions, subagents, and instructions. It also introduces the core STDM objects, explains their relationships, and provides practical SQL query examples and troubleshooting workflows to help diagnose issues and improve Agentforce behavior.
Without observability: debugging is guesswork, tuning is slow, quality is risky, cost spikes go unnoticed, and trust erodes. With Agent Session Tracing, you get clear, structured logs for every session and interaction — facts, not guesses.
Use this guide if you experience issues such as:
Reference: Enable Agentforce Session Tracing — Prerequisites, permissions, troubleshooting
Minimum required: Version 1.130+
To check your version:
If the version is too old, DMOs won’t appear in the Query Editor even if DLOs are visible.
After enabling session tracing:
AiAgentSession DLO → ssot__AiAgentSession__dlm DMO.If DMOs are not visible, check the SSOT version and the DLO mapping.
ssot__<ObjectName>__dlm naming convention.table "<table_name>" does not exist in Query Editor. Please refer Data 360: Error "table ... does not exist" in Data Explorer or Query EditorBefore reviewing Session Trace data, verify that:
How to find a Session ID: Run Query 3 scoped to a recent time window to browse sessions and grab a Session ID. You can also find it from the Conversation record in the Salesforce UI, or by querying the Messages table (Query 7) filtered by a recent date.
All objects use the ssot__ prefix (Standard Object Type) and end with __dlm. These are part of the Standard Data Cloud Object Model installed with Data 360 SSOT.
| Table | DMO Name | Purpose | Key Use Cases |
|---|---|---|---|
| Session | ssot__AiAgentSession__dlm | Session-level metadata | Find all sessions, get initial variables, check session status |
| Participant | ssot__AiAgentSessionParticipant__dlm | Who joined (contacts, leads, users, agents) | Identify which agent/user was involved |
| Interaction | ssot__AiAgentInteraction__dlm | Individual turns/threads within a session | Group messages and steps by conversation turn |
| Message | ssot__AiAgentInteractionMessage__dlm | Each user/agent utterance | See exact user input and agent responses |
| Step | ssot__AiAgentInteractionStep__dlm | Actions taken (tool calls, Apex/Flow/LLM) | Debug action failures, trace execution flow |
Session (1)
├── Participants (N) [1-to-many: one session, many participants]
└── Interactions (N) [1-to-many: one session has many turns]
├── Messages (N) [1-to-many: one interaction has many messages]
└── Steps (N) [1-to-many: one interaction has many steps]
└── GenAIGeneration (via ssot__GenerationId__c)
└── GenAIGatewayRequest / Response (for LLM calls)
The STDM integrates seamlessly with the Einstein Audit and Feedback Data Model-the foundational model for all Generative Audit and Feedback use-cases across Salesforce. Steps link to Einstein Audit records via ssot__GenerationId__c and ssot__GenAiGatewayRequestId__c.
| Step Type | What It Means | Query Use Case |
|---|---|---|
VARIABLE_UPDATE_STEP | Variable was set/modified | Track variable flow |
TOPIC_CLASSIFICATION_STEP | LLM selected a topic | See which topics were considered |
ACTION_EXECUTION_STEP | Action (Flow/Apex/Prompt) was called | Debug action failures |
LLM_REASONING_STEP | LLM generated a response | Check reasoning quality |
TRANSITION_STEP | Agent moved to a different topic | Track conversation flow |
| Symptom | Start with |
|---|---|
| Wrong topic selected | Query 5 (LLM prompts) |
| Action not executed | Query 1 + Query 4 |
| Variable missing | Query 2 |
| Incorrect agent response | Query 5 |
| Runtime errors | Query 4 |
| Conversation history | Query 7 |
| Agent looping between topics | Query 11 (interaction count) + Query 1 |
| Slow responses / latency issues | Query 9 (step duration) + Query 10 (interaction duration / TTFR) |
The following queries help diagnose the most common Agentforce configuration and runtime issues. Each query includes:
Note: In every session-scoped query below, replace <SESSION_ID> with the Session ID of the conversation you’re investigating.
Use case: Trace all execution steps for an Agentforce session in chronological order. This query provides a complete view of how the agent processed the conversation, including topic selection, action execution, variable updates, LLM reasoning, and any runtime errors.
SELECT
ssot__Name__c,
ssot__AiAgentInteractionStepType__c,
ssot__InputValueText__c,
ssot__OutputValueText__c,
ssot__PreStepVariableText__c,
ssot__PostStepVariableText__c,
ssot__ErrorMessageText__c,
ssot__StartTimestamp__c
FROM "ssot__AiAgentInteractionStep__dlm"
WHERE ssot__AiAgentInteractionId__c IN (
SELECT ssot__Id__c
FROM "ssot__AiAgentInteraction__dlm"
WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
)
ORDER BY ssot__StartTimestamp__c ASC;
What this shows:
Configuration insights:
Use case: Review how variables change throughout a session to diagnose missing, incorrect, or unexpected values.
SELECT
ssot__PreStepVariableText__c,
ssot__PostStepVariableText__c,
ssot__StartTimestamp__c
FROM "ssot__AiAgentInteractionStep__dlm"
WHERE
ssot__AiAgentInteractionStepType__c = 'VARIABLE_UPDATE_STEP'
AND ssot__AiAgentInteractionId__c IN (
SELECT ssot__Id__c
FROM "ssot__AiAgentInteraction__dlm"
WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
)
ORDER BY ssot__StartTimestamp__c ASC;
What this shows:
Configuration insights:
Use case: Review the variables and metadata available when the Agentforce session begins (context variables).
SELECT
ssot__VariableText__c,
ssot__StartTimestamp__c,
ssot__EndTimestamp__c,
ssot__AiAgentSessionEndType__c
FROM "ssot__AiAgentSession__dlm"
WHERE ssot__Id__c LIKE '%<SESSION_ID>%';
What this shows:
Configuration insights:
userId, accountId)Use case: Identify actions that failed during execution and review the associated error messages, inputs, and timestamps to determine the root cause.
SELECT
ssot__Name__c,
ssot__AiAgentInteractionStepType__c,
ssot__InputValueText__c,
ssot__ErrorMessageText__c,
ssot__StartTimestamp__c
FROM "ssot__AiAgentInteractionStep__dlm"
WHERE
ssot__ErrorMessageText__c IS NOT NULL
AND ssot__ErrorMessageText__c <> 'NOT_SET'
AND ssot__AiAgentInteractionId__c IN (
SELECT ssot__Id__c
FROM "ssot__AiAgentInteraction__dlm"
WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
)
ORDER BY ssot__StartTimestamp__c ASC;
What this shows:
Configuration insights:
Use case: Review the prompts sent to the LLM and the corresponding responses to understand how the model selected topics, chose actions, or generated responses.
SELECT
gr."promptTemplateDevName__c",
gr."prompt__c",
gen."responseText__c",
gr."timestamp__c"
FROM "GenAIGatewayRequest__dlm" gr
JOIN "GenAIGatewayResponse__dlm" gresp
ON gr."gatewayRequestId__c" = gresp."generationRequestId__c"
JOIN "GenAIGeneration__dlm" gen
ON gresp."generationResponseId__c" = gen."generationResponseId__c"
WHERE gr."sessionId__c" LIKE '%<SESSION_ID>%'
ORDER BY gr."timestamp__c" ASC
LIMIT 100;
Note: The GenAIGatewayRequest__dlm, GenAIGatewayResponse__dlm, and GenAIGeneration__dlm tables are part of the Einstein Audit and Feedback Data Model and use a different naming convention (no ssot__ prefix). These are Einstein Audit tables that join to STDM via ssot__GenerationId__c and ssot__GenAiGatewayRequestId__c on the Step object.
What this shows:
Configuration insights:
Use case: Identify recurring errors across multiple sessions to help detect common configuration issues or trends.
SELECT
ints.ssot__AiAgentSessionId__c,
COUNT(steps.ssot__Id__c) AS error_count,
MAX(steps.ssot__ErrorMessageText__c) AS sample_error
FROM "ssot__AiAgentInteraction__dlm" ints
JOIN "ssot__AiAgentInteractionStep__dlm" steps
ON ints.ssot__Id__c = steps.ssot__AiAgentInteractionId__c
WHERE
steps.ssot__ErrorMessageText__c LIKE '%required field missing%'
AND steps.ssot__StartTimestamp__c >= CURRENT_DATE - INTERVAL '7' DAY
GROUP BY ints.ssot__AiAgentSessionId__c
HAVING COUNT(steps.ssot__Id__c) > 0
ORDER BY error_count DESC
LIMIT 50;
What this shows:
Configuration insights:
Use case: Review the conversation history to understand how the user interacted with the agent and how the agent responded throughout the session.
SELECT
msg.ssot__AiAgentInteractionMessageType__c, -- 'Input' (user) or 'Output' (agent)
msg.ssot__ContentText__c,
msg.ssot__MessageSentTimestamp__c
FROM "ssot__AiAgentInteractionMessage__dlm" msg
WHERE msg.ssot__AiAgentInteractionId__c IN (
SELECT ssot__Id__c
FROM "ssot__AiAgentInteraction__dlm"
WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
)
ORDER BY msg.ssot__MessageSentTimestamp__c ASC;
What this shows:
Configuration insights:
global_instructionsUse case: Identify when a specific topic or action was executed and understand how frequently it is used across sessions.
SELECT
ints.ssot__AiAgentSessionId__c,
steps.ssot__Name__c,
steps.ssot__StartTimestamp__c
FROM "ssot__AiAgentInteraction__dlm" ints
JOIN "ssot__AiAgentInteractionStep__dlm" steps
ON ints.ssot__Id__c = steps.ssot__AiAgentInteractionId__c
WHERE
steps.ssot__Name__c = 'OrderTracking'
AND steps.ssot__StartTimestamp__c >= CURRENT_DATE - INTERVAL '7' DAY
ORDER BY steps.ssot__StartTimestamp__c DESC
LIMIT 100;
What this shows:
Configuration insights:
Use case: Find which individual step is the bottleneck — useful for slow action, Apex, or LLM calls.
SELECT
ssot__AiAgentInteractionId__c AS InteractionId,
ssot__Id__c AS StepId,
ssot__Name__c AS StepName,
DATEDIFF('second', ssot__StartTimestamp__c, ssot__EndTimestamp__c) AS Duration_Seconds
FROM "ssot__AiAgentInteractionStep__dlm"
ORDER BY Duration_Seconds DESC
LIMIT 100;
Configuration insights:
LLM_REASONING_STEP → review prompt length, reduce context sizeUse case: Find how long each turn took and measure Time-To-First-Response (TTFR) — a vital metric because it can indicate systemic lags in underlying systems such as RAG.
SELECT
ssot__Id__c AS InteractionId,
ssot__AiAgentSessionId__c AS SessionId,
DATEDIFF('second', ssot__StartTimestamp__c, ssot__EndTimestamp__c) AS Duration_Seconds
FROM "ssot__AiAgentInteraction__dlm"
ORDER BY Duration_Seconds DESC
LIMIT 100;
Use case: Find sessions with an unusually high number of turns — a strong signal the agent is looping between topics.
SELECT
ssot__AiAgentSessionId__c AS SessionId,
COUNT(*) AS InteractionCount
FROM ssot__AiAgentInteraction__dlm
GROUP BY ssot__AiAgentSessionId__c
ORDER BY InteractionCount DESC
LIMIT 50;
Configuration insights:
TRANSITION_STEP or TOPIC_CLASSIFICATION_STEP entriesUse case: Confirm which agent and user were involved in a session. Useful when verifying the correct agent was invoked or when debugging multi-agent scenarios.
SELECT
ssot__AiAgentSessionId__c AS SessionId,
ssot__ParticipantId__c AS ParticipantId
FROM ssot__AiAgentSessionParticipant__dlm
WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
ORDER BY ssot__AiAgentSessionId__c;
Use case: Full session dump joining all five core objects — use this when you need a complete picture of a specific session for export or deep analysis.
SELECT *
FROM
ssot__AiAgentSession__dlm,
ssot__AiAgentInteraction__dlm,
ssot__AiAgentInteractionStep__dlm,
ssot__AiAgentInteractionMessage__dlm,
ssot__AiAgentSessionParticipant__dlm
WHERE
ssot__AiAgentInteractionStep__dlm.ssot__AiAgentInteractionId__c = ssot__AiAgentInteraction__dlm.ssot__Id__c
AND ssot__AiAgentInteraction__dlm.ssot__AiAgentSessionId__c = ssot__AiAgentSession__dlm.ssot__Id__c
AND ssot__AiAgentInteractionMessage__dlm.ssot__AiAgentInteractionId__c = ssot__AiAgentInteraction__dlm.ssot__Id__c
AND ssot__AiAgentSessionParticipant__dlm.ssot__AiAgentSessionId__c = ssot__AiAgentSession__dlm.ssot__Id__c
AND ssot__AiAgentSession__dlm.ssot__Id__c = '<SESSION_ID>';
The SQL queries in this guide provide detailed insight into Agentforce runtime behavior. Use the following table to help interpret common findings.
| Observation | Possible Cause |
|---|---|
| Expected action is missing from the execution trace | The topic wasn’t selected, execution conditions weren’t met, or required inputs weren’t available. |
| Variables remain empty throughout execution | An output mapping may be incorrect, or a previous action didn’t execute successfully. |
| Validation or execution errors are present | Required inputs are missing, or the action configuration should be reviewed. |
| Multiple topic transitions occur | Topic descriptions or boundaries may overlap. |
| Unexpected Topic Classifier results | Topic descriptions, trigger phrases, or boundary definitions may need refinement. |
| Prompt is missing expected context | Required variables or Prompt Template configuration may be incomplete. |
| High interaction count in Query 11 | Agent is likely looping — check topic boundary definitions. |
| Long durations in Query 9/10 | Bottleneck in a specific step or RAG service — review action/prompt configuration. |
Work through the queries in this order to move from a high-level view to root cause.
Step 1 — Get the session overview (Query 3: initial variables, duration, status).
SELECT
ssot__VariableText__c,
ssot__StartTimestamp__c,
ssot__EndTimestamp__c,
ssot__AiAgentSessionEndType__c
FROM "ssot__AiAgentSession__dlm"
WHERE ssot__Id__c LIKE '%<SESSION_ID>%';
Step 2 — Get the full execution trace (Query 1).
SELECT
ssot__Name__c,
ssot__AiAgentInteractionStepType__c,
ssot__InputValueText__c,
ssot__OutputValueText__c,
ssot__PreStepVariableText__c,
ssot__PostStepVariableText__c,
ssot__ErrorMessageText__c,
ssot__StartTimestamp__c
FROM "ssot__AiAgentInteractionStep__dlm"
WHERE ssot__AiAgentInteractionId__c IN (
SELECT ssot__Id__c
FROM "ssot__AiAgentInteraction__dlm"
WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
)
ORDER BY ssot__StartTimestamp__c ASC;
Step 3 — Check variable flow (Query 2: run if variables are missing or wrong).
SELECT
ssot__PreStepVariableText__c,
ssot__PostStepVariableText__c,
ssot__StartTimestamp__c
FROM "ssot__AiAgentInteractionStep__dlm"
WHERE
ssot__AiAgentInteractionStepType__c = 'VARIABLE_UPDATE_STEP'
AND ssot__AiAgentInteractionId__c IN (
SELECT ssot__Id__c
FROM "ssot__AiAgentInteraction__dlm"
WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
)
ORDER BY ssot__StartTimestamp__c ASC;
Step 4 — Link to LLM prompts (Query 5: run if topic or action selection is wrong).
SELECT
gr."promptTemplateDevName__c",
gr."prompt__c",
gen."responseText__c",
gr."timestamp__c"
FROM "GenAIGatewayRequest__dlm" gr
JOIN "GenAIGatewayResponse__dlm" gresp
ON gr."gatewayRequestId__c" = gresp."generationRequestId__c"
JOIN "GenAIGeneration__dlm" gen
ON gresp."generationResponseId__c" = gen."generationResponseId__c"
WHERE gr."sessionId__c" LIKE '%<SESSION_ID>%'
ORDER BY gr."timestamp__c" ASC
LIMIT 100;
STDM Query:
SELECT ssot__Name__c, ssot__AiAgentInteractionStepType__c, ssot__ErrorMessageText__c
FROM "ssot__AiAgentInteractionStep__dlm"
WHERE ssot__AiAgentInteractionId__c IN (
SELECT ssot__Id__c FROM "ssot__AiAgentInteraction__dlm"
WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
)
ORDER BY ssot__StartTimestamp__c ASC;
What to Look For:
ssot__ErrorMessageText__c for validation errorsConfiguration Fix:
STDM Query:
SELECT gr."prompt__c", gen."responseText__c"
FROM "GenAIGatewayRequest__dlm" gr
JOIN "GenAIGatewayResponse__dlm" gresp
ON gr."gatewayRequestId__c" = gresp."generationRequestId__c"
JOIN "GenAIGeneration__dlm" gen
ON gresp."generationResponseId__c" = gen."generationResponseId__c"
WHERE
gr."promptTemplateDevName__c" = 'TopicClassifier'
AND gr."sessionId__c" LIKE '%<SESSION_ID>%';
What to Look For:
prompt__c to see all topic descriptions sent to LLMresponseText__c to see which topic LLM selected and whyConfiguration Fix:
STDM Query:
SELECT ssot__PreStepVariableText__c, ssot__PostStepVariableText__c
FROM "ssot__AiAgentInteractionStep__dlm"
WHERE ssot__AiAgentInteractionStepType__c = 'VARIABLE_UPDATE_STEP'
AND ssot__AiAgentInteractionId__c IN (
SELECT ssot__Id__c FROM "ssot__AiAgentInteraction__dlm"
WHERE ssot__AiAgentSessionId__c LIKE '%<SESSION_ID>%'
)
ORDER BY ssot__StartTimestamp__c ASC;
What to Look For:
ssot__PostStepVariableText__cConfiguration Fix:
STDM Query:
Query 11 (interaction count) → then Query 1 on the flagged session
What to Look For:
InteractionCount significantly higher than expectedTRANSITION_STEP entries in Query 1 with no resolutionConfiguration Fix:
STDM Query:
Query 9 (step duration) + Query 10 (TTFR)
What to Look For:
Duration_Seconds?Configuration Fix:
After collecting STDM query results, share them with an LLM to help analyze the execution flow and get configuration recommendations.
Depending on the issue, share:
An LLM can help you:
| What You Want | Query | Key Fields |
|---|---|---|
| All steps in a session | Query 1 | ssot__Name__c, ssot__InputValueText__c, ssot__OutputValueText__c |
| Variable changes | Query 2 | ssot__PreStepVariableText__c, ssot__PostStepVariableText__c |
| Recent sessions / find a Session ID | Query 3 | ssot__Id__c, ssot__VariableText__c |
| Failed actions | Query 4 | ssot__ErrorMessageText__c |
| LLM prompts | Query 5 | prompt__c, responseText__c |
| Error patterns across sessions | Query 6 | error_count, sample_error |
| User/agent messages | Query 7 | ssot__AiAgentInteractionMessageType__c, ssot__ContentText__c |
| Usage of a specific action | Query 8 | ssot__Name__c, ssot__StartTimestamp__c |
| Step-level performance | Query 9 | Duration_Seconds per step |
| Turn duration / TTFR | Query 10 | Duration_Seconds per interaction |
| Loop detection | Query 11 | InteractionCount per session |
| Participant confirmation | Query 12 | ssot__ParticipantId__c |
| Full session dump | Query 13 | All 5 DMOs joined |
005389127

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.