Automator: pass-through input
It's very easy to do this; all you need to do is use the 'Set Value of Variable', execute your bash script, then use 'Get Value of Variable'. You can also set multiple variables, name them, etc. as you need. Take a look at the quick example I created, which should resemble what you are intending to do. You'll notice that after I set the variable my bash script searched for files elsewhere, then after that was completed I easily recalled the variable (files a, b, c).