Scheduled Partent Child workflow with different schedules

Hi,

I have a question about a general dev pattern.

I have a main workflow which runs on a schedule(once a week) and I have a dependant child workflow, which relies on the data written to an external system from the parent. The child workflow, on the other hand, depends on this data as well as a time factor.

What I want to achieve is to run the child workflow on a different schedule (once a day) and also trigger it if the parent ran before the daily trigger.

I am thinking that I could just try to create a new schedule on main workflow run and trigger an execution on first run and all subsequent runs of the main workflow. If the schedule already exists, I just trigger it.

An alternative is to not have the parent child relationship and just try to trigger the “child” schedule from the main workflow in case it exists.

I wonder if there is a more elegant or canonical way to implement this with temporal. I hope the explanation is clear enough.

Thanks!

Why is running the child from the parent directly a problem?

You mean creating the schedule and triggering it from the parent? I think that’s fine, I was just wondering if this is the best way to go to about it if the parent and child have different schedules.
Maybe stating the child with Cron would better?

Sorry, it is hard to recommend without understanding the use case. What are you trying to achieve from the business point of view?

Thanks for the reply. I guess it is a bit hard to explain the specifics of the usecase.

What I ended up doing is creating a separate schedule and triggering it from an activity in the data import workflow, if it exists. Seems to work well.

Thanks for the help!