Create and delete workflows within a workflow

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:

  1. if a cron workflow with workflow-id WID exists => do nothing
  2. if a cron workflow with workflow-id WID doesn’t exist => create it.
  3. 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.

Have you looked at the more recent Schedule API? You may still be looking for a programmatic way to sync those from some system of record, though?

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