# Workflow design: How to retrieve a sub-process request ID in the parent process

**URL:** <https://discuss.workflowgen.com/t/workflow-design-how-to-retrieve-a-sub-process-request-id-in-the-parent-process/394>\
**Category:** Process Design\
**Created:** [October 14, 2015, 1:31am UTC](https://discuss.workflowgen.com/t/workflow-design-how-to-retrieve-a-sub-process-request-id-in-the-parent-process/394 "2015-10-14T01:31:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [October 14, 2015, 1:31am UTC](https://discuss.workflowgen.com/t/workflow-design-how-to-retrieve-a-sub-process-request-id-in-the-parent-process/394/1 "2015-10-14T01:31:05Z")

</div>

In some cases, you might have to save a sub-process request ID in a process data of the parent process. The solution is to update this parent process data (e.g. `CHILD_ID`) from the sub-process itself.

**Note:** This applies to WorkflowGen versions 5.6.3 and later only.

### In the sub-process

#### Process data

Define a new process data:

- Name: `PARENT_ID`

- Data type: `Numeric`

- Sub-process parameter: `IN`

This way, when the sub-process is launched, its process data `PARENT_ID` will contain the parent request ID that instantiated the sub-process.

#### Workflow

Create a new action (just after the start point) using the UPDATEPROCESSDATA workflow application with the following parameters:

- `REQUEST_ID` send the value of: Data: `PARENT_ID` (or use the `Parent Request.Id` macro)

- `CHILD_ID` send the value of: Macro: `Request.Id`

You can add an exception management on this action if the UPDATEPROCESSDATA application fails.

### In the parent process

#### Process data

Define a new process data:

- Name: `CHILD_ID`

- Data type: `Numeric`

#### Workflow

In your sub-process action, add the following new parameter:

- `PARENT_ID` send the value of: `Macro: Request.Id`
