Task queue completion status

0
Hi All,   We have one requirement where user upload a file and the file is extracted and validated aganist some rules. Until this process is completed the file will be in Uploaded status and after the rules have executed the status moved review completed.  Since the rules are taking a lot of time to complete, we have divided them and running in parallel using task queue. Now We want to change the status to review completed after all the rules are executed. Since these are running in background we can not check completion status. How to achieve the same.   Regards Ajay
asked
1 answers
1

Hi Ajay Kumar,

 

 When you submit tasks to the Task Queue, keep track of them in a separate “Task Tracker” entity with fields like:

 

File ID

Total rules

Completed rules

Status (In Progress / Completed)

 

Each queued task should update the tracker once its rule execution is finished.

After every update, check whether:

 

CompletedRules == TotalRules

 

If yes → update the File status to Review Completed.

 

Example flow:

 

Upload → Create File + Tracker record

 

For each rule → Add task to Task Queue (store reference to tracker)

 

In each async task → increment CompletedRules

 

Microflow checks if all tasks done → set File status to Review Completed

 

This way you don’t need to wait for parallel tasks in background, and status updates will be accurate once all rules finish.

 

answered