We’re having an issue with a script timing out before it can finish running for all entities in the batch.
The goal for this script is that every day at midnight, all want all the active ad campaigns we’re running in Google Ads to be created (or updated if they already exist) in Fibery.
Is there a way to force the timer to reset for each entity in the batch, or to force the script to run separately & sequentially for each entity in the batch?
It runs fine if we trigger it as a button on an individual entity, but we want to run automatically once a day.
1 Like
My recommendation would be to segment your entities into different batches that get processed separately by different Rules (all of which do the exact same thing, but only to a subset of entities).
E.g. assuming you’re going to segment your entities into 4 batches:
- create a “Batch number” field that is assigned by a script on entity creation, to a value like
parseInt(entity['Public Id']) % 4
(javascript) - i.e. giving a value between [0, 3].
- make four separate processing Rules, each of which filters for entities with a specific Batch number, but otherwise performs the exact same processing as the other Rules
- offset the Rule trigger times so they won’t run simultaneously
The downside is that you now need to maintain four Rules instead of one.
1 Like
Yeah that’s super annoying!
This was actually one of the reasons I wrote the Fibery Script Management tool – so I could write and maintain a single script that could be automatically pushed to multiple Rules (that’s what the tool’s “include” feature is for).