When submitting records to an application, inconsistencies can result if you’re using a concurrency level greater than one and the records arrive at the destination out of order. However, you can use concurrency settings to prevent duplicate records and preserve the order of records.
- What is concurrency?
- Possible problems with concurrency
- Keep your records accurate
Concurrency lets you make multiple requests to an API at the same time. Setting your concurrency level to two or higher improves your flow’s speed and performance because you can process, change, and update multiple records simultaneously.
Example: Let’s say that you want to create an integration between NetSuite and Shopify, and every time you place an order in Shopify it automatically gets sent to NetSuite. If your concurrency level is set to five, then your flow will submit orders 5x faster than if it were set to only one.
Note: Reference the API documentation for the app or system that you’re integrating with to verify that your concurrency level does not exceed the number of simultaneous requests allowed by the system. For more information on setting concurrency, see Assign concurrency levels to data transfer.
When you use multiple concurrencies, messages can return simultaneously and get processed out of order. While this is rare, you can mitigate the possibility by setting up the Concurrency Lock ID Template.
Example: A customer updates their customer profile on a website and then immediately realizes they have entered the wrong phone number. They quickly edit their profile and save it again. Since these two events (the initial update and the edit) happen in quick succession, they may be handled by the same run of an integration flow. If concurrency is set to a level greater that one, the two updates might be processed in parallel, and the first update might be applied after the second. In such a case, the resulting customer record would incorrectly retain the errant phone number.
Use the Concurrency Id Lock Template field to ensure the records are always processed in the correct order. Enter one or more fields from your records to construct a unique key for each record. With the unique key (that you define), integrator.io will not process any two records with the same unique key value simultaneously, and records with duplicate key values will always be processed in the correct order. If two or more records that do NOT have the same unique key value come in at the same time, they will continue to be processed in parallel (preserving optimized flow performance for unrelated records).
- Go to integrator.io.
- From Home, click your integration tile.
- Open the import in the flow you want to adjust.
- In the Advanced settings section, find the Concurrency ID Lock Template field.
- Enter the field you want to use as the unique key (wrapped in three sets of curly brackets) to process records in the order that changes are received. For example:
- Click Save.
- Log in to integrator.io and click Tools > Flow Builder.
- Choose your source and destination apps, set up your connections, and configure your export and import. For more information on creating a flow, see Create a flow with Flow Builder.
- Set up your connections. For detailed instructions on how to set up common connections, see Connectors.
- Open the configuration form for your import.
- At the bottom of the import configuration form, under Advanced settings find the Concurrency ID Lock Template field.
- In curly brackets, enter the field you want to use as the unique key to make sure records are processed in the order that changes are received.
- Click Save.
You can use the editor to write more complex logic to lock your records in subsequent order. Click the pencil icon to the right of the Concurrency ID Lock Template field to open the editor.
- Type your handlebars template here: Enter the handlebars expression you want to use as your template.
- Resources available in your template: This displays sample data to test your expression.
- Evaluated handlebars template: This displays the value captured by your handlebars expression that would be used when processing the sample record.
- Save: Click Save or Save & close to save your configuration.