The “Incoming webhooks” action is limited to fetching up to 10 messages at once. What happens when there are more than 10 messages? For example, say there are 14 messages in queue. Assuming the “Don’t delete messages from queue” is unchecked, only the first 10 are fetched on execution of the task. Will the remaining 4 be fetched on the next execution? Is the next execution a manual process of me running the task, or a new message arrives in the queue and triggers the task to run?
How should I handle many dozens or hundreds of messages in queue? For example, what if my EasyMorph Server had an outage and came back online hours later with many unprocessed messages? Is it possible to use the iterate action to continuously process the queue until it’s empty? If so, when I tried doing this, it kept failing.
The Server triggers your workflow as long as these two conditions are met:
The Gateway queue is not empty (i.e. there are unprocessed messages in the queue)
The previous workflow run was successful (i.e. didn't fail)
Therefore, you shouldn't worry about pumping messages out of the queue. Build your workflow to process 1 to 10 messages at once, and the Server will trigger the workflow as many times as necessary to process all the messages waiting in the queue.
The workflow will be triggered twice - the first time to process 10 messages, and the second time to process the remaining 4 messages.
We should make it more clear. The checkbox “Don’t delete messages from queue” is only applicable when designing workflows in Desktop. It allows pulling sample messages from the queue without removing them when designing a workflow. In this case, if a workflow fails, the messages are still preserved in the queue and can be re-retrieved after the workflow is fixed. The Server ignores the setting and deletes messages from the queue immediately after the triggered workflow finishes successfully. The state of the checkbox isn't even saved in the project.
When the Server starts and connects to the Gateway, it immediately triggers the workflow no matter if it sees messages in the queue or not, until all messages (if they exist) are processed.
Because of that, the workflows should be designed to work correctly when they are triggered but no messages are fetched. Typically, you just put the "Skip on condition" action to skip the rest of the workflow when the "Incoming webhooks" action returns no rows.
No, you don't have to do this. The Server will do it automatically for you. The "Incoming webhooks" action should only be run once in a workflow and should not be iterated or repeated.
If a workflow is triggered by the Server and it fails, the Server will send an email notification and stop triggering it automatically. So messages might start accumulating in the queue without processing.
Therefore, if a workflow fails, it should be fixed as soon as possible in order to process further messages.