Are Queues possible in an Azure Logic App? - queue

I am creating a azure logic app that is triggered daily that makes a series of web requests. It it possible to add a queue to a logic app so that, on failure, the collection of requests will continue to process the next day?

One of the workarounds is to have a logic app inside a logic app. As you haven't provided any sample, Consider here is my request sending to my logic apps:
{"employees":[
{"name":"Shyam", "email":"shyamjaiswal#gmail.com","married":true},
{"name":"Bob", "email":"bob32#gmail.com","married":true},
{"name":"Jai", "email":"jai87#gmail.com","married":false},
{"name":"millie", "email":"millie22#gmail.com","married":true}
]}
and below is the screenshot of my logic app
so whenever there is a situation where the married property is false I'm sending the current item into a queue and then finally trigger my other logic app with the same workflow instead of waiting till the next day.
Now In the second logic app, I could able to manage the queue with required actions.
My second logic app
If in case you want the logic app to be triggered for the next day you can use the schedule trigger.

Related

Storekit 2 Test valid subscriptions at launch

I have a new iOS App with an auto renewing subscription feature.
I'm using the Mercato lightweight Storekit2 library.
I issue a start to the transaction listener in the AppDelegate didFinishLaunch along with a retrieveProducts(), activeSubscriptions(), and activeSubscriptionsIDs().
It all works, BUT: the validation of an active subscription does not asynchronously complete until well after the initial viewWillAppear().
Therefore it always starts off in non-valid display mode, and premium features are available to select by the time the user starts navigating.
Is there a faster way to get a validation upfront, or failing that, is there a way to post an event that a subscription test has completed, so I can display, then stop some sort of distracting, time wasting animation until validation.

Delete File from ADL after processing via ADF

This is a 2 part issue:
How to move/delete a file after processing. Currently we can only copy, but the original file remains in the source. Ideally we don't want to add a separate process to get metadata and compare if processed or not. I have been following one blog that asks to use a WEB activity and the Delete Rest API. I have gotten to that point, but I am not able to understand/follow instructions on to obtain the ACCESS TOKEN. It shows Curl steps, if someone can help on this would be great.
I have created a pipeline, that has 4 Main activities. As part of this pipeline I want to be able to send email notifications for Success and failure.
Each success of an activity moves to the next activity, but if any activity fails it will send email. I Want to be able to have one SUCCESS or FAILURE Notification and dynamically add content to email instead of sending email on previous activity. For Failure it seems like I have to create a separate web activity for each activity to align a Failure, which is not elegant.
Based on how the WEB activity is set to use the logical apps for email, we have to define the activity name that the email is associated with (at least based on my understanding). So i created a separate WEB activity for each failure email, not very elegant.
Does anyone have a better way to handle.
enter image description here
enter image description here
The only alternative is using a logic app to delete blobs, you can trigger the logic app also via a Web activity. Can you share the blog URL for the delete via web?
As for the email on failure, the issue is that you cannot have 'or' dependencies in the pipeline. A workaround that I'm using is to introduce a variable, when an activity fails or when the pipeline is finished, it sets the variable. In parallel in the pipeline I have a while activity that checks this variable. When it gets a certain value an action will be triggered. Also not elegant, but you don't need a lot of Web activities this way.

actions on google - how to handle long running operations

