# Delegate blocks

Hand requests that match a condition to another pipeline.

A Delegate block hands the requests that match its condition to another pipeline. Every other request skips it. Use it to let another team own the rules for some of your requests, such as every Stripe request or every request from one agent.

To add one, open an [approval pipeline](/docs/web-app/approval-pipelines), select **Edit pipeline**, then **Add block** and **Delegate to pipeline**. The pipeline you hand requests to must already exist; see [Creating a pipeline](/docs/web-app/approval-pipelines#creating-a-pipeline).

## When a delegate runs

Give the block a **Name** and use **When** to choose the requests it hands over. **When** works like a [branch's condition](/docs/web-app/branch-blocks#when-a-branch-runs), with the same fields, such as **Tool name**, **MCP server** and the agent, and the same **All** and **Any** groups.

A request that matches continues in the pipeline the block names. A request that doesn't match skips the block and continues with the next block in this pipeline.

```mermaid
flowchart TD
    request["Request reaches the Delegate block"] --> match{"Does When match?"}
    match -->|"No"| skip["Skip it and check the next block"]
    match -->|"Yes"| target["Continue in the named pipeline"]
    target -->|"Approve or deny"| decision["Finish the request"]
    target -->|"Ask a human"| review["Human review"]
    target -->|"No block decides"| targetEnd["Human review with that pipeline's reviewers"]
```

If withHuman can't evaluate the condition, for example because a field has the wrong type for its comparison, the request goes to human review with this pipeline's default reviewers. It's never skipped.

## The target pipeline

Choose the pipeline under **Continue in pipeline**. You can pick any pipeline you can see, except the entry pipeline and the one you're editing. **Open pipeline** takes you to it.

Your Delegate block only decides which requests to send. What happens to them next is up to the target pipeline. Its owners can change their rules at any time, and your Delegate block stays the same.

A request that is handed over is settled in the target pipeline, and nothing after the Delegate block runs. If no block there decides, the request goes to human review with the target pipeline's default reviewers. If it has none, the request uses your pipeline's default, and so on out to the entry pipeline. See [Human review](/docs/web-app/approval-pipelines#human-review).

A target pipeline can hold Delegate blocks of its own. Pipelines can't delegate to each other in a circle, and you can't activate a revision that hands requests to an archived pipeline.

### Example: Support requests

Our support team owns a **Support** pipeline with the refund rules for **Support assistant**. In the entry pipeline, we'll add a Delegate block named **Support assistant requests**, with **When** set to **Agent slug** equals `support-assistant`, and choose **Support** under **Continue in pipeline**.

A $75 refund from Support assistant matches, so it continues in the Support pipeline, which sends it to Payments review. A request from Support assistant that no Support rule decides goes to the Support pipeline's default reviewers. Requests from every other agent skip the block.

![The Support assistant requests Delegate block in the entry pipeline, with When set to Agent slug equals support-assistant and Continue in pipeline set to Support](/images/docs/delegate-blocks/editor-light.png)

The Delegate block picks the requests, and the Support pipeline decides what happens to them. Select any screenshot to view it full size.

## Delegate testing

**Test request** shows whether a sample matched each Delegate block. When it matched, the Delegate block shows what the target pipeline decided. To see each of the target's blocks, open that pipeline and test the same sample there.

For a real request, the [Audit log](/docs/web-app/audit-log) shows which pipelines and blocks it went through.
