Running Steps Asynchronously with the Go Async Component
- Updated on 09 May 2013
- 2 minutes to read
The Go Async component allows subsequent flow steps to be run asynchronously, returning control immediately to the flow's calling entity (such as a parent flow, user or process). In other words, any steps placed after the Go Async component will run autonomously.
This can be useful for managing steps that are expected to take a long time and produce outputs that aren't required by the calling entity. Note that any outputs produced by steps subsequent to theGo Async component will not be available to the calling entity, since that entity will cease to have any insight into what they are doing.
Another useful application of this component is in error handling. If a non-critical error is thrown within a flow, (for example, in sending a non-critical email), the flow could initiate an error handling process using the Go Async component and then resume with the main process.
The Go Async component can be found in the Toolbox panel, under the categoryFlow Management .
Our example flow will add a document containing a list of over 1,000 new subscriber email addresses to our process folder. Our flow will then send a welcome email to each one of those subscribers. Because the process of sending 1,000 emails will not return a necessary output, and because the process itself could take a very long time, we will make it happen autonomously with the Go Async component.
Our example flow has already been started with some functional components already in place. We will continue building it by going to our Designer Folder and clicking theEdit link on theSend EmailList Flow thumbnail.
In the Flow Designer , notice that the steps already in place are Email Address List (which provides the list of subscriber email addresses) and Send Email 1 (which will send welcome emails to those addresses). Both steps are configured and ready to go, except for the fact that they are unconnected.
After our example flow adds the list of email addresses to our process folder, we want it to begin autonomously sending the welcome emails, and immediately return control to the entity that called it. In this case, returning control to the entity is equivalent to immediately progressing to theEnd Step while Send Email 1 continues to send emails.
To do this, place the Go Async component in the flow between Email Address List and Send Email 1 . It is in the Steps panel, under the category Flow Management .
Next, connect Email Address List toGo Async 1, and Go Async 1 to Send Email 1 with their respectiveDone outcomes.
This completes our flow. To debug it, click the Debug Flow link at the top of the Flow Designer.
Our example flow progresses smoothly to Send Email 1 a step that ordinarily would take several minutes
but, in this case, continues asynchronously while our flow continues uninterrupted to the End Step.