Skip to main content

Quick Start Guide

Welcome to our Quick Start Tutorial. Here, we will:

  • Create a workflow to generate personalized welcome email.
  • Use LLMs and SQL within Fleak.

If you would like an interactive version of Quick Start, please click here.

Create a New Workflow

Log in to Fleak. Locate the 'Create a workflow' block from the home page and click the New Workflow button.

New Workflow Image

A pop-up will appear. Enter a name and description then click Create.

New Workflow Detail Image

Now that you've created a new workflow, you should be able to see the workflow editor window.

Setup the Sample Input Data

Copy and paste the data sample below into the HTTP Input node. This will be used as the input data to debug your workflow.

{
"name": "Rick Sanchez",
"occupation": "scientist"
}

Add a 'SQL' Node to Create User Profiles

Click the + below the HTTP Input node and select the SQL node.

add_sql_node.png

Then, copy and paste the command below into the SQL node, click Run Step button to view the SQL node output.

note

events is a reserved term in Fleak, which always represents the entire output of events from the previous node, see Product Basics for details

SELECT
concat(name, ', ', occupation) AS profile
FROM
events;

sql_generate_profile.png Note that the Output Event panel is to your right. The name and occupation have been concatenated into the profile.

Generate a Customized Email with LLM

Click on the + sign below the SQL node, navigate to the AI Tools category and select the LLM node.

adding_llmchat_node.png

In the "Model" field, choose gpt-3.5-turbo. llmchat_select_model.png

In the Messages section:

  • Add a new message.
  • Configure the Role as System.
  • In the Prompt Type field, choose Text Prompt.
  • Copy and paste the prompt below into the Prompt field.
generate a short and funny welcome email to the provided new user profile on behalf of Fleak, an amazing AI workflow builder

llmchat_system_prompt.png

  • Add a new message.
  • Configure the Role as User.
  • For the Prompt Type, Key from Event should be chosen.
  • Then, input $.profile into the Prompt Path field.

llmchat_user_prompt.png

Click Run Step button in the upper right of this node.

llmchat_output.png

Extract Results with SQL Node

Add a SQL node, copy and paste the SQL query below.

SELECT
choices -> 0 -> 'message' -> 'content' AS email
FROM
events;

Click Run Step button. sql_cleanup_llmchat_output.png

Set Output Destination to Return Results via HTTP Response

Choose HTTP Response under Data Outputs an output destination. This configures the workflow to return synchronous HTTP response to the clients. adding_http_output.png

Publish the Workflow as an HTTP API Endpoint

Click on the Version & Publish button in the upper right corner. Then click Publish under Build Version to access the pop-up window.

publish_api.png

  • Paste the description below into the Description field.
First version of customized welcome email workflow

publish_api_detail.png Click Publish.

The HTTP API endpoint details and documentation will be displayed automatically.

api_documentation.png

Congratulations! you have now created an API that generates personalized emails! Next you can refer to the Call a Published API documentation for how to integrate this API with your applications.