--- title: "Profile in source structure (subprofile)" slug: "phase-3-target-structure-subprofile-source" updated: 2026-10-01T12:50:31Z published: 2026-10-01T12:50:31Z canonical: "docs.lobstersoftware.com/phase-3-target-structure-subprofile-source" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Profile in source structure (subprofile) You can use the context menu on a node or field of the target structure to insert an existing Profile (its target structure) as a subnode in the source structure (substructure). ## Requirements for a profile to be added (subprofile) A profile can be added if: - it is active and not suspended (see [Profile suspensions](/v1/docs/en/cc-exceptions--tab-1)), - Uses the normal data mapper (not the simple one) (see [Extended (Phase 2)](/v1/docs/en/profiles--tab-3-advanced)). - The options "Enter output channels for each record" and "Incorporate IU" must not be set (see [Extended (Phase 2)](/v1/docs/en/profiles--tab-3-advanced). - A profile with a time-driven Input agent of the “HTTP” type must not have checkbox "Activate parallel processing" set (see [HTTP (cron input agent)](/v1/docs/en/profiles--entry-tab-2-cron-http-tab-1)). ## Requirements for an added profile A profile can add another profile if it does not use the Document type "XML" with the "V4" parser. ## Adding a subprofile A profile can be added via the context menu (→ *Add profile as sub node in source tree*) of any field and node in the target structure. Another dialog will appear. ![images/download/attachments/157876855/1136-version-2-modificationdate-1745396582504-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/1136-version-2-modificationdate-1745396582504-api-v2.png) ① Select the profile to be added. ② Specify a unique prefix and a node name for the substructure. **NOTE:** The prefix ensures that all field/node names in the source structure remain unique, since two included profiles could use an identical field/node name, for example. The prefix has the effect that you get two distinct names `prefix1.fieldname` and `prefix2.fieldname`, for example. This also allows you to include the same profile twice. ③ This will add the profile. ### Result As a result, on the one hand, the function [call sub profile for source tree()](/v1/docs/en/basic-call-sub-profile-for-input-tree) is placed on your node/field in the target structure. The parameters `a`, `b` and `h` are set automatically (see there). On the other hand, you will then see the following substructure in the source structure. ![images/download/attachments/157876855/1137-version-2-modificationdate-1745396594518-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/1137-version-2-modificationdate-1745396594518-api-v2.png) ④ The attributes of nodes and fields of the subprofile are locked. However, you can modify them manually if you click on the lock if only minor details in the subprofile have changed. Otherwise, you should use the synchronisation (described below). ⑤ If changes have been made to the subprofile, you can synchronise them automatically via the context menu of the node (here `sub1.generate_random_number`) → *Synchronize with profile*. ## Calling a subprofile and data flow The substructure is always filled with data with function [call sub profile for source tree()](/v1/docs/en/basic-call-sub-profile-for-input-tree). The data always comes from the Target tree of the subprofile and not from its Integration Unit, etc. You can delete fields and nodes in the substructure if you only need a partial view of the data, but you always receive the full data from the subprofile. However, the hierarchical structure of the substructure must be preserved for the parsing to work. You can fill the substructure with data as often as you like by calling the above function multiple times (at any position). As a result, you will then simply get multiples of the substructure. You can also empty the substructure before the function is executed. In addition, the function can cache the result data and use it when called again, instead of calling the subprofile again. Take a look at the example profiles. The **order** in which the substructure is filled is how the associated function is called. If a subprofile has not yet been called via the function in the target structure, then the substructure in the source structure also has no data yet. You can map with this substructure as you are used to. If you are using a **path**, then please **do not** place it on `sub1.generate_random_number`, but on `sub1.node_random_number`. **IMPORTANT:** It is the responsibility of the user/developer to avoid endless loops (or to handle them appropriately) when using the subprofile mechanism described here! It is possible, for example, to create a profile 1 that includes profile 2. If you then include profile 1 in profile 2, you will get an endless loop. ## Passed variables (and lists and maps) The variables of the calling profile are passed to the subprofile. See [Profile chains](/v1/docs/en/intro-profile-chains). There you will also find a description of how to pass lists and maps (and all variables of the calling profile in a map). ## 1:1 mapping In a 1:1 mapping, the substructure is not transferred. ## Hierarchical structures As you may have noticed, the included profiles in the source structure are all "flat". Although they have nestings in themselves, you cannot insert a profile 1 first and then a profile 2 into profile 1. Nestings of this kind, i.e. the construction of a hierarchical overall structure, are achieved through mapping and the hierarchical structuring of the target structure. And these methods are all familiar to you from "normal" mappings. Specifically, the data from profile 2 can be inserted below/inside the data from profile 1 in the target structure. ## Application example Let’s assume profile 2 gets a number of items in an order. You could then go through the articles in the target structure, like you already know from "normal' mappings, and call a profile 1 (included in the source structure), which provides you with additional information about the respective article (the current price, the current stock in the warehouse, etc.). So profile 1 can be built by anyone as a service profile and you can use it in your profile to enrich your own information. So you only give profile 1 an item number, for example, and get back the desired data, without having to know what happens in the background, such as database queries or accesses to an ERP system. You also do not have to worry about changes in how those other systems are accessed. Your profile 2 can stay the same and only profile 1 has to be maintained if necessary. So just the way you want it in a service-oriented architecture. ## Example profiles ### Example 1 Following are two simple example profiles for illustration. - [Profile-Generate_random_number.pak](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/Profile-Generate_random_number.pak) (Import first and set active.) - [Profile-Call_subprofile_1.pak](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/Profile-Call_subprofile_1.pak) (Phases 4, 5 and 6 of the subprofile are not executed and its backup file is deleted. Have another look at the description of function [call sub profile for source tree()](/v1/docs/en/basic-call-sub-profile-for-input-tree)) First, perform a mapping test in profile` Call_subprofile_1` (a test file is included). At first there is not much to see there. We only see that the subprofile has been called successfully because the field `target_field`, on which the subprofile call takes place, has received the return value `true`. The substructure with the data of the subprofile is not displayed. ![images/download/attachments/157876855/1267-version-2-modificationdate-1745396608258-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/1267-version-2-modificationdate-1745396608258-api-v2.png) However, there is a separate tab in the mapping dialog where you can see the data that the subprofile provides. ![images/download/attachments/157876855/1268-version-2-modificationdate-1745396618885-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/1268-version-2-modificationdate-1745396618885-api-v2.png) ### Example 2 Next, we simply call the function twice in succession and look at the result. The substructure is then filled with data twice. So just the way you know it, if you read in two positions of an order, for example. - [Profile-Call_subprofile_2.pak](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/Profile-Call_subprofile_2.pak) *![images/download/attachments/157876855/1269-version-2-modificationdate-1745396629983-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/1269-version-2-modificationdate-1745396629983-api-v2.png)* ### Example 3 Now we also call the function twice, but we delete the data of the previous call with the parameter `g` in the second function call. So we only get the data of the second call in the substructure. In the target structure, the data of the substructure is mapped (look at the path). When you do a mapping test, you see one set of data. But in the subprofile calls tab you can see the data of both subprofile calls (as in the previous example). - [Profile-Call_subprofile_3.pak](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/Profile-Call_subprofile_3.pak) ### Example 4 In this example, we also call the function twice, but we now use parameter `j` in the first function call to store the result of the subprofile in the internal cache. In the second function call, we then use parameter `k` to use the cache contents instead of calling the subprofile again. When you perform a mapping test, you see one record. In the subprofile calls tab, you can also see only one subprofile call. - [Profile-Call_subprofile_4.pak](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/Profile-Call_subprofile_4.pak) ### Example 5 This example shows how to add the same subprofile twice. - [Profile-Call_subprofile_5.pak](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/Profile-Call_subprofile_5.pak) *![images/download/attachments/157876855/1264-version-1-modificationdate-1699500545603-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/1264-version-1-modificationdate-1699500545603-api-v2.png)* A profile is the central configuration unit in the Lobster Data Platform. It receives data, processes it, and forwards it. Configuration is done graphically, with no programming required. The input agent receives data in Phase 1 and starts a job for further processing. It works either as event based (passively waits for data) or scheduled (actively fetches data). Configuration in Phase 2, which determines the format of the input data. The document type determines how the parser reads the data and transfers it to the source tree. Examples: EDIFACT, XML, JSON, CSV, X12. XML (Extensible Markup Language) is a structured text format for storing and exchanging data. Content is enclosed within freely definable tags such as `<order>`. XML is human-readable, machine-processable, and platform-independent. In the Lobster Data Platform, you can receive, parse, and generate XML data. Structured representation of the input data in Phase 3. The target tree receives the values transferred via mapping and passes them on to Phase 4, Phase 5, or Phase 6. ## Related - [Source structure menu](/phase-3-source-structure-menu.md) - [Automated workflows (examples)](/workflows-examples-automated.md) - [Nested and networked profiles](/intro-nested-networked-profiles.md)