# Issues when mixing template and pipeline

**URL:** <https://drone.discourse.group/t/issues-when-mixing-template-and-pipeline/10643>\
**Category:** Drone Support\
**Created:** [June 30, 2021, 7:04pm UTC](https://drone.discourse.group/t/issues-when-mixing-template-and-pipeline/10643 "2021-06-30T19:04:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mortenfryd](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/mortenfryd/32/6531_2.png) [@mortenfryd](https://drone.discourse.group/u/mortenfryd)\
**Post date:** [June 30, 2021, 7:04pm UTC](https://drone.discourse.group/t/issues-when-mixing-template-and-pipeline/10643/1 "2021-06-30T19:04:32Z")

</div>

Hello.

I’m trying out the new [template](https://docs.drone.io/template/jsonnet/) functionality but ran into issues when mixing a template with other pipelines. It works if I only specify the template, but not if i mix them or use multiple templates. Is this expected behavior?

.drone.yml (this will not work)

```auto
kind: template
load: plugin.jsonnet
data:
  stepName: test
  image: alpine
  commands: ls

---
kind: pipeline
type: docker
name: mypipelinename

steps:
  - name: mystepname
    image: alpine
    commands:
      - ls

```

Template (from docs example)

```auto
local stepName = std.extVar("input.stepName");
local image = std.extVar("input.image");
local commands = std.extVar("input.commands");
{
  "kind": "pipeline",
  "type": "docker",
  "name": "default",
  "steps": [
    {
      "name": stepName,
      "image": image,
      "commands": [
        commands
      ]
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [June 30, 2021, 8:08pm UTC](https://drone.discourse.group/t/issues-when-mixing-template-and-pipeline/10643/2 "2021-06-30T20:08:43Z")

</div>

You cannot mix templates and pipelines in the same yaml. A single template, however, can return multiple pipelines. We will update the documentation accordingly.

---

<div class="post-metadata">

**Author:** ![mortenfryd](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/mortenfryd/32/6531_2.png) [@mortenfryd](https://drone.discourse.group/u/mortenfryd)\
**Post date:** [June 30, 2021, 8:21pm UTC](https://drone.discourse.group/t/issues-when-mixing-template-and-pipeline/10643/3 "2021-06-30T20:21:39Z")

</div>

Ok. I see. Thanks for the reply.

---

<div class="post-metadata">

**Author:** ![david-knott](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/david-knott/32/6471_2.png) [@david-knott](https://drone.discourse.group/u/david-knott)\
**Post date:** [September 6, 2021, 8:33am UTC](https://drone.discourse.group/t/issues-when-mixing-template-and-pipeline/10643/4 "2021-09-06T08:33:30Z")

</div>

@bradrydzewski

Has the documentation for templates been updated yet ? I was trying to use multiple ‘kind: template’ in a drone.yml file, but it doesn’t seems to work. Only the first template seems to trigger.  
e.g.

```auto
---
kind: template
load: template1.jsonnet
data:
  some-data: 'my-value'
---
kind: template
load: template2.jsonnet
data:
  some-data: 'my-other-value'

```

Your last comment suggests that we need to do this inside the template file rather than the drone file.

---

<div class="post-metadata">

**Author:** ![hanjunlee](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/hanjunlee/32/5751_2.png) [@hanjunlee](https://drone.discourse.group/u/hanjunlee)\
**Post date:** [March 2, 2022, 3:53am UTC](https://drone.discourse.group/t/issues-when-mixing-template-and-pipeline/10643/5 "2022-03-02T03:53:58Z")

</div>

@david-knott Unfortunately, Drone also doesn’t support the multiple templates in a single YAML file. [Drone template not triggering build](https://drone.discourse.group/t/drone-template-not-triggering-build/7633)
