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.
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:
Now let's use Stop Journey and see how applying it changes the use case statement drastically. Refer to the following GIF:
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.
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."
To configure Gmail trigger, follow these steps:
Under the Trigger section, search for the Gmail app and click on it.
Then select the trigger event, Get email, from the Triggers list.
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.
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:
To use If Condition, follow these steps:
Now, let's use the If Condition feature. Under the Steps section, click the Business Logic option and select If Condition.
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.
In the Condition field, select the condition Does not contain.
In the Right Value field, specify the keyword issue. Refer to the following image upon successful configuration:
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.
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:
To complete the use case statement, let's choose a simple action Google Tasks - Create task. Follow these steps to configure:
Click the + icon and select Google Tasks from the Simple Actions option. Then, select the Create Task action from the Actions list.
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.
In the Tasklist field, select the list in which you want to create a task, say My Task.
Similarly, specify a title in the Task title field, say Issues received via Gmail.
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:
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:
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.
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:
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.
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: