Execution History
Track how your prompt templates are being used in production.
Overview
Execution History shows the last 10 calls from production with full details:
- Token usage per call
- Response times
- Model and version used
- User who triggered it
- Full request/response data
Execution History View
What's Tracked
Per Execution
| Field | Description |
|---|---|
| Timestamp | When template was executed |
| Version | Which template version |
| Model | AI model used |
| Tokens | Input + output tokens |
| User | Who triggered execution |
| Variables | Input values provided |
| Response | AI-generated output |
| Duration | Response time |
Use Cases
1. Debugging Production Issues
Scenario: Agent is getting wrong responses
Steps:
- Open template in GenAI Explorer
- Scroll to Execution History
- Find the problematic execution
- Click "View Details"
- Check variable values
- Identify the issue (empty, wrong, malformed)
- Fix and test
2. Monitoring Token Usage
Scenario: Want to reduce costs
Steps:
- Review last 10 executions
- Note average token count
- Identify high-token calls
- Look for patterns (long variables, verbose output)
- Optimize template
See: Token Optimization for strategies
3. Version Performance Comparison
Scenario: New template version deployed
Steps:
- Compare token counts between versions
- Check response times
- Review output quality
- Decide if new version is better
Execution Details
Click "View Details" to see:
{
"executionTime": "2025-12-10T10:30:00Z",
"templateVersion": "v2",
"model": "GPT-4 Omni",
"tokens": {
"input": 150,
"output": 300,
"total": 450
},
"duration": "2.3s",
"user": "john.smith@company.com",
"variables": {
"Customer_Name": "John Smith",
"Product": "Enterprise License"
},
"finalPrompt": "You are a customer service agent...",
"response": "Hello John Smith! I'd be happy..."
}
Full History in Data Cloud
The last 10 executions are shown in GenAI Explorer.
For complete history, query Data Cloud:
Example Query
SELECT
req.gatewayRequestId__c,
req.prompt__c,
req.maskedPrompt__c,
req.userId__c,
req.totalTokens__c,
req.promptTokens__c,
req.completionTokens__c,
gen.responseText__c,
req.promptTemplateDevName__c,
req.promptTemplateVersionNo__c,
req.timestamp__c,
req.model__c,
req.provider__c
FROM
GenAIGatewayRequest__dlm req,
GenAIGatewayResponse__dlm res,
GenAIGeneration__dlm gen
WHERE
req.gatewayRequestId__c = res.generationRequestId__c
AND res.generationResponseId__c = gen.generationResponseId__c
AND req.promptTemplateDevName__c = '"${id}"'
ORDER BY req.timestamp__c DESC
LIMIT 10
See: Data Cloud Integration for more query examples
Related Documentation
- Testing Templates - Pre-deployment testing
- Token Optimization - Reduce costs
- Best Practices - Monitoring tips
Regular monitoring ensures templates perform well and stay cost-effective.