Vellum is coming to the AI Engineering World's Fair in SF. Come visit our booth and get a live demo!

How to connect a Vellum AI Workflow with your Lovable app

Build a functional chatbot using Vellum AI Workflows and Lovable with just a few prompts.

6 min
Written by
Reviewed by
No items found.

In this guide, I’ll walk you through how I connected an AI chatbot built in Vellum to a UI created in Lovable.

Since Lovable doesn’t let you hit external APIs directly, this tutorial relies on prompts, Supabase, and a bit of trial and error.

What we’ll build

We’re going to create a warranty claims chatbot UI in Lovable that sends messages to a backend AI workflow hosted in Vellum. Here’s what that setup looks like under the hood:

  1. User enters a message in the Lovable chat UI
  2. The message is sent to a Supabase Edge Function, which holds the API key
  3. That function calls the Vellum workflow endpoint, sending the user input
  4. The response is returned and displayed back in the UI

Quick demo

👷🏻 Vellum

Before jumping into Lovable, you need to grab a few things from Vellum. You’ll need a working workflow that’s ready to receive user input and return AI-generated responses.

1. A Deployed Workflow & cURL

In Vellum’s Workflow Builder, define your inputs and logic. Once you’re happy with your workflow click “Deploy”. This will take you to the Deployments tab, where Vellum gives you a curl command for the API endpoint you want to hit.

The one that I used for this example was the “Execute Workflow Stream Endpoint”. Copy the curl statement and save it somewhere.

2. Grab the API Docs

For the endpoint you're using, make sure to have the corresponding Vellum API documentation on hand. Lovable will need this as context to understand what kind of response structure to expect from the API endpoint that you want to connect with the app.

For my example, since I’m using the “Execute Workflow Stream Endpoint” I copied the text from this documentation page: link

👉🏼 Important: Make sure to expand all parameters in the API documentation so that you can provide Lovable everything it needs for that API call.

3. Create your Vellum API key

From the main nav, go to More → API Keys.

Find the Vellum API section at the end of the page. From there, click on the “Create a new API key” button. In the popup, add a label, select the environment (Development is fine) and click “Create”.

Once you do that, the app will show you the API key that you can only copy once. Make sure you store that somewhere because we’ll need to store it in Lovable.

And that’s everything that you need from Vellum’s side:

  • A curl snippet from your AI workflow
  • A Documentation page for the endpoint we want to connect
  • A Vellum API Key

Now let’s take a look at what you can do with Lovable, which could be reliant so much on prompts, so don’t expect a straightforward process. But we have a few tips for you before we go into Lovable:

❤️ Lovable

Lovable creates code based on prompts (directions) you provide. prompt-driven. You chat with it, give it screenshots or instructions, and it builds your app step by step. Before we go into the details I want to stress a few important best practices that you should follow:

  • Start with a mockup. Ask Lovable to build a visual layout first before adding functionality.
  • Break down your prompts. Don’t try to give it everything at once, split instructions into smaller chunks.
  • Secure your API secrets. Use Supabase with Edge Functions to handle them safely.
  • Always use the “Chat” option to plan. Start by discussing what you want to build. Lovable can scan your current code and suggest a logical approach. This approach works well, because the agent will have some time to plan and think about the approach. To enable this “Chat” mode, simply click on the “Chat” option in the input field. To go back to “execution” mode, simply deselect the “Chat” option.

Ok, now let’s see what I did in Lovable, and what should work for your use-case as well.

1. Generate a mockup

I started by taking a screenshot from ChatGPT and asked Lovable to turn it into a mockup for my warranty claims chatbot.

👉🏼 This was my prompt: "I wanna create a mockup for a warranty claims chatbot that looks like the image above."

Lovable built a layout with a header, conversation history window, and an input box, a solid starting point for any chatbot.

2. Use Supabase to Securely Store the API Key

Since Lovable doesn’t have a secure place to store secrets, you’ll need to route all external calls through Supabase Edge Functions. Thankfully, Lovable integrates directly with Supabase.

In Lovable:

  • Click the Supabase icon on the sidebar
  • Create a new project (Lovable takes care of the setup for you)

Once that’s done, open the Chat tab in Lovable and ask:

👉🏼Prompt: “I have an API endpoint from my AI workflow that I want to connect with this mockup. I realize I need to store the API secret somewhere on Supabase, what should I do?”

Lovable will scan your project and propose a plan to:

  • Create an edge function
  • Store the Vellum API key securely
  • Send requests to your workflow

Click “Implement the plan” and paste your Vellum API key when prompted. I got this response once I did everything from the above:

After I added the API keys, Lovable started creating the edge function for me that will store the API endpoint in Supabase:

