docs/user_guide/en/nodes/literal.md
The Literal node is used to output fixed text content. When the node is triggered, it ignores all inputs and directly outputs a predefined message.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
content | text | Yes | - | Fixed text content to output, cannot be empty |
role | string | No | user | Message role: user or assistant |
Characteristics of the Literal node:
content every time it executesuser: Indicates this is a message sent by the userassistant: Indicates this is a message sent by the assistant (AI)The role setting affects how downstream nodes process the message.
nodes:
- id: Welcome Message
type: literal
config:
content: |
Welcome to the intelligent assistant! Please describe your needs.
role: assistant
nodes:
- id: Context Injector
type: literal
config:
content: |
Please note the following rules:
1. Answers must be concise and clear
2. Reply in English
3. If uncertain, please state so
role: user
- id: Assistant
type: agent
config:
provider: openai
name: gpt-4o
edges:
- from: Context Injector
to: Assistant
nodes:
- id: Classifier
type: agent
config:
provider: openai
name: gpt-4o
role: Determine user intent, reply with KNOWN or UNKNOWN
- id: Known Response
type: literal
config:
content: I can help you complete this task.
role: assistant
- id: Unknown Response
type: literal
config:
content: Sorry, I cannot understand your request. Please describe it in a different way.
role: assistant
edges:
- from: Classifier
to: Known Response
condition:
type: keyword
config:
any: [KNOWN]
- from: Classifier
to: Unknown Response
condition:
type: keyword
config:
any: [UNKNOWN]
nodes:
- id: Test Input
type: literal
config:
content: |
This is a test text for verifying downstream processing logic.
Contains multiple lines.
role: user
- id: Processor
type: python
config:
timeout_seconds: 30
edges:
- from: Test Input
to: Processor
start: [Test Input]
content field cannot be an empty string| for writing long textrole to ensure downstream nodes process the message correctly