# REST API - Process Definition Variables

**URL:** <https://forum.flowable.org/t/rest-api-process-definition-variables/6271>\
**Category:** Flowable Engine\
**Created:** [June 25, 2020, 12:11am UTC](https://forum.flowable.org/t/rest-api-process-definition-variables/6271 "2020-06-25T00:11:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Catalyst344](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@Catalyst344](https://forum.flowable.org/u/Catalyst344)\
**Post date:** [June 25, 2020, 12:11am UTC](https://forum.flowable.org/t/rest-api-process-definition-variables/6271/1 "2020-06-25T00:11:47Z")

</div>

Hi all,

Let’s say I have a process that has 2 tasks and a decision gate. **Task A** , **Decision Gate A** and **Task B**.

**Task A** is an HTTP task which uses variables **$TestVar** and **$TestVar2**.  
**Decision Gate A** uses a variable **$DecisionVar** in an expression to decide which way the flow should go.  
**Task B** uses a variable named **$TestVar3**

Using the REST API, is there any call I can make that would retrieve me the list of all variables in the process/BPMN model?

Anything along the lines of this?  
{  
processId: 123xyz  
variables: [  
TestVar,  
TestVar2,  
DecisionVar,  
TestVar3  
]  
}

I know there is the following call that will give me everything:

```
/flowable-task/process-api/repository/process-definitions/{definitionId}/model

```

And I could potentially parse through everything myself and get a unique list of variables, but I wanted to see if there is a more elegant way.

Also, assuming there is a way to bind / retrieve variables for a particular process definition (before we actually instantiate it), would there be an equivalent POST/PUT call to attach more variables to a specific task?

Or would I have to actually modify the BPMN of the process and inject variables into whichever property is needed?

Thank you in advance! Just trying to have an understanding of what is possible in terms of relationships between variables / process definitions.

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [June 28, 2020, 9:47am UTC](https://forum.flowable.org/t/rest-api-process-definition-variables/6271/2 "2020-06-28T09:47:32Z")

</div>

No, that’s not possible. Due to the free-form of expressions (complex expressions or expressions that resolve to a java delegate that sets variables), that information is not gathered/exposed.

---

<div class="post-metadata">

**Author:** ![Catalyst344](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@Catalyst344](https://forum.flowable.org/u/Catalyst344)\
**Post date:** [June 29, 2020, 9:34pm UTC](https://forum.flowable.org/t/rest-api-process-definition-variables/6271/3 "2020-06-29T21:34:33Z")

</div>

Thank you for the response!
