Creating and Using Journeys in Refly

Guide to creating, importing, and managing journeys in Refly for guiding chatters through conversations to achieve specific goals.

Introduction

Journeys in Refly are visual flowcharts that guide chatters through a conversation to achieve a specific goal. This guide will explain the types of journeys, the journey steps, and how to use them effectively.

Creating and Using Journeys

You can create a journey by either importing it from the library or by creating a journey from scratch.

Import a Journey from the Library

Refly provides templates to make users' lives easier. Users can search for a journey that resolves their use case, import it with one click, and start editing it as if they created it from scratch. All steps included in the journey will be imported as well.

Steps to Import a Journey

  1. Navigate to Assistant > Journeys > Library.
  2. Search for a journey template that matches your use case.
  3. Click Import to add it to your journeys.
  4. Edit the imported journey as needed.

Create a Journey from Scratch

Allows users to start from a blank canvas and add all the necessary steps to build a journey tailored to their specific needs.

Steps to Create a Journey from Scratch

  1. Navigate to Assistant > Journeys > My Journeys.
  2. Click on Create Journey.
  3. Use the drag-and-drop interface to add Intent, Component, Function, or Text steps.
  4. Connect the steps to form a coherent path that guides the conversation.
  5. Save the journey.

Types of Journeys

Default Journey

A Default Journey is the main flow that chatters follow during their interaction with the assistant. It includes various steps that direct the conversation towards achieving specific objectives.

Component Journey

A Component Journey is a reusable journey that can be incorporated into multiple Default Journeys. For example, an authentication flow used to verify the identity of a chatter can be created once as a Component Journey and then added to multiple Default Journeys.

Why It Matters: This avoids the need to recreate common flows multiple times, saving time and ensuring consistency.

Journey Steps

Each journey consists of various steps, represented as cards in the visual flowchart. The steps currently supported are:

Intent

An Intent represents the purpose or goal of the chatter's message. It triggers specific journeys based on what the chatter wants to achieve.

Example: An intent like "requesting order information" can start a journey to provide order details to the chatter.

Component

A Component is a reusable journey that adds value when integrated into other journeys. For instance, an authentication component can be used in different journeys to verify user identity.

Example: The authentication component can be a series of steps to ask for a phone number, send an SMS code, and verify the code.

Function

A Function is a piece of code written in vanilla JavaScript, following the ECMAScript standard. It allows for complex operations and integrations within a journey.

Example: A function could fetch order details from an API and process the response to provide relevant information to the chatter.

Making Network Requests

To perform network requests within a journey, you can use fetch to call external APIs. Here’s how to do it:

let response = await fetch(url);
let data = await response.json;  // Use this instead of await response.json()

As you can see, fetch is supported with a slight modification: await response.json instead of await response.json().

Please note that certain JavaScript methods, such as setTimeout(), are not supported out-of-the-box due to their dependence on browser or Node.js runtime APIs and not being part of the ECMAScript (JavaScript) language specification itself. This JavaScript reference document describes all built-in objects supported by functions code.

Text

A Text step instructs the assistant on what to say or ask the chatter. It is used to communicate messages directly to the user.

Example: "Please provide your order number" can be a text step within a journey to request information from the chatter.

By following these steps, you can create efficient and effective journeys that guide chatters through various processes, ensuring a smooth and satisfying user experience.