# Multiple agent task distribution

**URL:** <https://drone.discourse.group/t/multiple-agent-task-distribution/10572>\
**Category:** Drone Support\
**Created:** [October 17, 2019, 9:04am UTC](https://drone.discourse.group/t/multiple-agent-task-distribution/10572 "2019-10-17T09:04:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dx0eu](https://avatars.discourse-cdn.com/v4/letter/d/9de0a6/32.png) [@dx0eu](https://drone.discourse.group/u/dx0eu)\
**Post date:** [October 17, 2019, 9:04am UTC](https://drone.discourse.group/t/multiple-agent-task-distribution/10572/1 "2019-10-17T09:04:22Z")

</div>

I want distribution a same project to multiple agent.

I create a drone server and two drone agent (agt0, agt1). when I push code to master branch want use agt0 agent to execute, dev branch use agt1 agent to execute.

My config is here

**machine 1** \*

drone server && agent (agt0)

```auto
  drone_server:
    container_name: drone-server
    image: drone/drone:1.6
    restart: always
    environment:
      - DRONE_GITEA_CLIENT_ID=xxxxx
      - DRONE_GITEA_CLIENT_SECRET=xxxxx
      - DRONE_GITEA_SERVER=https://git.com
      - DRONE_GIT_ALWAYS_AUTH=false
      - DRONE_SERVER_HOST=drone.com
      - DRONE_SERVER_PROTO=https
      - DRONE_RPC_SECRET=xxxxx
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - "80:80"

  drone_agent:
    container_name: drone-agent
    image: drone/agent:1.6
    restart: always
    environment:
      - DRONE_RPC_PROTO=https
      - DRONE_RPC_HOST=drone.com
      - DRONE_RPC_SECRET=xxxxx
      - DRONE_RUNNER_CAPACITY=3
      - DRONE_RUNNER_NAME=agt0
    volumes:        
      - /var/run/docker.sock:/var/run/docker.sock                    
    ports:
      - "3000:3000"

```

**machine 2** \*

drone agent (agt1)

```auto
  drone_agent:
    container_name: drone-agent
    image: drone/agent:1.6
    restart: always
    environment:
      - DRONE_RPC_PROTO=https
      - DRONE_RPC_HOST=drone.com
      - DRONE_RPC_SECRET=xxxxx
      - DRONE_RUNNER_CAPACITY=3
      - DRONE_RUNNER_NAME=agt1
    volumes:                                  
      - /var/run/docker.sock:/var/run/docker.sock                      
    ports:
      - "3000:3000"

```

.drone.yml

```auto
---
kind: pipeline
name: default

---
kind: pipeline
name: agt0

steps:
  - name: echo
    image: alpine:edge
    commands:
      - echo 'agt0 execute'

trigger:
  instance:
    - agt0
  branch:
    - master
  event:
    - push

---
kind: pipeline
name: agt1

steps:
  - name: echo
    image: alpine:edge
    commands:
      - echo 'agt1 execute'

trigger:
  instance:
    - agt1
  branch:
    - dev
  event:
    - push

```

Now when I push any branch always execute in agt0, and when I down agt0, this event can execute use agt1.

Not the expected way of execution
