> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-cloud-operations/harness_pipeline_step_execution_architecture.md).

# Harness Pipeline Step Execution Architecture

<figure><img src="/files/IbAdMxQ8kaM81AxFX6dD" alt="Harness Pipeline step execution flow"><figcaption><p>Click to view full size image</p></figcaption></figure>

This diagram describes the high-level flow of executing a step within a Harness pipeline:

1. Upon receiving a pipeline step execution request, the Pipeline service processes the step YAML definition. It resolves variables and expressions in the YAML.
2. The processed step definition is then placed in Redis Stream.
3. The NG Manager service (for Continuous Delivery steps) or CI Manager service (for Continuous Integration steps) picks up tasks from the Redis Stream.
4. The service creates a delegate task request specifying the step to be executed. This request is sent to the Delegate Management module.
5. The Delegate Management module selects a suitable delegate from the available pool. This selection uses delegate selectors, tags, and capabilities.
6. Once the delegate finishes the task, it sends a response back to the service.
7. Logs generated during execution are sent to the Log service. The Log service stores these logs in two locations:
   * Redis: For immediate access (e.g., by the UI) during pipeline execution.
   * Blob Store: For long-term archival.
8. The NG Manager service asynchronously communicates the execution response back to the Pipeline service via Redis streams.
9. After receiving the response, the Pipeline service updates the executed step's status. It then identifies the next pipeline step and starts the same process described earlier.
10. Monitoring:
    * UI interaction: The user interface (UI) periodically checks the Pipeline service for each pipeline step's execution status.
    * Log Retrieval: The UI also polls the Log service to retrieve and display the latest log messages generated during step execution.
