Automated Triggers for flows

Hi Everyone,
I have a flow that includes :
Dispatcher- run on 1 bot
Performer - run on 20 bots (triggered using start job activity from Dispatcher)
Finisher - run on 1 bot (time based trigger)
the bot runs every day, the number of transactions in dispatcher queue is variable, (some runs it may be very high, and in some, it will be very less) , so the performer gets ended at some undefined time.
we added trigger for the finisher at some average time range like (45min after dispatcher starting) but in some runs dispatcher&performer gets ended in 10 min so the process remains ideal for around 35min after which finishers are triggered.
Can you please suggest me some way to trigger the finisher workflow as soon as all the performer(running on multibots) have completed running

1 Like

@kl_kl

I suggest you to follow below design for your process.

  1. Schedule Dispatcher process for every 10 Mins. on one machine to add items to Queue.

  2. For Performer process, create Queue trigger. So that if items get add then all performer processes will be triggered by taking one by one item from the queue. In this way you will utilise all Bot machines properly without any ideal time.

Hey @kl_kl

On the performer bot, Just have a check at the end of you have any new items present in the Performer Queue.

If the items are present just do nothing.

If items are not present then use start job to trigger final finishing process.

In the above method, instead of start job you can even use a separate queue and add item to queue for the final bot to trigger may be a more cleaner approach

Thanks
#nK

1 Like

thanks @lakshman ,
the Dispatchers need to be time based triggered(according to my business need) so I don’t need to change that
Currectly I am using start job activity inside dispatcher to call the Performer which is working perfect , so I don’t want to change to new queue based trigger for now
Can you suggest someway to trigger Finisher ? which needs to run on 1 bot only

1 Like

Thanks @Nithinkrishna
the performer runs on multibot(10 bots) so if I add startjob for finisher at end of the performer then 10 start jobs will be initiated for the finisher when all the performers end.
But I have to run the finisher flow in 1 bot

Don’t do this. Just create a queue trigger to start the performer.

What is the Finisher doing?

Hey @kl_kl

Yes you are right.

You need to add a check if there are no new items present in the queue.

Thanks
#nK

Sorry @Nithinkrishna I could not understand what you are telling.
Let me add few more points:
I have two queues (Dispatcher and finisher)
Dispatcher workflow add data to the Dispatcher queue and it adds in bulk
Performer workflow takes data from this Dispatcher queue and processes and finally send the processed data to the Finisher queue
Finisher workflow takes data from the finisher queue and creates a final report

Now Dispatcher workflow needs to run in 1 device (time based triggering)
performer will run on multiple devices (currently using startjib from dispatchers to start this)
Finisher needs to run on 1 device (currently using a time based trigger)

I wish to change this Finisher workflow into some king of dynamic way as soon as all the performer ends ,
yes I can do that by adding a start jib activity at the end section of the performer , but as performer “code” is running on 10 different devices so 10 start job signals will be sent for the finisher flow , but I need only 1

Hi @postwick
Thanks for the suggestion,
Yes we had tried queue based trigger for performer , but it had one problem like Dispatcher is sending items to the queue in chunks so say 10 have reached to queue, and the performers started asap , and the consumed all 10 and stopped , by that time again some new items got into queue by dispatcher and again the cycle goes on
So the performers were triggered continuously and it was very heavy for the bots
Thats why we decided to use start job for triggering performers

This means you didn’t have the queue trigger set up properly. In a Queue trigger you tell it 3 things:

  • how many simultaneous jobs to run
  • how many queue items cause it to trigger (ie start the job after 1 item is added to queue, or 2 items, or 5 etc)
  • how often to trigger a new job (ie trigger another job for every 1 item added, 2 items added, 5 items added, etc)

You have to configure these properly for your situation, it sounds like you just accepted the defaults.