I’m trying to figure out the proper solution for mixed polling. The idea is to make an API call every 1 minute, and hour later switch to every 15 minutes if there hasn’t been a successful response.
My current setup is:
-
The workflow has 2 activities:
-
Activity #1 creates entities.
-
Activity #2 sends them to the external system and saves them with a temporary status.
-
-
This workflow is called from the API and executed asynchronously.
-
Polling should start once the data has been sent to the external system (after Activity #2 finishes).
My idea was to create a third activity that would trigger the workflow and implement the “mixed polling” logic inside the workflow execution.
Questions:
How properly handle workflows chain? (e.g. workflow#1 finished execution, started polling workflow#2, based on polled status workflow#3 created)
Is it a good practice to call another workflow from inside an activity, or should workflows only be triggered externally?
For the mixed polling scenario (1 minute initially, then 15 minutes later with max 3 days to poll), should this logic live inside the workflow itself, or would it be better to handle inside activity(I saw examples for frequent and infrequent)?