Middleware to invoke remote custom tasks.