What is the execution sequence of watcher actions?

Are the actions synchronous or asynchronous?
Are they sequential?

I would like to use the output of the first action written to watcher-history in the second action of the watcher? Is this possible and / or recommended?

they are sequential and independent from each other. You cannot access any data from one action in another. Depending on your JSON serializer when writing the JSON to Elasticsearch the order is not guaranteed, this would require an array in JSON.

--Alex

You mean to say the actions are executed in the order in which they appear in the watcher's definition right?
As long as, we ensure that they are in the correct order, we could use the results of action 1 written in watcher history in action 2?

You cant. That was what I meant with their are independent from each other. No action can enrich the payload or change the context, thus you cannot access any result of an action.

You might be able to achieve something similar with a chained input, but that highly depends on your use-case, which you have not revealed yet.

Another alternative is always to run two watches of course.

Thanks Alexander!

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