# How to access workflow variables within email task

**URL:** <https://forum.flowable.org/t/how-to-access-workflow-variables-within-email-task/2725>\
**Category:** Flowable Engine\
**Created:** [October 12, 2018, 7:31pm UTC](https://forum.flowable.org/t/how-to-access-workflow-variables-within-email-task/2725 "2018-10-12T19:31:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jared](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@Jared](https://forum.flowable.org/u/Jared)\
**Post date:** [October 12, 2018, 7:31pm UTC](https://forum.flowable.org/t/how-to-access-workflow-variables-within-email-task/2725/1 "2018-10-12T19:31:02Z")

</div>

I am wondering how I get the ProcessInstanceId to send in an email task.  
I have tried:  
{ProcessInstanceId} {ProcessInstanceId[‘pid’]}  
#{ProcessInstanceId.pid}  
#{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.

#{processVariables[‘accountNumber’]}  
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!

---

<div class="post-metadata">

**Author:** ![rgorzkowski](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/rgorzkowski/32/1365_2.png) [@rgorzkowski](https://forum.flowable.org/u/rgorzkowski)\
**Post date:** [October 12, 2018, 9:08pm UTC](https://forum.flowable.org/t/how-to-access-workflow-variables-within-email-task/2725/2 "2018-10-12T21:08:03Z")

</div>

Hi @Jared

You can use this:

> ${execution.getProcessInstanceId()}
