Subprocess middleware