For the complete documentation index, see llms.txt. This page is also available as Markdown.

Pipeline execution graph API

Learn how to use the execution graph API to retrieve pipeline execution details in Harness.

The Pipeline Execution Graph API provides a structured representation of a pipeline's execution in Harness. It details the flow, dependencies, statuses, and outcomes of tasks within a pipeline.

Use this API to retrieve execution details at various levels, including stages, steps, and specific nodes. You can extract execution metadata, output variables, task delegation information, and logs for debugging and analysis.


What you will learn from this topic


Get an execution subgraph

The Execution Subgraph API provides detailed information about a specific node's execution in the pipeline. Use this endpoint to retrieve the execution graph for a particular node within a pipeline execution.

Node type restriction

If the PIE_RESTRICT_SUBGRAPH_API_TO_STEP_GROUP feature flag is enabled on your account, the API only works with step group nodes. Contact Harness Support if you need to check the flag status or modify this behavior.

API endpoint

GET /executions/{executionId}/subgraph/{nodeExecutionId}

Path parameters:

  • executionId: The ID of the execution.

  • nodeExecutionId: The ID of the node within the execution whose subgraph details are to be fetched.

For more information, refer to Pipeline Execution Details API.

Example execution graph response

The execution graph contains the following key elements:

  • Root Node: The entry point of the pipeline execution.

  • Execution Nodes: Represents individual steps such as script execution, API calls, or deployments.

  • Dependencies: Defines relationships between nodes, including sequential or parallel execution.

  • Task Delegation: Assigns tasks to worker agents or delegates for execution.

  • Status Tracking: Monitors execution states (Success, Failed, Running, etc.).

  • Output Variables: Captures and stores data produced by execution steps.

  • Logs: Stores detailed execution logs for debugging and analysis.

The following example shows a JSON response from the execution graph API:


Extract output variables from an execution subgraph

You can extract output variables from the execution graph response JSON using an HTTP step and Shell script.

The following YAML example demonstrates how to retrieve output variables from a specific step:

You need to specify the specific step uuid if you want to extract output variables from a specific step. The same can be extracted from the JSON response.

Output

The Shell script step displays the extracted output variables from the execution graph.


Next steps


Last updated

Was this helpful?