> For the complete documentation index, see [llms.txt](https://docs.akto.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.akto.io/test-editor/concepts/test-yaml-syntax-detailed/parallel-flows.md).

# Parallel flows

This instruction is required when you want to fire multiple API calls in **parallel** and compare their responses. A simple use case for this would be to test for race conditions in an API by sending multiple requests in parallel.

To configure Akto test YAML for multiple parallel requests, set `type: parallel`. All the `requests` defined under this block are fired **at the same time**.

```yaml
execute: 
  type: parallel    # this means multiple requests are configured to run in parallel
  requests: 
   - req: 
     ...
   - req:
     ...  
```

### Instructions available -

For each request in a parallel flow, you can now use

* A global `validate` block to test for a certain response across all parallel requests.
* A local `validate` block for each individual request.
* A local `validate` block and global `validate` block.

If multiple `validate` blocks are used, all the validate blocks will be evaluated using the `Logical AND` operation.

Example 1 - Try adding body parameters to each request with a global validate block applying to all of them.

```yaml
execute:
  type: parallel
  requests:
  - req:
    - add_body_param:
        test1: one
  - req:
    - add_body_param:
        test2: two
  - req:
    - add_body_param:
        test3: three
validate:
  response_code:
    gte: 200
    lt: 300
```

Example 2 - Use local `validate` blocks on each parallel request, and a global `validate` block for a common condition.

```yaml
execute:
  type: parallel
  requests:
  - req:
    - add_body_param:
        test1: one
    - validate:
        response_payload:
          regex: ".*\"test1\":\"one\".*" 
  - req:
    - add_body_param:
        test2: two
    - validate:
        response_payload:
          regex: ".*\"test2\":\"two\".*" 
  - req:
    - add_body_param:
        test3: three
    - validate:
        response_payload:
          regex: ".*\"test3\":\"three\".*"
validate:
  response_code:
    gte: 200
    lt: 300
```

**Note**: A maximum of 10 requests can be made in parallel.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.akto.io/test-editor/concepts/test-yaml-syntax-detailed/parallel-flows.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
