Rescheduling API Workflow

Hello all,

I have been trying to understand what is really happening when I try to reschedule an API workflow and save API Workflow’s id to the same object. Maybe someone can help me with this.

We are running auctions in our application and we schedule an API workflow to end the auction. So we simply schedule an API workflow to change auction object’s field called accepts_bid from yes to no. We also record scheduled API workflow ID to the auction object’s field called API_ID.

The reason we record scheduled API workflow ID it to cancel it when needed. One of the use case we have is when we want to extend the auction end time. We extend auctions 5 more minutes when there is new bid placed within last 5 minutes of auction.

For example; auction is scheduled to end at 10:00 am and user place a bid at 9:57. In this case, we extend the auction 5 more minutes - 9:57 + 5 = 10:02
We cancel previous scheduled workflow and schedule a new one in the same workflow.

So workflow goes:
1 - Cancel previously scheduled API Workflow
1 - Schedule a new API Workflow
2 - Make changes to auction and save new API Workflow ID

1 - Cancel scheduled API - auction’s API_ID

note that we use auction’s API_ID field

2- Schedule API Workflow-auction-ends


3- Make changes to auction

note that we use the same auction’s API_ID field

This workflow is working for us %95 of the time, but sometimes it doesnt cancel the scheduled api (1st) for some reason. This usually happens when we receive too many bids one another and this workflow getting called multiple times in couple of seconds.

Any idea how I should approach this? There is some asynchronous action going that I dont understand.

This topic was automatically closed after 14 days. New replies are no longer allowed.