How to access workflow variables within email task

I am wondering how I get the ProcessInstanceId to send in an email task.
I have tried:
{ProcessInstanceId} {ProcessInstanceId[‘pid’]}

And about a million other combinations.
If anyone is able to help direct me as to how to access workflow runtime variables in things like httptask or emailtask, I would greatly appreciate it.

was an example given in the docs about injected variables. Another thing I am unclear on is when to use $ and when to use #?

Thank you!

Hi @Jared

You can use this: