--- name: run-pipeline description: >- Execute and monitor Harness pipeline runs via MCP tools. Find pipelines, provide runtime inputs, trigger executions, monitor progress, handle approvals, retry failures, and abort running or stuck executions. Use when asked to run a pipeline, execute a deployment, trigger a build, start a pipeline, deploy a service, check execution status, approve a pipeline, or abort/stop/interrupt executions. Trigger phrases: run pipeline, execute pipeline, deploy, start build, trigger pipeline, check execution, approve deployment, retry failed pipeline, abort execution, stop pipeline, interrupt execution, kill stuck pipeline. metadata: author: Harness version: 2.1.0 mcp-server: harness-mcp-v2 license: Apache-2.0 compatibility: Requires Harness MCP v2 server (harness-mcp-v2) --- # Run Pipeline Execute and monitor Harness pipeline runs via MCP. ## Instructions ### Step 1: Find the Pipeline ``` Call MCP tool: harness_search Parameters: query: "" resource_types: ["pipeline"] compact: true ``` Or list all pipelines in a project: ``` Call MCP tool: harness_list Parameters: resource_type: "pipeline" org_id: "" project_id: "" search_term: "" ``` ### Step 2: Get Pipeline Details ``` Call MCP tool: harness_get Parameters: resource_type: "pipeline" resource_id: "" org_id: "" project_id: "" ``` Extract from response: - Required runtime inputs (`<+input>` fields) - Pipeline variables with types and defaults - Stage structure and deployment targets ### Step 3: Check Available Input Sets ``` Call MCP tool: harness_list Parameters: resource_type: "input_set" org_id: "" project_id: "" ``` Input sets provide pre-configured values that can be used or overridden. ### Step 4: Execute the Pipeline ``` Call MCP tool: harness_execute Parameters: resource_type: "pipeline" action: "run" resource_id: "" org_id: "" project_id: "" ``` ### Step 5: Monitor Execution ``` Call MCP tool: harness_get Parameters: resource_type: "execution" resource_id: "" org_id: "" project_id: "" ``` Execution statuses: Running, Success, Failed, Aborted, Waiting (approval/input), Expired ### Step 6: Handle Approvals If execution is waiting for approval: ``` Call MCP tool: harness_list Parameters: resource_type: "approval_instance" org_id: "" project_id: "" ``` Then approve or reject: ``` Call MCP tool: harness_execute Parameters: resource_type: "approval_instance" action: "approve" # or "reject" resource_id: "" ``` ## Safety: Production Deployments CRITICAL: Before executing pipelines targeting production: 1. Confirm intent with the user explicitly 2. Show what will be deployed (version, service, environment) 3. Check if pipeline has approval gates 4. Verify the version was tested in lower environments ## Response Format ### Before Execution ``` Pipeline: Project: Required Inputs: Available Input Sets: Ready to execute? Confirm to proceed. ``` ### After Trigger ``` Pipeline: Execution ID: Status: Running View in Harness: ``` ### Execution Complete ``` Pipeline: Status: Success/Failed Duration: