How to Force Automation Rules to Run?

We’ve setup automation rules with a trigger ‘when order tag is X.’

We then use API to set tag X on an order.

The automation rule DOESN’T RUN!

Is there a way to use API to force automation rules to run for an order? There must be some sort of hack or workaround to make ShipHero re-evaluate the automation rules. I’ve experimented using the user interface to change various fields but don’t see the automation rule being run.

Can somebody please help? Seems a shame that such a very powerful tool automation rules don’t get triggered and thus we are unable to fully leverage their usefulness.

Hi @Mike!
It might not be supported for tag updates (as it does when adding a Tag on the UI)
Does the Automation Rule have this setting ON?

Screen Shot 2021-03-15 at 10.48.37

Thanks in advance!
Tom

Thanks Tom,

Yes, it does have the rerun setting checkbox activated.

Even changing tags manually in the UI did NOT make it run.

Instead of troubleshooting the tag problem, do you know of any working solutions to force automation rules to run via API calls?

Hi Mike ,
Automation rules should run normally on API order creations. There may be slightly different processing with exchange orders. Do you have an example that is not running as expected we can take a closer look at what is happening?

The orders are already created via your shopify integration, so we can’t expect that to be the way to achieve this.

AFTER shiphero creates an order from the shopify integration, we would like to set some tags. Then based on those tags we would like to modify some order parameters (like box).

How do we make the automation rules run again after setting the tags? Or is there really NO WAY to run automation rules again other than only 1 time at order creation?

Thanks!

Hi @Mike thanks for that explanation.

Unfortunately, there is NO WAY of re-running automation rules with the Public API after order creation (not even by adding tags)

We can place a Feature Request for that to be supported (updating tags with the Public API triggering automation rules) but not sure if this is something that we could do.
Please let us know if you still want us to make the request.
Thanks again!

1 Like

Seems like it would be powerful if you figured out a way to make APIs trigger automation rules because you would basically solve one problem that opens up the ENTIRE scope of automation rule functionality to APIs.

Most of the stuff you fix in API is just one fix for one functionality whereas this would be one to MANY.

Hi @Mike !
I apologize for the delayed response
Makes sense!, I’m not sure what is the work required to build this, but we already placed a Feature Request for

To be able to re-run automation rules on an order with a Public API mutation

Something like:

mutation {
  run_automation_rules (
    data: {
      order_id: "117384888"
    }
  ) {
    request_id
    complexity
}
}

And this will re-trigger automation rules on the order.
Thanks again and we will let you know once this request gets evaluated!
Tom

Very cool! :nerd_face:

Wanted to follow up since this would be extremely helpful. Especially for new clients who already have their orders imported but need tweaks/automations ran on them. It isn’t possible to always have all the automation rules set up prior to a client connecting their store for the first time.