get_task_metrics_for_workflow
Retrieve task execution metrics for a specific workflow to analyze and optimize individual task performance.
Instructions
Get all task metrics for the specified workflow from Workflow Engine.
Retrieves task execution metrics filtered by a specific workflow name, providing detailed insights into the performance of individual tasks within that particular workflow for targeted analysis and optimization.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the workflow to retrieve task metrics for |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | Response model for task metrics collection endpoints. This Pydantic RootModel provides a standardized response format for API endpoints that return collections of task-level metrics from the Itential Platform workflow engine. It wraps a list of TaskMetricElement objects, enabling type-safe handling of task performance data across automation workflows. The root model pattern allows the response to be treated as a list while maintaining proper validation and serialization capabilities for the contained task metric elements, supporting comprehensive workflow monitoring and analysis. Args: root: List of TaskMetricElement objects containing task performance data. Defaults to an empty list if not provided. Attributes: root (List[TaskMetricElement]): Collection of task metric elements with application usage patterns and execution statistics for workflow analysis Example: Creating a response with multiple task metrics: >>> task1 = TaskMetricElement(taskType="automatic", name="validate-config", ... metrics=[], app="validator") >>> task2 = TaskMetricElement(taskType="manual", name="approve-deploy", ... metrics=[], app="approval-service") >>> response = GetTaskMetricsResponse([task1, task2]) >>> print(len(response.root)) # 2 >>> print(response.root[0].task_type) # "automatic" >>> print(response.root[1].name) # "approve-deploy" Notes: - Uses default_factory=list to create empty collections when needed - Supports iteration and indexing through the root attribute - Maintains type safety for all contained TaskMetricElement objects - Enables filtering and analysis of tasks by application, workflow, or type |