I want to have a cron workflow which through an activity gets a list of workflows-ids that are required.
Based on the workflow-ids in the list, for each workflow-id let’s say WID:
if a cron workflow with workflow-id WID exists => do nothing
if a cron workflow with workflow-id WID doesn’t exist => create it.
if there exists a cron workflow whose workflow-id is not in the list => delete it.
All child workflows are independent and parent is just for creation and deletion.
I tried using schedule API for the same but want to create multiple schedules based on the output of an activity.
Let’s say I have a master cron workflow that runs every 30 minutes and through an activity will get a list of schedule_ids that are unique. For each schedule_id if a schedule doesn’t exist will be created. How should I use the temporal client object within an activity/workflow? Should I create a new instance of the client or is there a better way to achieve the same