Overview
The Admin Service is an internal gRPC service that exposes administrative endpoints for:- Workflow execution management and debugging
- Shard management and operations
- Cluster administration and remote cluster management
- Dead letter queue (DLQ) operations
- Search attributes management
- Replication task management
- Task queue administration
Service Methods
Workflow State Management
RebuildMutableState
Rebuilds the mutable state of a workflow execution from history events.string
required
The namespace of the workflow execution
WorkflowExecution
required
The workflow execution identifier containing workflow_id and run_id
RebuildMutableStateResponse
Empty response on success
DescribeMutableState
Retrieves detailed information about the mutable state of a workflow execution.string
required
The namespace of the workflow execution
WorkflowExecution
required
The workflow execution identifier
string
Cached mutable state information in JSON format
object
Current mutable state from the database
ImportWorkflowExecution
Imports a workflow execution from external source.string
required
Target namespace for the imported workflow
WorkflowExecution
required
Workflow execution details
DataBlob[]
required
History event batches to import
DeleteWorkflowExecution
Permanently deletes a workflow execution and all its data.string
required
The namespace of the workflow
WorkflowExecution
required
The workflow execution to delete
DeleteWorkflowExecutionResponse
Empty response on successful deletion
Shard Management
GetShard
Retrieves information about a specific history shard.int32
required
The ID of the shard to retrieve
ShardInfo
Detailed information about the shard including range_id, owner, and state
CloseShard
Closes a shard, releasing its ownership.int32
required
The ID of the shard to close
CloseShardResponse
Empty response on success
ListHistoryTasks
Lists tasks for a specific shard and category.int32
required
The shard ID to list tasks from
TaskCategory
required
Task category (transfer, timer, replication, visibility)
TaskRange
Optional range to filter tasks
Task[]
List of tasks matching the criteria
RemoveTask
Removes a specific task from a shard.int32
required
The shard ID containing the task
TaskCategory
required
The task category
int64
required
The task ID to remove
Cluster Management
DescribeCluster
Returns detailed information about the Temporal cluster.string
Name of the cluster
int32
Total number of history shards
string
Unique cluster identifier
VersionInfo
Server version information
ListClusters
Lists all configured clusters including remote clusters.int32
Maximum number of results per page
bytes
Token for pagination
ClusterInfo[]
List of cluster information
ListClusterMembers
Lists all members of the cluster by role.ServiceRole
Optional filter by service role (frontend, history, matching, worker)
int32
Maximum number of results per page
ClusterMember[]
List of cluster members with their roles and addresses
AddOrUpdateRemoteCluster
Adds or updates a remote cluster configuration for cross-cluster replication.string
required
Frontend address of the remote cluster
bool
Whether to enable connection to the remote cluster
RemoveRemoteCluster
Removes a remote cluster configuration.string
required
Name of the remote cluster to remove
Replication Management
GetReplicationMessages
Retrieves replication messages for cross-cluster replication.string
required
Target cluster name
int64
Last received message ID for pagination
ReplicationTask[]
Batch of replication tasks
GetNamespaceReplicationMessages
Retrieves namespace replication messages.string
required
Target cluster name
int64
Last message ID
ReplicationTask[]
Namespace replication tasks
StreamWorkflowReplicationMessages
Streams workflow replication messages (bidirectional streaming).SyncReplicationState
Replication synchronization state
WorkflowReplicationMessages
Stream of replication messages
ResendReplicationTasks
Resends replication tasks for a workflow execution.string
required
Namespace of the workflow
WorkflowExecution
required
Workflow execution identifier
int64
Starting event ID for resending
int64
Ending event ID
DLQ Operations
GetDLQMessages
Retrieves messages from a dead letter queue.DLQType
required
Type of DLQ (replication or namespace)
string
Source cluster for replication DLQ
int32
Shard ID for shard-specific DLQ
int32
Maximum messages to return
DLQMessage[]
DLQ messages
PurgeDLQMessages
Purges messages from a DLQ up to a specific message ID.DLQType
required
Type of DLQ
string
Source cluster name
int64
required
Purge up to and including this message ID
MergeDLQMessages
Merges DLQ messages back into the main queue.DLQType
required
Type of DLQ
string
Source cluster name
int64
required
Merge up to this message ID
GetDLQTasks
Retrieves tasks from the DLQ with pagination.DLQKey
required
DLQ identifier containing queue type and source cluster
int32
Number of tasks to retrieve
bytes
Pagination token
PurgeDLQTasks
Purges tasks from the DLQ.DLQKey
required
DLQ identifier
TaskMetadata
required
Purge up to this task
MergeDLQTasks
Merges DLQ tasks back into processing.DLQKey
required
DLQ identifier
TaskMetadata
required
Merge up to this task
Search Attributes
AddSearchAttributes
Adds new custom search attributes to the cluster.map<string, SearchAttributeType>
required
Map of attribute names to types (Text, Keyword, Int, Double, Bool, Datetime, KeywordList)
string
required
Namespace for the search attributes
RemoveSearchAttributes
Removes custom search attributes from a namespace.string[]
required
Names of search attributes to remove
string
required
Namespace containing the attributes
GetSearchAttributes
Retrieves all search attributes for a namespace.string
required
Namespace to query
map<string, SearchAttributeType>
Custom search attributes
map<string, SearchAttributeType>
System-defined search attributes
History Operations
GetWorkflowExecutionRawHistoryV2
Retrieves raw history events for a workflow execution.string
required
Namespace of the workflow
WorkflowExecution
required
Workflow execution identifier
int64
Starting event ID (default: 1)
int64
Ending event ID
int32
Maximum events per page
bytes
Token for pagination
DataBlob[]
Raw history event batches
bytes
Token for next page
ReapplyEvents
Reapplies specific events to a workflow execution.string
required
Namespace of the workflow
WorkflowExecution
required
Workflow execution identifier
DataBlob
required
Events to reapply
Task Queue Operations
GetTaskQueueTasks
Retrieves tasks from a task queue.string
required
Namespace of the task queue
string
required
Task queue name
TaskQueueType
required
Type (workflow or activity)
int32
Maximum tasks to retrieve
TaskQueueTask[]
List of task queue tasks
RefreshWorkflowTasks
Refreshes workflow tasks for an execution.string
required
Namespace of the workflow
WorkflowExecution
required
Workflow execution identifier
Health and Diagnostics
DescribeHistoryHost
Returns information about a history service host.string
Optional host address filter
int32
Optional shard ID filter
int32
Number of shards on the host
string
Host address
DeepHealthCheck
Performs a deep health check of all subsystems.HealthState
Overall health state (serving, not_serving)
string
Health status message
Additional Operations
ListQueues
Lists all queues in the system.int32
required
Type of queue to list
int32
Maximum queues per page
QueueInfo[]
List of queues
AddTasks
Adds tasks to a queue.int32
required
Target shard ID
Task[]
required
Tasks to add
Authentication
The Admin Service requires proper authentication and authorization. Ensure your client has admin-level permissions to access these endpoints.Usage Notes
- Most Admin Service operations are low-level and should be used with caution in production
- Some operations like
DeleteWorkflowExecutionare destructive and cannot be undone - DLQ operations are critical for maintaining replication health
- Always test admin operations in a development environment first
- Monitor operation impact on cluster performance
Error Handling
Common error codes:NOT_FOUND- Requested resource does not existINVALID_ARGUMENT- Invalid parameters providedPERMISSION_DENIED- Insufficient permissionsINTERNAL- Internal server errorRESOURCE_EXHAUSTED- Rate limit exceeded