Debug Worklogs API
The Debug Worklogs API provides detailed debug log data for workflow runs, including AI Employee configuration snapshots, workflow definitions, and per-action show-work logs. Access is filtered based on the requesting user's permission level.
GetWorkflowLevelDebugLog
Retrieve comprehensive debug data for an entire workflow run.
| Property | Value |
|---|
| URL | /persona.v1.DebugLogService/GetWorkflowLevelDebugLog |
| HTTP Method | POST |
| Protocol | gRPC-Web over HTTP |
| Header | Type | Required | Description |
|---|
Authorization | string | Yes | Bearer token |
Content-Type | string | Yes | application/grpc-web+proto |
x-grpc-web | string | Yes | 1 |
Request
| Field | Type | Required | Description |
|---|
workflow_run_id | string | Yes | UUID of the workflow run to debug |
Response
| Field | Type | Description |
|---|
persona_config | PersonaConfigForShowWork | AI Employee configuration snapshot (Debug users only) |
action_types | map<string, ActionType> | Map of action names to their type snapshots |
workflow_definition | WorkflowDef | Workflow definition snapshot at time of execution (Debug users only) |
show_work_logs | map<string, ShowWorkLog> | Map of action instance names to their show-work logs |
is_ema_user | bool | Whether the requester is an Ema user |
Example Response
{
"persona_config": {
"id": "persona-uuid",
"name": "Support Agent",
"description": "Customer support persona",
"status": "ACTIVE",
"version": 1,
"widgets": [],
"display_settings": {},
"project_settings": {}
},
"action_types": {
"search@v2": {
"type_name": {},
"display_name": "Knowledge Search",
"description": "Searches the knowledge base"
}
},
"workflow_definition": {
"workflow_name": {},
"actions": [],
"display_name": "Support Workflow"
},
"show_work_logs": {
"search_step": {
"action_title": "Knowledge Search",
"llm_call_count": 2,
"llm_cost_usd": 0.05,
"action_run_status": "ACTION_RUN_STATUS_SUCCESS"
}
},
"is_ema_user": false
}
Permission Levels
The API filters response data based on the requesting user's access level:
| User Type | Sees |
|---|
| Debug access user | Everything |
| Standard user | Action names and step names only |
Data Structures
ShowWorkLog
Per-action debug information for a workflow run.
| Field | Type | Description |
|---|
messages | repeated StructuredLogMessage | Log messages with substitutable variables |
llm_call_count | int32 | Number of LLM calls made |
action_title | string | Display title of the action |
llm_calls | repeated LlmCallEntry | Detailed LLM call entries |
llm_cost_usd | float | Total LLM cost in USD |
llm_latency_ms | float | Total LLM latency in milliseconds |
inputs | ShowWorkInputs | Detailed input information |
outputs | ShowWorkOutputs | Detailed output information |
hitl_rounds | repeated HitlRound | Human-in-the-loop interaction rounds |
work_logs | repeated Step | Steps executed in the action |
workflow_run_id | string | UUID of the workflow run |
action_run_status | ActionRunStatus | Status of the action run |
embedded_persona_run_info | EmbeddedPersonaRunInfo | Info about embedded AI Employee runs |
ActionRunStatus Enum
| Value | Integer | Description |
|---|
ACTION_RUN_STATUS_UNSPECIFIED | 0 | Status not specified |
ACTION_RUN_STATUS_SUCCESS | 1 | Action ran successfully |
ACTION_RUN_STATUS_ERRORED | 2 | Action encountered an error |
ACTION_RUN_STATUS_WARNING | 3 | Action completed with warnings |
ACTION_RUN_STATUS_NOT_RUN | 4 | Action was not executed |
ACTION_RUN_STATUS_PAUSED | 5 | Action execution was paused |
StructuredLogMessage
| Field | Type | Description |
|---|
message_template | string | Template with {placeholder} variables |
substituted_fields | map<string, string> | Placeholder-to-value mappings |
heading | string | Optional heading |
log_level | LogLevel | Message severity level |
error_info | ErrorInfo | Error details (if applicable) |
LlmCallEntry
| Field | Type | Description |
|---|
metrics | ResponseMetrics | LLM response metrics |
fusion_used | bool | Whether Fusion selected a model |
success | bool | Whether the LLM call succeeded |
error_message | string | Error message if failed |
timestamp_ms | int64 | Timestamp in milliseconds |
llm_cost_final_choice | float | Cost of the final model choice in USD |
prompt | PromptData | Prompt data (super-admin only) |
heading | string | Display heading for the call |
PromptData
| Field | Type | Description |
|---|
system_prompt | string | System prompt text |
user_prompt | string | User prompt text |
response | string | LLM response text |
HitlRound
| Field | Type | Description |
|---|
message_type | MessageType | Type of HITL message (Form, Button, TextField, Feedback) |
hitl_request | oneof | Message shown to the human |
hitl_response | oneof | Response from the human |
outcome | string | Outcome status of the round |
| Field | Type | Description |
|---|
entries | repeated InputEntry/OutputEntry | List of input/output entries |
InputEntry
| Field | Type | Description |
|---|
name | string | Parameter name |
value | Value | The actual value |
type | ResolvedType | Data type |
source_agent_name | string | Name of the source action |
OutputEntry
| Field | Type | Description |
|---|
name | string | Parameter name |
value | Value | The actual value |
type | ResolvedType | Data type |
published_as_chat_response | bool | Whether published to the end user |
ErrorInfo
| Field | Type | Description |
|---|
name | string | Error name |
internal_message | string | Internal error message (not shown to end users) |
external_message | string | Error message shown to end users |
Step
| Field | Type | Description |
|---|
name | string | Step name |
messages | repeated StructuredLogMessage | Log messages for the step |
llm_calls | repeated LlmCallEntry | LLM calls in the step |
Error Responses
| HTTP Status | gRPC Code | Description |
|---|
| 400 | INVALID_ARGUMENT | workflow_run_id is required or invalid UUID |
| 403 | PERMISSION_DENIED | User lacks permission for this AI Employee |
| 404 | NOT_FOUND | Workflow run not found or tenant mismatch |
| 500 | INTERNAL | Internal server error |