# Transform results in index with missing documents when using the API but works for console

**URL:** https://discuss.elastic.co/t/transform-results-in-index-with-missing-documents-when-using-the-api-but-works-for-console/363044
**Category:** Elastic Search
**Tags:** painless, transforms
**Created:** [July 12, 2024, 3:11pm UTC](https://discuss.elastic.co/t/transform-results-in-index-with-missing-documents-when-using-the-api-but-works-for-console/363044 "2024-07-12T15:11:15Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![Patrick\_Whelan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_whelan/32/135049_2.png) [@Patrick\_Whelan](https://discuss.elastic.co/u/Patrick_Whelan)
#### Post date: [July 12, 2024, 7:24pm UTC](https://discuss.elastic.co/t/transform-results-in-index-with-missing-documents-when-using-the-api-but-works-for-console/363044/7 "2024-07-12T19:24:43Z")

</div>

> [@Phil\_McLachlan](#):
>
> Is there any way to get a notification when a started transform is completed in golang

There isn't that kind of notification or eventing (that I know of).

Is the architecture something like one transform writing to an index, then a second transform reading from that index and pushing to another index?

If it is a non-continuous transform (i.e. it does not have `sync` and `frequency` in the config), the only way is to poll the stats API and check when the transform moves into `STOPPED`. If it is a continuous transform, the stats API has a "last checkpoint" timestamp that will get updated when the transform is finished the current iteration. The golang service/process would basically have to busy-wait though while polling for updates.

Alternatively, you could add an ingest pipeline to the destination index of the first tranform, and that ingest pipeline adds the current timestamp when the doc is added to the index. The second transform can use that time field to identify changes and then begin its work.

- [How to add time of ingestion to the document?](https://discuss.elastic.co/t/how-to-add-time-of-ingestion-to-the-document/243042)
- [Create transform API | Elasticsearch Guide [8.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html)

---

_[View the full topic](https://discuss.elastic.co/t/transform-results-in-index-with-missing-documents-when-using-the-api-but-works-for-console/363044)._
