Write serverless invoke return output to file


I would like to invoke a function with serverless, have the value that is returned by my lambda written to a file.

The idea is that I can run this command and invoke the first function:
serverless invoke -f routemanager_plan --region us-east-1 --log -p routemanager_plan/event.json

have the return value written to a file:

and then have a second function consume that file:
serverless invoke -f routemanager_apply --region us-east-1 --log -p output_routemanager_plan.json

is there any native way of doing this in serverless? Ideally I’d like to just add a flag of something like -w output_routemanager_plan.json to the end of my first invoke command

This actually worked for my needs, I was able to pass the output of one function as input data to another

serverless invoke -f routemanager_apply \
--region us-east-1 \
-d "$(serverless invoke -f routemanager_plan --region us-east-1 -p routemanager_plan/event.json)" \