# How to run a pipeline from a pipeline

**URL:** <https://discuss.elastic.co/t/how-to-run-a-pipeline-from-a-pipeline/314562>\
**Category:** Logstash\
**Created:** [September 16, 2022, 8:44am UTC](https://discuss.elastic.co/t/how-to-run-a-pipeline-from-a-pipeline/314562 "2022-09-16T08:44:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![reed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/reed/32/122863_2.png) [@reed](https://discuss.elastic.co/u/reed)\
**Post date:** [September 16, 2022, 8:44am UTC](https://discuss.elastic.co/t/how-to-run-a-pipeline-from-a-pipeline/314562/1 "2022-09-16T08:44:53Z")

</div>

Hi All,

in my project I have 3 pipelines, I know that a pipeline can be scheduled but in my case I need to run the third one at the end of other two.

There is a way to do this? run the pipelines in order:

pipeline1 -\> pipeline2 -\> pipeline3

thanks to all  
D.

---

<div class="post-metadata">

**Author:** ![stevesimpson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stevesimpson/32/41437_2.png) [@stevesimpson](https://discuss.elastic.co/u/stevesimpson)\
**Post date:** [September 16, 2022, 9:14am UTC](https://discuss.elastic.co/t/how-to-run-a-pipeline-from-a-pipeline/314562/2 "2022-09-16T09:14:44Z")

</div>

Pipeline-to-pipline communication is documented here: [Pipeline-to-pipeline communication | Logstash Reference [8.4] | Elastic](https://www.elastic.co/guide/en/logstash/current/pipeline-to-pipeline.html)

There are a number of architectural patterns with examples about mid way down that page

---

<div class="post-metadata">

**Author:** ![reed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/reed/32/122863_2.png) [@reed](https://discuss.elastic.co/u/reed)\
**Post date:** [September 16, 2022, 1:00pm UTC](https://discuss.elastic.co/t/how-to-run-a-pipeline-from-a-pipeline/314562/3 "2022-09-16T13:00:28Z")

</div>

steve thanks for your response it is very useful.

is it possible exec a pipeline only at the end of another one?

thanks.

---

<div class="post-metadata">

**Author:** ![stevesimpson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stevesimpson/32/41437_2.png) [@stevesimpson](https://discuss.elastic.co/u/stevesimpson)\
**Post date:** [September 16, 2022, 2:11pm UTC](https://discuss.elastic.co/t/how-to-run-a-pipeline-from-a-pipeline/314562/4 "2022-09-16T14:11:32Z")

</div>

Maybe something like this would work for a linear 1\>2\>3. If you want two pipelines to feed into one then maybe see the Collector architectural pattern in the above link.

```auto
# config/pipelines.yml
- pipeline.id: stage_1
  config.string: |
    input { beats { port => 5044 } }
    output { pipeline { send_to => [stage_2] } }
- pipeline.id: stage_2
  queue.type: persisted
  config.string: |
    input { pipeline { address => stage_2 } }
    filter {
      # do something
    }
    output { pipeline { send_to => [stage_3] } }
- pipeline.id: stage_3
  queue.type: persisted
  config.string: |
    input { pipeline { address => stage_3 } }
    output { elasticsearch { } }

```

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [September 16, 2022, 2:37pm UTC](https://discuss.elastic.co/t/how-to-run-a-pipeline-from-a-pipeline/314562/5 "2022-09-16T14:37:30Z")

</div>

> [@reed](#):
>
> is it possible exec a pipeline only at the end of another one?

This is not possible, if you configure a pipeline in `pipelines.yml`, it will start when Logstash is started.

You can configure a pipeline to send data to another pipeline, as the examples that @stevesimpson shared, but the events will be processed as they arrive.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 14, 2022, 2:37pm UTC](https://discuss.elastic.co/t/how-to-run-a-pipeline-from-a-pipeline/314562/6 "2022-10-14T14:37:53Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
