Failing 'thing' creation on slow API response

I have a scheduled API which creates a thing… As part of that scheduled API I am making a ‘GET’ which is pulling in a thumbnail image… Which in turn is duly added to the thing I’ve just created. Now im not sure if something’s changed but historically this seemed to work just dandy but over the last 2 days the process seems to be failing if the returned data from the GET is not instant. If there is any form of lag the whole process fails.

I have put a condition in that step in the scheduled API workflow… To only continue or execute the step when the response from the ‘GET’ is True and even added a ‘not empty’

Is there anything else I can be doing to make sure a step in a scheduled API workflow executes before proceeding… For me anyway the conditions seem to be being ignored.

Are you calling the API as a data retrieval for the Create database thing step?

You may find it more robust to make the API call “action” instead of “data”, call it on its own step, then use the result in the Create thing step.

Theoretically, each step then has its own timeout rather than a combined timeout for the API call and the create thing. Plus I find it runs a little faster, at least on page workflows.

EDIT - I did some tests, this theory isn’t significant, i.e. timing seems about the same.

As to what’s changed, I’d raise a bug with the new behaviour.

1 Like

@mishav thank you for the prompt suggestion and guidance. I was already making and ‘action’ and I should have actually made that clear in the original question to the forum. I’d always assumed that conditions would not run unless they were met but in my case it seems to be that the condition is being ignored. I have kinda resolved it by actually replacing that step in the workflow with a scheduled API that runs 30 seconds afterwards… That seems to resolve the although it does possibly add another level of complexity to an already disjointed process… Hey ho

Emmanuel’s comment might be applicable …

Another possible approach is to put the API call in a custom event workflow, and conditionally call the custom event.