I have a simple device (Nordic Thingy 52) with a push button which can trigger the Maker Webhooks service in order to pass an event (button_press), which I am currently using to then trigger the Smart Life service's "Turn Off" or "Turn On" action.
The problem is that, since I can only pass the one event (button_press), I have to choose whether that event triggers either "Turn Off" or "Turn On". But what I want is to add some logic to say, "If the previous request was to turn off the Smart Life device, make the next one turn on the smart life device."
Wasn't sure how to do this. An AWS Lambda function? Chaining some other preexisting service? A filter that utilizes local storage or somehow handles state logic?
Any pointers for where to start searching would be appreciated.

I figured out a way to do this with a service called apilio.
Process:
Head to apilio.io and register for an account.
bln_light_on. Set its default value tofalseConditons > New Condition for Boolean. Call itcnd_light_on.bln_light_onwith a required state ofTrue.namecreate a name oflgc_light_onwith conditoncnd_light_on, with Condition Linking set toSimple ANDAction Chains > Actions for Positive Resultenterbutton_onExecution ModeselectImmediate. UnderAdvanced Options > Automatic EvaluationselectEvaluate this logicblock when any connected variable changes. Now, in IFTTT, create aNew Applet > Web Hooks > If maker Event "button_press", then >Web Hooks > make a web requestIn the URL field you’ll enter the Toggle URL from thebln_light_onBoolean Variable you set up in Apilio. You can see this by clickingBoolean Variables > bln_light_on > showfrom the menu. Lastly, in the Nordic Thingy Web App, send the eventbutton_press