3. Connect the Chat UI to the Vellum API

Now, it’s time to show Lovable your curl statement and ask it to connect the mockup with your workflow, using the API secret you just stored in Supabase.

Before jumping into implementation, I provided Lovable more context on what I want to do, the curl statement and the API documentation, using the “Chat” option. Here’s how that looked it:

👉 Now let's try to connect to my API endpoint to execute my workflow that's created in Vellum. I'll send you a curl and some documentation about this API endpoint. Tell me if you know what to do next based on this information and how you plan to do it.

Here's the documentation:
{here I pasted the whole documentation page from Vellum.}

Here's the curl:

# create your API key here: https://app.vellum.ai/api-keys#keys
curl --request POST \
  --url "https://predict.vellum.ai/v1/execute-workflow" \
  --header "Content-Type: application/json" \
  --header "X-API-KEY: $VELLUM_API_KEY" \
  --data '{
    "workflow_deployment_name": "acme-electronics-warranty-claim-bot",
    "release_tag": "LATEST",
    "inputs": [
      {
        "type": "CHAT_HISTORY",
        "name": "chat_history",
        "value": [{
          "role": "USER",
          "text": "<example-user-text>"
        }]
      }
    ]
  }'

Then Lovable told me that it understands what I want to do and suggested this plan:

The plan looked solid, so I told Lovable to implement it:

4. Troubleshoot and Test the Integration with Lovable

My first test didn’t work. The UI showed:

“I processed your request but couldn't generate a proper response.”

So I asked Lovable:

“Can you check what’s going wrong with the API response?”

Lovable reviewed the edge function, noticed that the response from Vellum wasn’t being parsed correctly, and patched it to extract the text field correctly from the stream.

And that’s it! If you have any questions feel free to ping me on slack or over email anita@vellum.ai.

ABOUT THE AUTHOR
Anita Kirkovska
Founding Growth Lead

An AI expert with a strong ML background, specializing in GenAI and LLM education. A former Fulbright scholar, she leads Growth and Education at Vellum, helping companies build and scale AI products. She conducts LLM evaluations and writes extensively on AI best practices, empowering business leaders to drive effective AI adoption.

ABOUT THE reviewer

No items found.
lAST UPDATED
May 13, 2025
share post
Expert verified
Related Posts
Guides
October 21, 2025
15 min
AI transformation playbook
LLM basics
October 20, 2025
8 min
The Top Enterprise AI Automation Platforms (Guide)
LLM basics
October 10, 2025
7 min
The Best AI Workflow Builders for Automating Business Processes
LLM basics
October 7, 2025
8 min
The Complete Guide to No‑Code AI Workflow Automation Tools
All
October 6, 2025
6 min
OpenAI's Agent Builder Explained
Product Updates
October 1, 2025
7
Vellum Product Update | September
The Best AI Tips — Direct To Your Inbox

Latest AI news, tips, and techniques

Specific tips for Your AI use cases

No spam

Oops! Something went wrong while submitting the form.

Each issue is packed with valuable resources, tools, and insights that help us stay ahead in AI development. We've discovered strategies and frameworks that boosted our efficiency by 30%, making it a must-read for anyone in the field.

Marina Trajkovska
Head of Engineering

This is just a great newsletter. The content is so helpful, even when I’m busy I read them.

Jeremy Hicks
Solutions Architect

Experiment, Evaluate, Deploy, Repeat.

AI development doesn’t end once you've defined your system. Learn how Vellum helps you manage the entire AI development lifecycle.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Build AI agents in minutes with Vellum
Build agents that take on the busywork and free up hundreds of hours. No coding needed, just start creating.

General CTA component, Use {{general-cta}}

Build AI agents in minutes with Vellum
Build agents that take on the busywork and free up hundreds of hours. No coding needed, just start creating.

General CTA component  [For enterprise], Use {{general-cta-enterprise}}

The best AI agent platform for enterprises
Production-grade rigor in one platform: prompt builder, agent sandbox, and built-in evals and monitoring so your whole org can go AI native.

[Dynamic] Ebook CTA component using the Ebook CMS filtered by name of ebook.
Use {{ebook-cta}} and add a Ebook reference in the article

Thank you!
Your submission has been received!
Oops! Something went wrong while submitting the form.
Button Text

LLM leaderboard CTA component. Use {{llm-cta}}

Check our LLM leaderboard
Compare all open-source and proprietary model across different tasks like coding, math, reasoning and others.

Case study CTA component (ROI)

40% cost reduction on AI investment
Learn how Drata’s team uses Vellum and moves fast with AI initiatives, without sacrificing accuracy and security.