I have AoG action that is logging-in to external backend and once logged in it can control specific appliance via external backend's API. Action basically controls home alarm via commands like arm section XY, disarm section garage, etc. Before getting control to alarm it is necessary to login and this takes considerable time (approx. 20-30 seconds). This is much longer than AoG actually allows resulting in timeouts. I am initiating login as asynchronous operation in actions.intent.MAIN handler (i.e. not waiting for the result of login within handler) and just saying to user to tell the command (arm/disarm garage, etc.) in couple of seconds. I have also implemented push notification which is working fine. Problem with push notification is that it just pops up on mobile phone without any sound & user has to open notifications and tap it. Then it will trigger intent and do requested action.
This is not really good user experience (typically I would like to use my action in the car when coming home and having the possibility to disarm the home alarm without need to touch the phone, tap the notification, etc).
Any idea how to implement it in more proper way? What I would really appreciate is if google assistant could actually re-initiate the conversation & tell me something like: 'hey I am already logged in into alarm service provider, what do you want me to do now?'.
I will be grateful for any advice dealing with similar problem.
I am using ActionsSDK for Node.JS to build my action.
You've already looked at the ways that the Assistant can initiate (or re-initiate) a conversation. Actions are really designed for something that is conversational, and a 30 second pause in the conversation would be awkward.
One other option you have is to use a Media Response as part of your reply to the user logging in (or as part of your welcome intent? Not entirely clear, but the approach would be the same). This would let you play some "hold music" for several seconds. At the end of the music playing, an actions.intent.MEDIA_STATUS would be sent to your Action, which you can use to make sure the login has completed and, if so, respond to the user appropriately.
The only way for AoG to "take initiative of starting a conversation" is through push notifications. There is no way for the assistant to strike up a conversation after a period of time or when an event occur.
Perhaps another way of doing might be to only send push notification if your action fails to execute the long sequence of events and the triggering action could invoke an intent to try again. The assumption would be that everything's fine unless said so.
You could also notify the user that it'll take a couple of seconds to complete the action once it's initated and implement followup intents that handles if the user asks "Is it done?" or "How's it going?". Making it part of the flow to check on progress, but with the assumption that it should be successful.
You can easily dislocate the long running background process by implementing a task queue in Firebase where your intent is creating a child similar to this.
firebase.database().ref("tasks").push({action: "disarm_garage"});
And then you create a cloud function trigger to handle it
functions.database.ref('tasks/{id}').onCreate((snap) => {
const action = snap.val().action;
switch (action) {
case 'disarm_garage':
// ...
break;
}
// Remove the task after processing
return snap.ref.remove();
});
That would ensure that you have enough time to complete the task in background without blocking the conversation.

Running a Workflow instance for a specific time using workflow foundation

Let me explain the scenario. I want to start a workflow instance which will create a request approval process. There are different levels and each level has approvers and specific time is assigned for each level. An approver should approve within the given time to complete process or he/she may be alert again to approve once the assigned time of the level is over.
A user may request something by starting a approval process this would intiate a workflow which will create a workflow instance for the specific request. when the process starts it will inform the respective approvers in first level to approve the request made by a user. if a approver failed to approve within the given level time the approver will be alerted to approve the request and it should pause the workflow and wait for it. if he managed to approve the request the process should moved to the next level and continue with the same process until the number of levels are over.
Can i do this using windows workflow foundation. I read and understood that invoking a workflow, bookmarks can be used for this. i need to how can i manged the background timer for each level and alert the users. im stucked at that point please help me.
if there is a better solution please feel free to talk :).
Yes you can achieve this by using a Pick activity which has a timer (delay) activity and your custom approval activity inside. Pick activity will choose only one PickBranch to complete when ever either of the contained activity is completed. That said if the timer activity is triggered, the custom approval activity will be cancelled then. And you can choose to do what ever you what to do afterward such as sending emails to notify the involved approvers that the task was expired. WF has a lot of potential but it seems this technology has been left in the corner by its vendor for a while...

How to Resume the Persisted Workflow with Delay Activity without Reloading into memory

How to Resume the Persisted Workflow with Delay Activity without Reloading into memory:
I am creating a workflow for leave application. My requirement is if any participant is not responded in the specified time, then the request needs to pass to next level participant approval.
Suppose a requester submitted a Leave Request and the Team Lead needs to approve it within 7 days. If the Team Lead is not responded in 7 days, then automatically it has to go to Manager Approval.
In general to achieve this, we will write a Windows service which is checking periodically and send the notifications once the period is elapsed.
But I want to achieve without writing the Windows service. Is there any possibility in WF4.0.
I am trying like this, once the requester is submitted the request then I am showing the request in the participant mail box and persisting the workflow. Once the participant responded I am resuming the workflow (because I am saving the workflow instance ID) and passing the participant response for further workflow execution.
In this if the participant is not responded, how to escalate / send the request to manager without using windows service.
Is it possible to do with anything with the Delay Activity?
If you create a workflow service it is hosted in the WoskflowServiceHost and this periodically checks is there are expired timers and resumes those.
You must host the workflow engine somewhere ...
If it's not in a windows service, it should be in IIS.
You can also host it in a "normal" command line application, but if you close the application the workflow will stop.