---
title: Creating the journey
slug: havas-poc/creating-the-journey
docTags: 
createdAt: 2024-01-09T15:12:09.972Z
---

In this exercise, you'll be creating and testing a journey using all the components you've created in the previous exercises.

# Creating the journey

## Journey overview

To get an overview of all journeys:

1. In the menu on the left side, click on **Journeys**. You will see a overview with all existing journeys.

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/XW0A3Zi5JnM9aLnOFulce-20251117-223521.png)

## Creating a journey

We'll be creating a journey that will make an HTTP call to an external endpoint, when a customer is near a store. The journey needs to check if the customer has an unused coupon as well as check with the local store if they are open for business.

:::hint{type="info"}
The HTTP call is a way to mimic the interaction with any external platform that is able to receive an HTTP request (like a CRM, Marketing Automation...).
:::

Click on **Create Journey**. You'll be taken to the **Journey canvas** with the journey properties opened.

1. Set the **name** to `[your name] - Location-based Coupon Reminder`.
2. Set the **re-entrance wait period** to `1 Day`. This prevents the journey from triggering multiple times a day for the same customer.
3. For the other properties we'll keep the default values.
4. Your screen should look like the image below. Click **Ok** to save and close the properties.

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/ZbKJZTYZtRZZ6GjRidqo3_image.png)

You're now in the journey canvas. This is where you'll be creating your journey's logic. In the left menu you have **activities**. There are three types of activities:

| **Type**      | **Description**                                                                                                                            |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Events        | Triggers that can start or continue your journey.                                                                                          |
| Orchestration | Allow to orchestrate the logic of your journey. It looks at conditions, audiences, but can also be used to make your workflow wait or end. |
| Actions       | Are the results of your journey. This can be messages, profiles updates or API calls (for Journey Orchestration only API calls).           |

&#x20;

### Event trigger

We're starting our workflow of with an event trigger.&#x20;

1. From the Events tab, choose the event you created (**yournameGeoNearStore**) and drag it onto the canvas.
   *If you did not create an event, use the **geoNearStore** event.*
2. There's nothing we need to configure for this as we have already done this when we [configured the event](docId\:cfIg0Z3DjTPnCTS2nWfZb). Click **Save** to close the menu.&#x20;

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/bzi0fJa3cBMqVGzyQ3xoj_image.png)

### Condition - Luma store is open?

When the customer enters the Point of Interest (POI), the first thing we want to check is if the local store is open for business. This prevents you from sending a message to the customer if the customer can't enter the store.

1. From the **Orchestration** tab, choose **Condition** and drag it onto the empty circle on the canvas.
2. Click on the activity to open the detailed view.
   1. Set the **Label** to `Luma store is open?`.
   2. Leave **Type** as it is.
   3. Click on **Path1** and change the label to `Open`.
   4. Click on the text field below **Expression** to open a window.
      1. To write expressions using an external data source, you'll have to first open the *Advanced mode*. Click on **Advanced mode** in the bottom right.
      2. On the left side, open the Data Source you created in the previous exercise (`yournameStoreInformation`). If you didn't create the Data Source, you can use `storeInformation`. Open **storeResponse** and click on `isOpen` to add it to the middle section.
      3. You'll notice a warning appearing in the top saying <font color="#ff0000">The expression is invalid \: Mandatory dynamic value \: storeId is missing</font>
         We defined a variable field when creating the Data Source. We'll now need to populate this with data.
      4. On the right side click on **dynamic val.: storeId**. The middle screen will change.
      5. On the left side, open **Context > yournameGeoNearStore**. This is the event that we chose in our journey. In here we can reference any field that is part of the event.
         Navigate to `Place context > POI interaction > POI detail `and click on `POI name` to add it to the middle section. In this way the *storeId* parameter will be populated dinamically with the value coming from the geolocation event.
      6. On the right side click on **Expression** to go back to the original expression. There is no warning in the top anymore as we just populated the variable.
      7. Click **Ok** to save the conditions.
   5. Click on **Add a path** and change it's label to `Opens within 30min`.
   6. Click on the text field below **Expression** to open a window.
      1. To write expressions using an external data source, you'll have to first open the *Advanced mode*. Click on **Advanced mode** in the bottom right.
      2. On the left side, open the Data Source you created in the previous exercise (`yournameStoreInformation`). If you didn't create the Data Source, you can use `storeInformation`. Open **yournameStoreResponse** and click on `minutesTillNextOpen` to add it to the middle section.
      3. We need to make this an expression that returns `true` whenever the value is at or below 30. Add `<= 30` to the  expression. It should now read:`#{yournameStoreInformation.storeResponse.minutesTillNextOpen} <= 30`
      4. You'll notice a warning appearing in the top saying: <font color="#ff0000">The expression is invalid \: Mandatory dynamic value \: storeId is missing</font>
         We defined a variable field when creating the Data Source. We'll now need to populate this with data.
      5. On the right side click on **dynamic val.: storeId**. The middle screen will change.
      6. On the left side, open **Context > yournameGeoNearStore**. This is the event that we chose in our journey. In here we can reference any field that is part of the event. Navigate to `Place context > POI interaction > POI detail` and click on `POI name` to add it to the middle section.
      7. On the right side click on **Expression** to go back to the original expression. There is no warning in the top anymore as we just populated both variables.
      8. Click **Ok** to save the conditions.
   7. Your screen should look like the image below.&#x20;
   8. Click **Save**.

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/wSELJDy5HK1otnjqw3mCN-20251117-225043.png)