Case study CTA component (cutting eng overhead) = {{coursemojo-cta}}

6+ months on engineering time saved
Learn how CourseMojo uses Vellum to enable their domain experts to collaborate on AI initiatives, reaching 10x of business growth without expanding the engineering team.

Case study CTA component (Time to value) = {{time-cta}}

100x faster time to deployment for AI agents
See how RelyHealth uses Vellum to deliver hundreds of custom healthcare agents with the speed customers expect and the reliability healthcare demands.

[Dynamic] Guide CTA component using Blog Post CMS, filtering on Guides’ names

100x faster time to deployment for AI agents
See how RelyHealth uses Vellum to deliver hundreds of custom healthcare agents with the speed customers expect and the reliability healthcare demands.
New CTA
Sorts the trigger and email categories

Dynamic template box for healthcare, Use {{healthcare}}

Start with some of these healthcare examples

Clinical trial matchmaker
Match patients to relevant clinical trials based on EHR.
Healthcare explanations of a patient-doctor match
Summarize why a patient was matched with a specific provider.

Dynamic template box for insurance, Use {{insurance}}

Start with some of these insurance examples

AI agent for claims review
Review healthcare claims, detect anomalies and benchmark pricing.
Insurance claims automation agent
Collect and analyze claim information, assess risk and verify policy details.
Agent that summarizes lengthy reports (PDF -> Summary)
Summarize all kinds of PDFs into easily digestible summaries.

Dynamic template box for eCommerce, Use {{ecommerce}}

Start with some of these eCommerce examples

E-commerce shopping agent
Check order status, manage shopping carts and process returns.

Dynamic template box for Marketing, Use {{marketing}}

Start with some of these marketing examples

ReAct agent for web search and page scraping
Gather information from the internet and provide responses with embedded citations.
Competitor research agent
Scrape relevant case studies from competitors and extract ICP details.

Dynamic template box for Sales, Use {{sales}}

Start with some of these sales examples

Research agent for sales demos
Company research based on Linkedin and public data as a prep for sales demo.

Dynamic template box for Legal, Use {{legal}}

Start with some of these legal examples

AI legal research agent
Comprehensive legal research memo based on research question, jurisdiction and date range.
Legal RAG chatbot
Chatbot that provides answers based on user queries and legal documents.

Dynamic template box for Supply Chain/Logistics, Use {{supply}}

Start with some of these supply chain examples

Risk assessment agent for supply chain operations
Comprehensive risk assessment for suppliers based on various data inputs.

Dynamic template box for Edtech, Use {{edtech}}

Start with some of these edtech examples

Turn LinkedIn Posts into Articles and Push to Notion
Convert your best Linkedin posts into long form content.

Dynamic template box for Compliance, Use {{compliance}}

Start with some of these compliance examples

No items found.

Dynamic template box for Customer Support, Use {{customer}}

Start with some of these customer support examples

Q&A RAG Chatbot with Cohere reranking
Trust Center RAG Chatbot
Read from a vector database, and instantly answer questions about your security policies.

Template box, 2 random templates, Use {{templates}}

Start with some of these agents

Research agent for sales demos
Company research based on Linkedin and public data as a prep for sales demo.
Trust Center RAG Chatbot
Read from a vector database, and instantly answer questions about your security policies.

Template box, 6 random templates, Use {{templates-plus}}

Build AI agents in minutes

Financial Statement Review Workflow
Extract and review financial statements and their corresponding footnotes from SEC 10-K filings.
SOAP Note Generation Agent
Extract subjective and objective info, assess and output a treatment plan.
PDF Data Extraction to CSV
Extract unstructured data (PDF) into a structured format (CSV).
Clinical trial matchmaker
Match patients to relevant clinical trials based on EHR.
ReAct agent for web search and page scraping
Gather information from the internet and provide responses with embedded citations.
Population health insights reporter
Combine healthcare sources and structure data for population health management.

Build AI agents in minutes for

{{industry_name}}

Clinical trial matchmaker
Match patients to relevant clinical trials based on EHR.
Prior authorization navigator
Automate the prior authorization process for medical claims.
Population health insights reporter
Combine healthcare sources and structure data for population health management.
Legal document processing agent
Process long and complex legal documents and generate legal research memorandum.
Legal contract review AI agent
Asses legal contracts and check for required classes, asses risk and generate report.
Legal RAG chatbot
Chatbot that provides answers based on user queries and legal documents.

Case study results overview (usually added at top of case study)

What we did:

1-click

This is some text inside of a div block.

28,000+

Separate vector databases managed per tenant.

100+

Real-world eval tests run before every release.