--- title: "Batch import" slug: "core-batch-import" updated: 2026-04-27T13:48:36Z published: 2026-04-27T13:48:36Z canonical: "docs.lobstersoftware.com/core-batch-import" --- > ## 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. # Batch import > [!NOTE] > A [Batch import](/v1/docs/en/core-batch-import) processes a series of [Import](/v1/docs/en/orchestration-integration-import) calls as a "batch" in a single "job". Each individual [Import](/v1/docs/en/orchestration-integration-import) executed in the "batch run" functionally resembles a [Single import](/v1/docs/en/core-import) with the corresponding structure and logic. The [Import](/v1/docs/en/orchestration-integration-import) page provides an overview of the interaction between **Lobster Data Platform/Orchestration** and **Lobster Data Platform/Integration** and describes the general structure of an import profile. > [!NOTE] > The structure used for [Single import](/v1/docs/en/core-import) corresponds exactly to the content of an individual `batch` node during [Batch import](/v1/docs/en/core-batch-import). > > In the following, the focus is therefore mainly on the details of batch processing, while the details of the actual import structure documented for the [Single import](/v1/docs/en/core-import) are assumed. > > In practice, the [Batch import](/v1/docs/en/core-batch-import) structure can also be used for importing individual objects. This enables the use additional functionalities exclusively available for the [Batch import](/v1/docs/en/core-batch-import), as required. ## Elements of the target structure for a batch import When creating an import profile for a [Batch import](/v1/docs/en/core-batch-import), the target structure is ideally created based on the template provided by the system for the `core:BatchImport` object (for details see [Orchestration templates](/v1/docs/en/orchestration-integration-templates)). The following screenshot shows a target structure generated from the `core:BatchImport` with the column "Data type" indicated here for information purposes: ![images/download/attachments/201675010/image2020-9-16_10-19-58-version-1-modificationdate-1747124555925-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-9-16_10-19-58-version-1-modificationdate-1747124555925-api-v2.png) - The "root node" highlighted by selection (BatchImport) contains a number of fields for parameters concerning the [Batch import](/v1/docs/en/core-batch-import). These are described in the following subsections. - Below, the template provides a single `batch` node (highlighted by the blue frame in the screenshot), which can either be iterated at runtime or explicitly included multiple times in the definition of the target structure. Every individual `batch` node is parameterized and interpreted like the `core:Import` node in a [Single import](/v1/docs/en/core-import). The screenshot shows only the elements provided by the template. Within a `batch` node, usually the *object structure* has to be added, which can be defined by exactly one (or several strictly alternatively handled) subnodes (see also [Single import](/v1/docs/en/core-import) and [Orchestration templates](/v1/docs/en/orchestration-integration-templates)). ### Transaction control (trxControl Atttribute) The `trxControl` attribute can be used to select one of the following transaction control modes for a [Batch import](/v1/docs/en/core-batch-import): | Transaction control mode | Description | | --- | --- | | `SINGLE` | Each `batch` node is processed as an independent transaction. If an individual import fails, subsequent imports are still executed. | | `BATCH` | All `batch` nodes are processed as a common transaction. If an individual import fails, the entire "batch" is aborted and any imports already executed are rolled back. | | `BATCH_OR_EXISTING` | For each object to be imported, a check is made whether a valid transaction already exists in the execution context. - If a valid transaction exists, it is used for the import. There will be no commit, nor will the transaction be terminated. - If no valid transaction exists, the import mode `BATCH` is used. **NOTE:** This mode makes sense if several profiles or events are to be linked together in a transaction. | ### Response behavior (responsive attribute) The `responsive` attribute can be assigned a Boolean value in order to decide in the context of a function call (see [Import (Integration function)](/v1/docs/en/de-lobster-scm-dw-filters-scm-import-filter)) whether the objects processed by a [Batch import](/v1/docs/en/core-batch-import) should appear as return values of the function (`true`) or not (`false`). **NOTE:** If the [Batch import](/v1/docs/en/core-batch-import) is defined as a target structure of a profile, this attribute is irrelevant. ### Error handling attributes | Attribute | Data type | Default value | Description | | --- | --- | --- | --- | | `optimisticRetries` | Integer | `0` | A value >0 defines the maximum number of retry attempts in case of a write conflict (optimistic lock exception). With the value `0` (or if the attribute is not used) no retries are attempted. | | `optimisticRetryDelay` | BigInteger | `0` | A value > 0 defines the waiting time in seconds before a retry in case of a write conflict (optimistic lock exception). | | `stopOnFirstError` | Boolean | `false` | With the value `true` the transaction control mode `SINGLE` is cancelled if an error occurs. With the value `false` (or if the attribute is not used) subsequent `batch` nodes are processed when an error occurs. | | `failAfterErrors` | Boolean | `true` | With the value `true` (or if the attribute is not used) the [Batch import](/v1/docs/en/core-batch-import) is flagged as a failure if an error occurs: - The "Overview" in the *Control Center* assigns the type "Jobs in error" when a profile fails. They also are listed under "Errors". With the value `false` the [Batch import](/v1/docs/en/core-batch-import) is not considered failed if an error occurs (see also `singleErrorHandlerProfile` attribute): - The "Overview" in the *Control Center* assigns the type "Successful Jobs". The profile is not listed under "Errors". However, error messages may be traceable in the "Log messages" for the job. | | `singleErrorHandlerProfile` | String | (empty) | The entry specifies a profile that is called for error handling with transaction control mode `SINGLE`; The specified profile receives a `core:Import` structure (see [Single import](/v1/docs/en/core-import)) reflecting the `batch` node that caused the error as input data. - This attribute is ineffective in conjunction with the transaction control mode `BATCH`. - If a [Batch import](/v1/docs/en/core-batch-import) should not file as a complete failure, after error handling by a `singleErrorHandlerProfile` the value `false` must be assigned to the `failAfterErrors` attribute. - If the specified profile name does not exist, the attribute has no effect. An error message does not occur in this case. | ## Example The following example demonstrates the use of a batch import to import master data for [Cities](/v1/docs/en/base-city) that are used in **Lobster Data Platform/Orchestration** to automatically complete address data. ### Input agent (Phase 1) Suitable source data can be downloaded from [www.geonames.org](http://www.geonames.org) for example. The archive file provided there contains source data in text format (tab-separated, UTF-8), which fits well to the data structure of the `City` object, as illustrated by the mapping described in the following section. In principle, a source file could be sent to an import profile by a "manual upload". Alternatively, a direct retrieval via HTTP-CronJob can be configured, as shown in the following screenshot: ![images/download/attachments/201675010/image2020-10-5_11-49-32-version-1-modificationdate-1747124555893-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-10-5_11-49-32-version-1-modificationdate-1747124555893-api-v2.png) - In the format of the "allCountries.zip" file specified here, specific data sources for individual countries are also available at the location specified. - When downloading the Zip file, it is essential that the option **Data comes in compressed** is set on the "General data" tab: ![images/download/attachments/201675010/image2020-9-16_10-23-16-version-1-modificationdate-1747124555919-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-9-16_10-23-16-version-1-modificationdate-1747124555919-api-v2.png) - Since the `allCountries`.zip file contains a large amount of data (seven-digit number of lines), it should be processed in sections (e.g. in groups of 5000 lines per record) to avoid memory space allocation issues. For this purpose, **Preparsing by** a special "preparser", the `TokenFileSplitter`, can be set up in the profile tab "General data". ![images/download/attachments/201675010/image2020-9-16_10-24-8-version-1-modificationdate-1747124555917-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-9-16_10-24-8-version-1-modificationdate-1747124555917-api-v2.png) The preparser is parameterized via a configuration file. Starting from a template, only the parameters in the last two lines need to be modified here. In addition to the number of `rows` per data sheet, a freely selectable `header` string must be specified. The `header` is inserted between the real source data rows at all positions where a new record should start. ![images/download/attachments/201675010/image2020-9-15_13-5-43-version-1-modificationdate-1747124555939-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-9-15_13-5-43-version-1-modificationdate-1747124555939-api-v2.png) The mapping (see below) must use a "matching" node (here: `newPage`), which recognizes the `header` string as a **Matchcode** and starts a new record. In the example: ![images/download/attachments/201675010/image2020-9-16_10-26-10-version-1-modificationdate-1747124555914-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-9-16_10-26-10-version-1-modificationdate-1747124555914-api-v2.png) ### Parser (Phase 2) To ensure that splitting the input data into manageable amounts of data per record also affects the effective execution of the import, the options **Enter output channels for each record** and **Incorporate IU** must be set in phase 2 of the profile: ![images/download/attachments/201675010/image2020-9-16_10-27-55-version-1-modificationdate-1747124555912-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-9-16_10-27-55-version-1-modificationdate-1747124555912-api-v2.png) With these settings, the profile creates a separate batch import job for each record at runtime, each covering at maximum the number of `batch` nodes specified by parameter `rows` in the `tokenFileSplitter` preparser. ### Mapping (Phase 3) The **Source structure (1)** must be set up according to the imported file format. The following screenshot shows the fields to be created with data type (including test data) as child-elements of the node names `city`. Each row provides the data for exactly one [Cities](/v1/docs/en/base-city) data object to be created. The purpose of the `newPage` node added above the `city` node, is to split the source data into records (see above). **NOTE:** For the `latitude` and `longitude` fields, the data type BigDecimal was selected, for which a suitable template for converting the text into numerical values must also be assigned in the field definition. ![images/download/attachments/201675010/image2020-9-16_10-53-24-version-1-modificationdate-1747124555910-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-9-16_10-53-24-version-1-modificationdate-1747124555910-api-v2.png) To build the **Target structure**, the system provides specific templates (see [Orchestration templates](/v1/docs/en/orchestration-integration-templates)) for the data structures of **Lobster Data Platform/Orchestration**. - First the `core:BatchImport` template **(2)** with the basic structure for a batch import was loaded. In the screenshot, the type `BATCH` is already entered as a fixed value for transaction control, since the imported [Cities](/v1/docs/en/base-city) are to be imported by batch transactions and not individually. - Inside the `batch` node **(3)**, the action `CREATE` is assigned as a fixed value, since a new [Cities](/v1/docs/en/base-city) data object is to be created for each imported row. The `batch` node is connected to the `city` node of the source structure by a path, so that it is iterated for each imported "city". - The `eventStorge` and `search` nodes are not needed here and therefore set to inactive. They could also be deleted instead. - For the `City` node **(4)**, again, one of the [Orchestration templates](/v1/docs/en/orchestration-integration-templates) (`base:City`) was used, which was appended as a subnode to the `batch` node with option **Skip entity attributes** set: ![images/download/attachments/201675010/image2020-9-16_10-55-28-version-1-modificationdate-1747124555907-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-9-16_10-55-28-version-1-modificationdate-1747124555907-api-v2.png) - The mapping of source data fields to the target fields within the `City` node is considered self-explanatory from the labels. - The field settings for the "decimal" target fields `latitude` and `longitude` should be set to fit to the data content to ensure that relevant decimal places are not accidentally shortened. **NOTE:** The configuration for phase 4 is not required. Phases 5 and 6 are set up as described under [Import](/v1/docs/en/orchestration-integration-import). No specific settings for the *Batch* import are required here. ### Results To illustrate the effect of the `tokenFileSplitter` preparser used here as a special feature, the `rows` value was temporarily set to `5` and a mapping test with a smaller data set (only "places" in Chile) was executed: ![images/download/attachments/201675010/image2020-9-16_11-4-38-version-1-modificationdate-1747124555897-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-9-16_11-4-38-version-1-modificationdate-1747124555897-api-v2.png) - The **Source structure** (left) shows that records are created with a maximum of 5 `City` nodes each. - The first `City` node in the source structure corresponds to the first `batch` node in the **Target structure** (right) expanded and shows identical data. The batch import job for the first record (`Record 1` in the target structure during the mapping test) would be structured as follows: ```xml                                         ```