0
votes

I am creating a scheduler implementation for tasks, where in a certain API needs to be called at a date time dictated by the task itself. I looked at the Azure Logic Apps service, and looks like it could work. I created a flow "When Http Request is Recieved"... This flow then calls the API that we eventually needs to be called at the date time passed to it ( "when http request is recieved" flow).

Is summary a C# app calls the logic flow, and passes the date time and request body to logic apps. Logic apps gets triggered. But then uses date time to later call the API that it is required to call

Example: Logic App Run 1 Time: Aug-4-2020 12:00 am Data: {"Object":"somevalue"}

Logic App Run 2 Time: Aug-9-2020 12:00 am Data: {"Object":"some different value"}

So, is there a way when triggering logic apps through http trigger, I could also pass the datetime value that azure logic uses to schedule the API call

1
Hi Kunal, may I know if your problem was solved ? If still have problem, please let me know.Hury Shen
@HuryShen : Thanks for reaching out. There is one follow up question I have Hury, so If we do http triggers the way you explained "When Http request is recieved".. every time this trigger is called with a different payload. Does each run gets its own instance ? What I mean is.. say we trigger 4 different runs, and each run has different date time, say at 10:00 am, 11:00 am, 12:00 pm, 1:40 pm. Then each instance will run without affecting the other ?Kunal
Hi Kunal, you can set the logic app running instance by yourself. Please click the ... button of your "When Http request is recieved" trigger and click "Settings". You can find Concurrency Control in it. By default, if you trigger 4 different runs, the logic will run them at the same time. If you enable the Concurrency Control and set Degree of Parallelism to 1, the logic app will run them one by one.Hury Shen

1 Answers

1
votes

For this requirement, you can use "Delay until" action in logic app. Pass the datetime value(in my screenshot the field named datetime) in the request body when request the "When Http Request is Recieved" flow. And then create a "Delay until" action, put the value into the Timestamp box of it.

enter image description here

Please pay attention to the format of the datetime, the format should be YYYY-MM-DDThh:mm:ssZ.

After the "Delay until" action, call the api which you want.

By the way, you may need to notice the time zone of your datetime. It seems the "Delay until" action use UTC time, so if you are not in UTC(+0) time zone, you need to convert the time zone of your datetime. You can use convertTimeZone() method or addHours() method.