Here's a sketch of how you can achieve this using Process Builder and Flow alone - no code required at all. I'm proposing this based on your description of yourself as a beginner with code. This route may be more approachable, but please note this is only a sketch to help you get started attacking the problem, and you'll need some familiarity with Flow Designer in particular.
- Add a new Checkbox field to the parent object. Call it "Processed"; no need to add it to the page layout.
- Set up your Process Builder to fire on a data update into the starting state for this workflow, but also include the criterion that Processed = false. Set it to fire only on specific changes.
- Add two actions to your Process Builder:
- Record update, to set the Processed field to true on your parent account.
- Run a Flow, passing the Id of the parent record as a parameter. (Note that you'll actually need to build the Flow first to have it available in this step).
This way, your Process will execute exactly once on any parent object, at the point when it first enters the criteria you're looking for.
I cannot run Flow Designer on the machine I'm currently on, so please forgive me if my description is a bit rough.
Your Flow will have an input variable for the parent record Id, which is your parameter from Process Builder.
You'll start with a Fast Lookup element, which should look for child records based upon the value of their lookup field to the parent being equal to the Id you get in as your parameter. It'll store the records it finds in an sObject collection variable. Make sure to ask for the fields you need to determine how to create grandchild records.
Then you'll go into a Loop element, to loop over the records returned in that collection. The loop's Next Element connection will go to an Assignment element, where you'll create a record of your grandchild object, based on the data in the child records, and assign it to a new sObject variable. Make sure to populate its lookup to the child record with the Id of the child record you're currently processing. You'll use another Assignment element with the
add operator to add this record to your sObject collection variable of grandchild records.
Note that this sequence of operations could involve building Flow formulas to determine the right data points, or even decision elements. Depending on your logic, it might get complex, but the overall pathway is to build these records within the loop and accumulate them in an sObject collection variable.
Finally, upon exiting the loop (the End of Loop connection), you'll perform a Fast Create on the sObject collection variable holding your new grandchild records. Then you're done!