### Custom Action #1 - Send to Webhook

1. In this example we'll be simulating the use of an external system to send out messages. For this we'll be using a **Custom Action**. The Custom Action activity allows you to send an API call to anywhere and optionally receive a response.
   *In our example the Custom Action has been prepared and is calling a webhook so we can visualise outgoing API calls.*
2. From the actions tab, choose **sendToWebhook** and drag it onto the empty circle on the canvas at the **Open**-path.&#x20;
3. Click on the activity to open the detailed view.&#x20;
4. Change the label to `Send to Webhook - Push`.
5. For each field in the **Request Parameters**, click on the pen-icon to open the editor, then open the Advanced Mode, and add the following values.
   *(When you click to edit a field, a window will open. Click on the button Advanced Mode in the bottom right.)*
   1. Set **Channel** to `"push"`
   2. Set **Template** to `"couponReminderStoreOpen"`
   3. Set **Title** to `"Use your coupon now!"`
   4. Set **Body** to the following:
      1. Copy the following text in:

         `"You're close to" + STORE_NAME + ", use your coupon for 10% off in store now!"`

      2. Select and remove the text STORE\_NAME and open the folder **Contextual attributes**. Search for `POI` and add `POI name` by clicking the **+** icon.
      3. Your expression should now be:

         `"You're close to" + @event{geoNearStore.placeContext.POIinteraction.poiDetail.name} + ", use your coupon for 10% off in store now!"`
      4. Click **Ok.**
      5. Set **Profile identifier** to the following
         1. Search for `Customer ID` and add `Customer ID (customerId)` under **Identifiers&#x20;**&#x62;y checking the box.&#x20;
         2. Click **OK.**
6. Your screen should look like the image below.&#x20;
7. Click **Save**.

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/Ow4BNGz_g3x-ZG3LrYoLv-20251117-231535.png)

### Custom Action #2 - Send to Webhook

1. From the actions tab, choose **sendToWebhook** and drag it onto the empty circle on the canvas at the **Open within 30 mins**-path.&#x20;
2. Change the label to `Send to Webhook - Push`.
3. For each field in the **Request Parameters**, click on the pen-icon to open the editor, then open the Advanced Mode, and add the following values.
   *(When you click to edit a field, a window will open. Click on the button Advanced Mode in the bottom right.)*
   1. Set **Channel** to `"push"`
   2. Set **Template** to `"couponReminderStoreAlmostOpen"`
   3. Set **Title** to `"Use your coupon now!"`
   4. Set **Body** to the following:
      1. Copy the following text in:

         `STORE_NAME + " will open soon, use your coupon for 10% off in store now!"`

      2. Select and remove the text STORE\_NAME and open the folder **Contextual attributes**. Search for `POI` and add `POI name` by clicking the **+** icon.
      3. Your expression should now be:

         `@event{geoNearStore.placeContext.POIinteraction.poiDetail.name} + " will open soon, use your coupon for 10% off in store now!"`
      4. Click **Ok.**
      5. Set **Profile identifier** to the following
         1. Search for `Customer ID` and add `Customer ID (customerId)` under **Identifiers&#x20;**&#x62;y checking the box.&#x20;
         2. Click **OK.**
4. Your screen should look like the image below.&#x20;
5. Click **Save**.

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/Sfggi72RNYQ5DyU0OpU63-20251117-231808.png)

### Event - Purchase

1. From the `EVENTS` tab, choose the event `lumaPurchase` and drag it onto the empty circle on the top path.
2. Check **Define the event timeout** and set it to wait for `4 hours`.&#x20;
3. Check the box **Set a timeout path**.
4. Drag the activity onto the bottom path to merge both paths into this activity.

![](https://api.archbee.com/api/optimize/cPBDqdbhvFSQWFNnID7Bn-b5SYM68lKzY7ysl3goqpr-20241107-084146.gif)

1. Your screen should look like the image below.&#x20;
2. Click **Save**.

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/zg1aoeraQTzCKq4F1KHAr-20251117-233523.png)

### Custom Action #3 - Send to Webhook (Email)

1. From the `ACTIONS` tab, choose **sendToWebhook** and drag it onto the empty circle on the canvas (see the image).

   ![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/K3q66bWSgGYGPNzaM-VSK_image.png)
2. Change the label to `Send to Webhook - Email`.
3. For each field in the **Request Parameters**, click on the pen-icon to open the editor, then open the Advanced Mode, and add the following values.
   *(When you click to edit a field, a window will open. Click on the button Advanced Mode in the bottom right.)*
   1. Set **Channel** to `"Email"`
   2. Set **Template** to `"geoPurchaseSavings"`
   3. Set **Title** to `"Thank you for visiting us in store!"`
   4. Set **Body** as `"order-confirmation"`
   5. Set **Profile identifier** to the following
      1. Search for `Email ID` and add `Email ID (emailId)` under **Identifiers&#x20;**&#x62;y checking the box.
      2. Click **OK.**
   6. Your screen should look like the image below.&#x20;
   7. Click **Save**.

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/hPzH6hB0YCmin2pNwVgNK-20251117-234036.png)

Your Journey is now completed! We can now test our Journey...

![](https://api.archbee.com/api/optimize/1Jp0iolWv35Z_mkI7oUiT/boCs6w0huyulQ10wh9Mav-20251117-234119.png)

