Ingesting only new documents from Elasticsearch

I'm using the elasticsearch input plugin to get documents from another elasticsearch instance. Then the elasticsearch output plugin to ingest it in another instance.

But how do I schedule/filter the plugins/pipeline, so that I only search for and ingest new documents?