Workflow:Langgenius Dify App Creation and Configuration
| Knowledge Sources | |
|---|---|
| Domains | LLM_Ops, Application_Development |
| Last Updated | 2026-02-12 07:00 GMT |
Overview
End-to-end process for creating, configuring, testing, and publishing an LLM-powered application on the Dify platform, from app mode selection through model configuration to API deployment.
Description
This workflow covers the complete lifecycle of a Dify application. Users select an application mode (chatbot, text completion, agent, or workflow-based), configure the underlying LLM model and parameters, design the prompt template, connect knowledge bases for RAG, set up tools, test the application in the debug console, and publish it as a web interface or REST API. The platform supports importing and exporting applications as DSL (YAML) files for portability and version control.
Usage
Execute this workflow when you need to build a new AI-powered application on Dify. This applies whether you are creating a simple chatbot, a text generation endpoint, an autonomous agent with tool access, or a complex multi-step workflow application. This is also the path for duplicating or importing existing applications.
Execution Steps
Step 1: Create Application
Initialize a new application by choosing a mode and providing basic metadata. The platform supports four application modes: chatbot (multi-turn conversation), text completion (single-turn generation), agent (autonomous tool-using), and workflow (DAG-based multi-step). Provide a name, icon, and optional description.
App modes:
- Chatbot: Multi-turn conversational interface with memory
- Text Completion: Single-prompt, single-response generation
- Agent: Autonomous LLM with tool calling capabilities
- Workflow: Visual DAG-based multi-step processing (covered in detail in a separate workflow)
Alternative creation methods:
- Import from DSL (YAML) file for portable app definitions
- Duplicate an existing application
- Create from a template in the Explore section
Step 2: Configure Model and Parameters
Select the LLM provider and model, then tune generation parameters. Configure the model's temperature, top-p, max tokens, and other provider-specific parameters. Set up the system prompt that defines the application's behavior and persona.
Key configurations:
- Model provider and model selection (OpenAI, Anthropic, local models, etc.)
- Temperature, top-p, presence penalty, frequency penalty
- Max tokens for response length control
- System prompt / instruction template
- Stop sequences and response format
Step 3: Design Prompt Template
Craft the prompt template using the Prompt IDE. Define input variables that users will provide, set up the system message for chatbots, and configure the prompt structure. The template supports variable interpolation with double curly braces for dynamic content injection.
Prompt features:
- Variable placeholders for dynamic user inputs
- System message configuration for persona and instructions
- Context injection points for RAG integration
- Pre-prompt and post-prompt hooks
- Conversation history management settings
Step 4: Connect Knowledge Bases
Attach one or more datasets (knowledge bases) to enable retrieval-augmented generation. Configure the retrieval strategy (keyword, semantic, or hybrid), set the number of retrieved chunks, and adjust the relevance score threshold. This step enables the application to answer questions based on uploaded documents.
Retrieval configuration:
- Select datasets to query during generation
- Choose retrieval method: keyword search, semantic similarity, or hybrid
- Set top-K parameter for number of retrieved chunks
- Configure score threshold for relevance filtering
- Enable reranking for improved result ordering
Step 5: Test in Debug Console
Use the built-in debug console to test the application before publishing. Send test messages, inspect model responses, review token usage, and examine retrieved context chunks. The debug console supports streaming responses and shows execution details for each interaction.
Debug capabilities:
- Send test messages and review responses
- Inspect token usage and latency metrics
- View retrieved context chunks from knowledge bases
- Test variable inputs with sample values
- Monitor conversation memory state
Step 6: Publish and Deploy
Publish the application for end-user access. Enable the web interface for browser-based access or the API endpoint for programmatic integration. Configure access controls, rate limiting, and custom branding for the public-facing interface. Generate API keys for service-to-service integration.
Deployment options:
- Web interface: Public URL with optional custom domain and branding
- API endpoint: RESTful API with token-based authentication
- Embeddable widget: JavaScript snippet for third-party website integration
- Rate limiting and access token rotation
- Custom site configuration (title, description, copyright)