How to guarantee a scheduled API workflow has completed before next action?

Hi there,

I have a few workflows where I’m trying to perform something like:

  • Update Thing 1’s value in the database based on a list
  • Do something with Thing 1’s value

Since I’m basing this on a list, I need to use an API workflow (either a recursive workflow, or the native “schedule on list” option), and API workflows don’t guarantee execute before the next step, so when i try and do something with Thing 1’s value, it’s not updated.

I’ve got workarounds for this (using database triggers and separate data types), but I was just wondering if there was a best practice solution? Because it feels like a fairly common issue.

Thanks!

Look at Execution rules.

Might be worthwhile taking a look at this thread, too: Tip: Order of Operation.

2 Likes

Pop it in a Custom event.

Or

Serialise everything via a recursive workflow.

2 Likes

Thanks both!

I’ve tried nesting the API call within a custom event, but this doesn’t seem to prevent a later custom event triggering.

And unfortunately because these are generally back end workflows, I’m not able to use pause I don’t believe(?).

Nesting things in Custom Events also removes the ability to transfer information from 1 step to the next (again because I’m in a backend workflow, so can’t use states).

Ah, yes. Calling an API from a Custom Event doesn’t make it wait like that. It is only the actions in the event that happen before subsequent actions in the workflow.

You can’t pass custom states, but you can pass around parameters, or better still use a ‘control’ record to pass data.

Agree that it can be awkward to synchronise it all, and it takes a lot of thought at times.