Prompts

This Langflow feature is currently in public preview. Development is ongoing, and the features and functionality are subject to change. Langflow, and the use of such, is subject to the DataStax Preview Terms.

A prompt is a structured input to a language model that instructs the model how to handle user inputs and variables.

Prompt components create prompt templates with custom fields and dynamic variables for providing your model with structured, repeatable prompts.

Prompts are a combination of natural language and variables created with curly braces.

Use a prompt component in a flow

An example of modifying a prompt can be found in the Quickstart, where a basic chatbot flow is extended to include a full vector RAG pipeline.

quickstart add document ingestion

The default prompt in the Prompt component is Answer the user as if you were a GenAI expert, enthusiastic about helping them get started building something fresh.

This prompt creates a "personality" for your LLM’s chat interactions, but it doesn’t include variables that you may find useful when templating prompts.

To modify the prompt template, in the Prompt component, click the Template field. For example, the {context} variable gives the LLM model access to embedded vector data to return better answers.

Given the context
{context}
Answer the question
{user_question}

When variables are added to a prompt template, new fields are automatically created in the component. These fields can be connected to receive text input from other components to automate prompting, or to output instructions to other components. An example of prompts controlling an agent’s behavior is available in the sequential tasks agent starter flow.

Prompt

This component creates a prompt template with dynamic variables. This is useful for structuring prompts and passing dynamic data to a language model.

Parameters

Inputs
Name Display Name Info

template

Template

The prompt template with dynamic variables

Outputs
Name Display Name Info

prompt

Prompt Message

The built prompt message

Prompt template field

The template field allows you to create other fields dynamically by using curly brackets. For example, if you have a template like Hello {name}, how are you?, a new field called name is created. Prompt variables can be created with any name inside curly brackets, e.g. {variable_name}.

Component code

prompt.py
404: Not Found

Langchain Hub prompt

This component is deprecated. Instead, use the Prompt component.

This component allows you to use prompts from LangChain Hub in your flow.

Parameters

Inputs
Name Type Description

langchain_api_key

SecretString

Your LangChain API key for authentication

langchain_hub_prompt

String

The LangChain Hub prompt to use (e.g., "efriis/my-first-prompt")

Outputs
Name Type Description

prompt

Message

The built prompt from LangChain Hub

Component code

langchain_hub.py
404: Not Found

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2025 DataStax, an IBM Company | Privacy policy | Terms of use | Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com