As the name suggests, Stop Journey terminates the execution of a journey after a specific step; where the Stop Journey is positioned. The actions below the Stop Journey are left untouched. Stop Journey can be placed between the simple actions, conditions, 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. Then 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 image:
According to this image, Stop Journey is placed at two different positions, first at position 2 (below the Freshdesk app) and then at 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.
The positioning of Stop Journey is different while dealing with conditions. 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.
- Trigger: Gmail - Get email
- Conditions: If Condition, Stop Journey
- Actions: Google Tasks - Create task
Create a task list named My task in Google Tasks. We will use this task list to store all the tasks related to the issues of the users.
To configure Gmail trigger, follow these steps:
- Under the Event 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 Gupshup integration platform 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 data pill 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:
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.
To do this, click the Add a step button (+ icon). Under the Business Logic option, select Stop Journey. Now, indent Stop Journey by dragging and dropping below If Condition:
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.
To complete the use case statement, let's choose a simple action Google Tasks - Create task. Follow these steps to configure:
- Click the Add a step button (+ icon) and select Google Tasks from the Simple Actions option. Then, select the Create Task action from the Actions list.
- Authorize Google Tasks by selecting an existing connection from the drop-down or creating 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 data pill 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 all your configuration is completed, the journey flow looks like this:
Once your trigger and action get successfully configured, click on the Save Changes button to save your journey. Then, click the Save & Start 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 be further executed 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:
In the If Condition block, the statement If Product issue Does not contain issue is false and so it created a ticket for issue in Google Tasks:
Case 2: If condition gets satisfied
In the case of an email with Declaration as the subject, it does not contain the keyword issue in the subject line. So 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:
Updated 9 months ago