Watcher chain input example, use case

Hi @spinscale Alex,

I am looking for something like the following. It appears that the second search in the chain does not get populated.

Thanks for your interest and cooperation!

 {
   "trigger": {
     "schedule": {
       "interval": "20s"
     }
   },
   "input": {
     "chain": {
       "inputs": [
         {
           "first": {
             "search": {
               "request": {
                 "search_type": "query_then_fetch",
                 "indices": [
                   "firstindex"
                 ],
                 "types": [],
                 "body": {
                   "query": {
                     "bool": {
                       "must": [
                         {
                           "match": {
                             "lang": "en"
                           }
                         }
                       ]
                     }
                   }
                 }
               }
             }
           }
         },
         {
           "second": {
             "search": {
               "request": {
                 "search_type": "query_then_fetch",
                 "indices": [
                   "authorshipindex"
                 ],
                 "types": [],
                 "body": {
                   "query": {
                     "bool": {
                       "must": [
                         {
                           "match": {
                             "userid": "{{ctx.payload.first.hits.hits.0._source.userid}}"
                           }
                         }
                       ]
                     }
                   }
                 }
               }
             }
           }
         }
       ]
     }
   },
   "condition": {
     "always": {}
   },
   "actions": {
     "log_error": {
       "logging": {
         "level": "info",
         "text": "first {{#ctx.payload.first.hits.hits}} lang: {{_source.lang}}  --> {{#ctx.payload.second.hits.hits}}       author: {{_source.author}} \n {{/ctx.payload.second.hits.hits}}  \n {{/ctx.payload.first.hits.hits}} \n "
       }
     }
   }
 }