Let me explain the situation. We want to be able to create child records based on workflows attached to a parent object. This works fine, I have a before update trigger that creates the child record and inserts it. (The trigger clears the state that caused the creation of the child record, so even if the trigger runs again it won't make another record)
Problem is when you add a rollup summary on the parent that counts children, it fires the trigger again when you add the child record, causing a recursion which salesforce stomps on and errors messily.
I've used Static variables to prevent re-running of the trigger and it doesn't help. Only thing I can think of is to create the child record with an @future method, but I prefer to avoid them when I can.
Any advice is welcome.