# Batch transform done indicator

**URL:** <https://discuss.elastic.co/t/batch-transform-done-indicator/257345>\
**Category:** Elasticsearch\
**Tags:** transforms\
**Created:** [December 2, 2020, 10:46am UTC](https://discuss.elastic.co/t/batch-transform-done-indicator/257345 "2020-12-02T10:46:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaijun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaijun/32/78396_2.png) [@kaijun](https://discuss.elastic.co/u/kaijun)\
**Post date:** [December 2, 2020, 10:46am UTC](https://discuss.elastic.co/t/batch-transform-done-indicator/257345/1 "2020-12-02T10:46:09Z")

</div>

I am performing a batch transform on my ES index (only transforming for once and not a continuous job). Is there an API or indicator that returns a response once the transformation is done (so that I could then stop the transform job)?

---

<div class="post-metadata">

**Author:** ![Hendrik\_Muhs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hendrik_muhs/32/25802_2.png) [@Hendrik\_Muhs](https://discuss.elastic.co/u/Hendrik_Muhs)\
**Post date:** [December 2, 2020, 2:30pm UTC](https://discuss.elastic.co/t/batch-transform-done-indicator/257345/2 "2020-12-02T14:30:31Z")

</div>

Batch transform auto-stop, so there is no task being leftover after it is done. The only "left-over" beside the transformed data are 2 tiny documents in an internal index.

If you are looking for a callback you can use in code, you can call `_stop` with `wait_for_completion` and `wait_for_checkpoint` being set to `true`. `wait_for_completion` will tell it to block and `wait_for_checkpoint` will tell it to not stop the transform in an intermediate state but let it run until a checkpoint is ready (Batch transforms have just 1 checkpoint).

---

<div class="post-metadata">

**Author:** ![kaijun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaijun/32/78396_2.png) [@kaijun](https://discuss.elastic.co/u/kaijun)\
**Post date:** [December 3, 2020, 11:41am UTC](https://discuss.elastic.co/t/batch-transform-done-indicator/257345/3 "2020-12-03T11:41:14Z")

</div>

Just a quick follow up, to set a query parameter for the \_stop api, is this how I should do it?

```auto
curl -X POST "localhost:9200/_transform/<jobID>/_stop?pretty" -d'
{
  "query": {
      "wait_for_completion": true,
      "wait_for_checkpoint": true
  }
}
'

```

---

<div class="post-metadata">

**Author:** ![Hendrik\_Muhs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hendrik_muhs/32/25802_2.png) [@Hendrik\_Muhs](https://discuss.elastic.co/u/Hendrik_Muhs)\
**Post date:** [December 3, 2020, 2:30pm UTC](https://discuss.elastic.co/t/batch-transform-done-indicator/257345/4 "2020-12-03T14:30:32Z")

</div>

query parameters go into the URL part:  
`curl -X POST "localhost:9200/_transform/ecommerce_transform/_stop?wait_for_completion=true&wait_for_checkpoint=true"`

(I removed `pretty`, its not needed)

---

<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:** [December 31, 2020, 2:30pm UTC](https://discuss.elastic.co/t/batch-transform-done-indicator/257345/5 "2020-12-31T14:30:34Z")

</div>

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