Stop Journey

Using the Stop Journey function in Quickwork Journey Builder. Quickwork is a no-code, API-based SaaS platform with pre-integrated apps to automate business workflows.

As the name suggests, Stop Journey terminates the execution of a journey from the point at which the user positions it. Stop Journey can be placed between the simple actions, conditioning actions, or looping actions as per the user's business requirement. It's meaningless to use Stop Journey after the last action of a journey because the journey automatically ends when the last action gets executed successfully.

Using Stop Journey within simple actions

For a better understanding of the working of Stop Journey, here's a small use case illustrated.

"Whenever a new issue gets created in GitHub, log a ticket in Freshdesk. At the same time, send an email via Gmail to the manager highlighting the status of the ticket and maintain a personal record of the email communication in Google Sheets."

This use case contains one trigger and three actions. Assuming that the configuration of these apps is completed, here's how the construction of the journey looks:

Figure 1: A journey with simple actions

Now let's use Stop Journey and see how applying it changes the use case statement drastically. Refer to the following GIF:

Figure 2: Using Stop Journey within simple actions

According to this GIF, Stop Journey is placed at two different positions, i.e., at position 2 (below the Freshdesk app) and position 3 (below the Gmail app). Due to this intervention of Stop Journey, the execution of the journey gets tweaked. If Stop Journey gets placed at the second position, the journey runs up to the Freshdesk - Create ticket action and stop further execution. As a result, the use case will get rephrased as "Whenever a new issue gets created in GitHub, log a ticket in Freshdesk. (Stop Journey intruded)". The execution of further actions gets neglected.

Similarly, if Stop Journey gets placed at the 3rd position, the journey runs up to the Gmail - Send email action and stops further execution. Thus, the revised use case will be "Whenever a new issue gets created in GitHub, log a ticket in Freshdesk. At the same time, send an email via Gmail to the manager highlighting the status of the ticket. (Stop Journey intruded)". The execution of further actions gets neglected.

In this way, you can create a journey with as many simple actions as you like in a single journey. Then, depending on your business requirement, include Stop Journey until where your journey should execute. Later, keep changing the Stop Journey position to bring more configured actions on-board experiencing the variation of automation to ease your life.

Using Stop Journey within conditioning and looping actions

The positioning of Stop Journey is a bit different while dealing with conditioning actions. Stop Journey needs to be indented within the conditions. For instance, let's take a use case that contains a trigger, If Condition, Stop Journey, and simple action.

"Receive a new email via Gmail and check whether its subject contains the keyword issue. If yes, then create a task via Google Tasks for the support team to get it resolved. If not, then stop the execution of the journey."

Configuring the Gmail trigger

To configure Gmail trigger, follow these steps:

  1. Under the Trigger section, search for the Gmail app and click on it.

  2. Then select the trigger event, Get email, from the Triggers list.

  3. For authorizing Gmail, select an existing connection from the drop-down or create a new connection. To create a new one, enter the connection name of your choice and click the Link an account button. Select the Gmail account you want to authorize and allow Quickwork to access its scopes and information. Then, click on the Allow button. Your connection will get created.

  4. Lastly, select the label (Gmail folder from where you want to fetch the emails) INBOX from the drop-down menu. The Gmail trigger gets set up successfully:

Figure 3: Configuring a Gmail trigger

Configuring If Condition

To use If Condition, follow these steps:

  1. Now, let's use the If Condition feature. Under the Steps section, click the Business Logic option and select If Condition.

  2. In the Left Value field, drag and drop the key from the Gmail | Get email Trigger Data Tree Output located on the right-hand side of the window.

  3. In the Condition field, select the condition Does not contain.

  4. In the Right Value field, specify the keyword issue. Refer to the following image upon successful configuration:

Figure 4: Configuring the If Condition

All the conditions in the If Condition block are case sensitive.

If Condition comes with a per-intended simple action bar. As per the use case, there is no use of this simple action. Click on the ellipsis and delete the action.

Applying Stop Journey

To do this, click the + icon. Under the Business Logic option, select Stop Journey. Now, indent Stop Journey by dragging and dropping below If Condition:

Figure 5: Applying Stop Journey

If Stop Journey is not indented, it will act as a separate entity, and the journey execution will get terminated exactly after reaching that position. Thus, the validation performed by If Condition will be useless, and actions introduced after Stop Journey would be meaningless.

Configuring the Google Tasks action

To complete the use case statement, let's choose a simple action Google Tasks - Create task. Follow these steps to configure:

  1. Click the + icon and select Google Tasks from the Simple Actions option. Then, select the Create Task action from the Actions list.

  2. Authorize Google Tasks by select an existing connection from the drop-down or create a new connection. If you are not logged in to your Google account, you'll be asked to do so to establish the connection.

  3. In the Tasklist field, select the list in which you want to create a task, say My Task.

  4. Similarly, specify a title in the Task title field, say Issues received via Gmail.

  5. In the Notes field, pass the key from the Gmail Trigger Data Tree Output. This will save all the email data as a task in Google Tasks. See the complete configuration here:

Figure 6: Configuring Google Tasks actions

Executing the journey

Once your trigger and action get successfully configured, click on the Save Changes button to save your journey. Then, click the Start Journey button to execute the journey.

To know precisely, let's send two emails with the subject Desktop issue and Error: platform malfunction, respectively.

Whenever a new email is received via Gmail, the Gmail trigger will get activated and pass the data to the If Condition block. Now, in this block, the journey will further execute under the following two cases:

Case 1: If condition did not satisfied

The subject of the received email will be checked whether it contains the keyword issue or not. In the case of Desktop issue email, the If Condition is not satisfied and the journey execution will directly jump to Google Tasks- Create task action, skipping Stop Journey under the If Condition block, and a new task for an issue will be created in Google Tasks.

Why the execution of Stop Journey got skipped?

We have defined the condition Does not contain in If Condition block and indented Stop Journey under it.

To properly see the journey execution, go to the History tab in the automation builder and click on the recently executed journey. Scroll down to see the actions that got executed:

Figure 7: If condition did not get satisfied

In the If Condition block, the statement If Desktop issue Does not contain issue then do is false and so it created a ticket for issue in Google Tasks.

Case 2: If condition gets satisfied

In the case of Error: platform malfunction email, the subject does not contain the keyword issue. So the If Condition gets satisfied, and the execution goes to Stop Journey thereby, terminating journey execution. The Google Tasks action gets ignored, resulting in no ticket creation for the email that does not contain the keyword issue:

Figure 8: If condition gets satisfied