<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Duplicate records created in Salesforce with Concurrent processing of SQS events in Workato Pros Discussion Board</title>
    <link>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5602#M2475</link>
    <description>&lt;P&gt;you mean to wait while we check in source system for salesforce Id?&lt;/P&gt;</description>
    <pubDate>Fri, 10 Nov 2023 18:41:46 GMT</pubDate>
    <dc:creator>nikhilb</dc:creator>
    <dc:date>2023-11-10T18:41:46Z</dc:date>
    <item>
      <title>Duplicate records created in Salesforce with Concurrent processing of SQS events</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5600#M2473</link>
      <description>&lt;DIV&gt;Hi Pros!&lt;BR /&gt;&lt;BR /&gt;We have a challenge with the concurrency(parallel jobs) in consuming the events from SQS to Salesforce with Workato.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The use case is, we have batch load processes on our source application which can create large number of events to SQS possibly with multiple events for a single record.&lt;BR /&gt;When we try to consume the events from SQS and process to Salesforce using Workato, we're using concurrency of 5(to handle large volumes).&lt;/DIV&gt;&lt;DIV&gt;This resulting in creating duplicate records in Salesforce when different create/update events of a single record are shared across concurrently running threads and processed.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Note: We have a check to update a record in Salesforce if we have a salesforce Id associated in our source application. But as the processing of these events happening parallelly, the check gets satisfied for a new record to salesforce which is extracted at the same time and then in next steps, new records(duplicates) are created in Salesforce with concurrently running jobs.&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Question: How can we avoid processing streaming events related to a single record multiple times while using Concurrency?&lt;BR /&gt;P.S: We may get multiple events related to a single record in the SQS queue. The queue is not FIFO and we are already trying to extract 2k messages in a single batch and deduplicating(on a single job).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any quick suggestion or guidance is highly appreciated.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 Nov 2023 12:07:52 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5600#M2473</guid>
      <dc:creator>nikhilb</dc:creator>
      <dc:date>2023-11-10T12:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate records created in Salesforce with Concurrent processing of SQS events</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5601#M2474</link>
      <description>&lt;P&gt;If no record is returned, have the system wait a few seconds and then check again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 15:28:01 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5601#M2474</guid>
      <dc:creator>rachelnatik</dc:creator>
      <dc:date>2023-11-10T15:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate records created in Salesforce with Concurrent processing of SQS events</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5602#M2475</link>
      <description>&lt;P&gt;you mean to wait while we check in source system for salesforce Id?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 18:41:46 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5602#M2475</guid>
      <dc:creator>nikhilb</dc:creator>
      <dc:date>2023-11-10T18:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate records created in Salesforce with Concurrent processing of SQS events</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5603#M2476</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://systematic.workato.com/t5/user/viewprofilepage/user-id/9765"&gt;@nikhilb&lt;/a&gt;, Instead of checking for an existing record in Salesforce manually, have you tried to use the Salesforce Upsert action instead? With that, you have it over to Salesforce to perform an INSERT or UPDATE&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 09:05:46 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5603#M2476</guid>
      <dc:creator>chris-wiechmann</dc:creator>
      <dc:date>2023-11-13T09:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate records created in Salesforce with Concurrent processing of SQS events</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5604#M2477</link>
      <description>&lt;P&gt;Thanks for the response &lt;a href="https://systematic.workato.com/t5/user/viewprofilepage/user-id/5784"&gt;@chris-wiechmann&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Actually we're not checking manually on salesforce side but from our source application, if there exists a Salesforce Id on incoming record, it'll go as update else create. And as soon as we create record in Salesforce, we send acknowledgement with Salesforce Id back to source application.(This will help in next updates)&lt;/P&gt;&lt;P&gt;Upsert would require an external Id/primaryKey and even this might fail in our case because, when the incoming new record comes via SQS in multiple events(there can be multiple updates on single record producing multiple events to SQS), it doesn't have any Salesforce Id associated. We have concurrency of 5 and these multiple events of same Record are processed concurrently to Salesforce so all these go as new records as there was no Salesforce Id found to update.&lt;/P&gt;&lt;P&gt;Hope this gives more details.&lt;/P&gt;&lt;P&gt;For now we are switching to single thread and planning on another staging queue/file to deduplicate events of single record within some time period.&lt;/P&gt;&lt;P&gt;Any other suggestions are appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 12:27:25 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5604#M2477</guid>
      <dc:creator>nikhilb</dc:creator>
      <dc:date>2023-11-13T12:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate records created in Salesforce with Concurrent processing of SQS events</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5613#M2478</link>
      <description>&lt;P&gt;I had this issue with another client. Every edit to a record in System A would create or update a record in System B. Which means that if a new record in System A was created and then modified, it could create 2 new records in System B. To resolve this, we do the following:&lt;BR /&gt;1. Check if there is a unique Id in System A.&amp;nbsp;&lt;BR /&gt;2. If Yes - match with that record in System B.&lt;BR /&gt;3. If NO -&amp;nbsp;&lt;BR /&gt;3.1 Wait 5 minutes&lt;BR /&gt;3.2. Retrieve the same record details&lt;BR /&gt;3.3. Check if the Id is now populated (since another job might have completed in the meantime)&lt;BR /&gt;3.4. Yes - use that record&lt;BR /&gt;3.5. No - create new record.&lt;BR /&gt;&lt;BR /&gt;This has eliminated 99% of our duplicates.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 15:59:00 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5613#M2478</guid>
      <dc:creator>rachelnatik</dc:creator>
      <dc:date>2023-11-13T15:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate records created in Salesforce with Concurrent processing of SQS events</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5784#M2534</link>
      <description>&lt;P&gt;Thanks for the response&amp;nbsp;&lt;a href="https://systematic.workato.com/t5/user/viewprofilepage/user-id/5634"&gt;@rachelnatik&lt;/a&gt;.&lt;BR /&gt;This looks like a good idea but in our case we are doing batches of records at a time to handle large volumes and the wait times may cause delays as much as using single thread!&lt;BR /&gt;The unique Id gave a new idea! We'll have the System B to enforce unique constraint on Id from System A. Thus any duplicates for same record(Id in system A) created in system B would be rejected!(We're ok with the rejections on duplicates and log them)&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 08:32:39 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/duplicate-records-created-in-salesforce-with-concurrent/m-p/5784#M2534</guid>
      <dc:creator>nikhilb</dc:creator>
      <dc:date>2023-12-06T08:32:39Z</dc:date>
    </item>
  </channel>
</rss>

