I’m trying to create a scenario where I recieve multiple messages from Facebook Messenger module in a short period of time (15 seconds) and after creating a record for each message I join them with a text aggregator.
When I execute this scenario it works for the first run but I don’t understand why it runs again using the messages recieved after the first one as a new inputs. And this produces an error in the modules that use the final aggregated message as the value is empty.
Here is a detailed explanation of the workflow:
- Receive Message 1 (M1)
- Store M1 in Data Store module
- Sleep for 15 sec
- Before the 15 sec are completed I send a second test-message (M2)
- Stores M2 in Data Store module
- Keeps waiting for the Sleep module to finish the countdown.
- After the 15 seconds I search for the records in the Data Store
- I aggregate text from M1 and M2 into a new message (MSG)
- Delete Data Store records
- I use MSG to generate a response and send it back through Facebook Messenger.
This executes successfully and I get the response in Messenger.
However the scenario executes a second time using M2 as the only input
- Receives M2.
- Stores M2 in Data Store module
- Waits 15 seconds again
- Search records but this time the result is empty.
- As there are no records the text aggregator output is also empty
- The value for MSG is empty so none of the modules that use this value can run and the operation fails.
Producing this error:
Is there any way to avoid the second execution that uses only M2 as an input?