# Howto get Process Definition version by deploymentId?

**URL:** <https://forum.camunda.io/t/howto-get-process-definition-version-by-deploymentid/48713>\
**Category:** Camunda 7 Topics\
**Tags:** process-engine, camunda-7\
**Created:** [November 9, 2023, 9:28am UTC](https://forum.camunda.io/t/howto-get-process-definition-version-by-deploymentid/48713 "2023-11-09T09:28:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dasha.levanyuk98](https://forum.camunda.io/user_avatar/forum.camunda.io/dasha.levanyuk98/32/26083_2.png) [@dasha.levanyuk98](https://forum.camunda.io/u/dasha.levanyuk98)\
**Post date:** [November 9, 2023, 9:28am UTC](https://forum.camunda.io/t/howto-get-process-definition-version-by-deploymentid/48713/1 "2023-11-09T09:28:34Z")

</div>

Hello!

Please tell me, is it possible to find out information about the process definition using the deployment Id?

For now, I found only API method GET `/deployment/{id}`

````auto
{
  "id": "someDeploymentId",
  "name": "deploymentName",
  "source": "process application",
  "deploymentTime": "2013-04-23T13:42:43.000+0200"
}
``` but it returns only half of the information that we got after POST /deployment/create

````

{  
“links”: [  
{  
“method”: “GET”,  
“href”: “[http://localhost:38080/rest-test/deployment/aDeploymentId](http://localhost:38080/rest-test/deployment/aDeploymentId)”,  
“rel”: “self”  
}  
],  
“id”: “aDeploymentId”,  
“name”: “aName”,  
“source”: “process application”,  
“deploymentTime”: “2013-01-23T13:59:43.000+0200”,  
“tenantId”: null,  
“deployedProcessDefinitions”: {  
“aProcDefId”: {  
“id”: “aProcDefId”,  
“key”: “aKey”,  
“category”: “aCategory”,  
“description”: “aDescription”,  
“name”: “aName”,  
“version”: 42,  
“resource”: “aResourceName”,  
“deploymentId”: “aDeploymentId”,  
“diagram”: “aResourceName.png”,  
“suspended”: true,  
“tenantId”: null,  
“versionTag”: null  
}  
},  
“deployedCaseDefinitions”: null,  
“deployedDecisionDefinitions”: null,  
“deployedDecisionRequirementsDefinitions”: null  
}

```auto

In our case, we exclude duplication of processes in the engine by using parameters "deployment-name" and "enable-duplicate-filtering", because sometimes a repeated post request with an identical scheme may be sent. If it happens, the engine returns
{
    "links": [
        {
            "method": "GET",
            "href": "https://dev.ap.mts-corp.ru/engine-rest/deployment/41300c13-7ecc-11ee-baa6-2aa02eb2c3b6",
            "rel": "self"
        }
    ],
    "id": "41300c13-7ecc-11ee-baa6-2aa02eb2c3b6",
    "name": "asd2",
    "source": null,
    "deploymentTime": "2023-11-09T06:50:22.714+0000",
    "tenantId": null,
    "deployedProcessDefinitions": null,
    "deployedCaseDefinitions": null,
    "deployedDecisionDefinitions": null,
    "deployedDecisionRequirementsDefinitions": null
}

Thus, we can use only deployment Id, name and tenant=id to find the process version, id, key
```

---

<div class="post-metadata">

**Author:** ![moshell](https://forum.camunda.io/user_avatar/forum.camunda.io/moshell/32/27287_2.png) [@moshell](https://forum.camunda.io/u/moshell)\
**Post date:** [November 9, 2023, 11:32am UTC](https://forum.camunda.io/t/howto-get-process-definition-version-by-deploymentid/48713/2 "2023-11-09T11:32:40Z")

</div>

Даша, привет!

ю кэн юз зис.

```auto
ProcessDefinition processDefinition = camunda.getRepositoryService().createProcessDefinitionQuery()
                .processDefinitionVersion(dto.getProcessDefinitionVersion())
                .singleResult();

```

 ![image](https://forum.camunda.io/uploads/default/original/3X/a/2/a2cd38f83754011b353dddf61d1e4511037cdd1f.png)

---

<div class="post-metadata">

**Author:** ![moshell](https://forum.camunda.io/user_avatar/forum.camunda.io/moshell/32/27287_2.png) [@moshell](https://forum.camunda.io/u/moshell)\
**Post date:** [November 9, 2023, 11:41am UTC](https://forum.camunda.io/t/howto-get-process-definition-version-by-deploymentid/48713/3 "2023-11-09T11:41:39Z")

</div>

sorry.  
this is correct

```auto
ProcessDefinition processDefinition = camunda.getRepositoryService().createProcessDefinitionQuery()
                .deploymentId(deploymentId)
                .singleResult();

```
