cancel
Showing results for 
Search instead for 
Did you mean: 

Data Consistency in workato

TilakBhatia
Deputy Chef III
Deputy Chef III

Hello Team,

I'm encountering a scenario where a race condition is occurring.

To elaborate, there's API1 responsible for creating a record in the database, while API2 updates the same data in the database. Both calls are received almost simultaneously, failing to record because sometimes it updates the data while the record is being inserted/processed.

This is a typical issue in operating systems and programming. While it can be addressed through programming and some adjustments, I'm curious if Workato offers any out-of-the-box solutions similar to wait-notify.

Best regards, Thanks in Advance.
Tilak Bhatia

1 ACCEPTED SOLUTION

Hi @TilakBhatia ,

You can raise a support ticket a couple of ways:

  1. Log in to your Workato Account, Click on "AssistIQ" at the bottom of your screen, then select "Give feedback" at the bottom of that menu.
  2. Reach out to your Workato rep directly.

Thank you,
Meghan

View solution in original post

3 REPLIES 3

gary1
Executive Chef III
Executive Chef III

I don't know if there are any out of the box solutions for this, but in my opinion this can be solved with the right recipe design.

Ideally both APIs would trigger the same Workato recipe, and you could sequence the API calls within the recipe. 

If you're unable to change the way Workato is triggered here are a couple of options, including a way to route both calls into a single recipe. 

  1. You could use a Scheduler action to insert a sleep/wait at the beginning of the API2 recipe. This isn't a perfect solution, but if API1 consistently runs for the same duration, it's a very simple solution.
  2. You can make a series of recipes to route and sequence the API calls with more control.  
    1. API1 calls Recipe1, and Recipe1 calls RecipeA and stops
    2. API2 calls Recipe2, and Recipe2 also calls RecipeA and stops
    3. RecipeA works like this:
      1. If triggered by Recipe1, create a record and stop
      2. If triggered by Recipe2, create a record, then update the record, and stop
        1. If you have APIs to verify a record exists, Recipe A could also work like this: If triggered by Recipe2, verify if the record exists; if the record does not exist, then wait or create it; if the record does exist, then update it and stop

All recipes above would be async function recipes.

Hi Gary, 

Thanks for the insight. Sure programmatically this is achievable; however, this is a fundamental programming and there should be a standard solution for that. While I worked on other iPaaS TIBCO, Mule for example a standard solution was given "wait-notify" or "crtical-activity-lock" mechanism. Could you please advise how to reach out to workato engineering team to raise the concern. 

Regards, 

Tilak Bhatia

Hi @TilakBhatia ,

You can raise a support ticket a couple of ways:

  1. Log in to your Workato Account, Click on "AssistIQ" at the bottom of your screen, then select "Give feedback" at the bottom of that menu.
  2. Reach out to your Workato rep directly.

Thank you,
Meghan