Skip to main content

Prompt In

Defines a prompt template that can be requested by MCP clients. Prompt In nodes receive requests with parameters and trigger your automation flow to generate dynamic prompt content.

Common Properties​

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs​

  • Prompt Name - The unique name of the prompt template. This identifies the prompt to MCP clients. Must be unique within the server.
  • Prompt Description - A description explaining what the prompt does and when to use it. This helps clients understand the prompt's purpose.
  • Prompt - The prompt template content using Handlebars syntax. Use {{variable}} for parameter substitution.

Outputs​

  • Prompt Name - The name of the prompt that was requested by the client.
  • Prompt - The rendered prompt content with parameters substituted.
  • Parameters - An object containing all parameters passed by the client.

How It Works​

When a Prompt In node is connected to a Listen node's prompts port:

  1. Registration - The prompt is registered with the MCP server at startup
  2. Client Request - When a client calls GetPrompt with this prompt's name and parameters
  3. Triggering - The Prompt In node receives the request and outputs the prompt name and parameters
  4. Processing - Your flow processes the request (e.g., render template, fetch data)
  5. Response - A Prompt Out node sends the generated content back to the client

The Prompt In node uses Handlebars templating for parameter substitution. Variables in the template (like {{name}} or {{company}}) are replaced with values from the client's parameter object.

Requirements​

  • Must be connected to a Listen node's prompts port
  • Prompt Name must be unique within the server
  • Prompt template should use valid Handlebars syntax

Usage Notes​

Prompt Template Syntax​

  • Use {{variable}} for simple variable substitution
  • Variables are replaced with values from the Parameters object
  • Undefined variables are replaced with empty strings
  • Template is rendered before being sent to the Prompt Out node

Parameter Handling​

  • Parameters are passed as a JSON object from the client
  • Access parameters in your flow using the Parameters output
  • Parameter names should match template variables for proper substitution

Flow Design​

  • Prompt In nodes typically connect to processing logic, then to a Prompt Out node
  • You can add complex logic between Prompt In and Prompt Out
  • Use the Parameters output to customize prompt generation

Examples​

Example 1: Simple Welcome Prompt​

Configuration:

  • Prompt Name: welcome_message
  • Prompt Description: Generates a welcome message for new users
  • Prompt Template:
Welcome {{name}} to {{company}}! We're excited to have you join our {{department}} team.

Client Request Parameters:

{
"name": "Alice",
"company": "Acme Corp",
"department": "Engineering"
}

Output:

Welcome Alice to Acme Corp! We're excited to have you join our Engineering team.

Example 2: Code Review Prompt​

Configuration:

  • Prompt Name: code_review
  • Prompt Description: Generate a prompt for AI code review
  • Prompt Template:
Review the following {{language}} code for:
- Best practices
- Security issues
- Performance optimization
- Code style consistency

Focus area: {{focus}}
Severity level: {{severity}}

Client Request Parameters:

{
"language": "Python",
"focus": "security",
"severity": "critical"
}

Output:

Review the following Python code for:
- Best practices
- Security issues
- Performance optimization
- Code style consistency

Focus area: security
Severity level: critical

Example 3: Dynamic Email Template​

Configuration:

  • Prompt Name: email_template
  • Prompt Description: Generate personalized email content
  • Prompt Template:
Subject: {{subject}}

Dear {{recipient_name}},

{{body}}

{{#if include_cta}}
Call to Action: {{cta_text}}
{{/if}}

Best regards,
{{sender_name}}
{{sender_title}}

Note: This example shows Handlebars conditional syntax for advanced templating.


Example 4: Multi-Language Support​

Configuration:

  • Prompt Name: greeting
  • Prompt Description: Generate greeting in multiple languages
  • Prompt Template:
Language: {{language}}
Formality: {{formality}}
Context: {{context}}

Generate an appropriate greeting message.

Flow Logic:

  1. Prompt In receives language, formality, context
  2. Custom node determines appropriate greeting based on parameters
  3. Prompt Out returns localized greeting

Best Practices​

  1. Naming:

    • Use clear, descriptive prompt names (e.g., code_review, email_template)
    • Use lowercase with underscores for consistency
    • Avoid spaces in prompt names
  2. Descriptions:

    • Write clear descriptions explaining the prompt's purpose
    • Include information about required and optional parameters
    • Mention any constraints or special formatting
  3. Template Design:

    • Keep templates focused on a single purpose
    • Use meaningful variable names
    • Document expected parameter types in the description
    • Consider default values for optional parameters
  4. Parameter Validation:

    • Add validation logic in your flow before Prompt Out
    • Handle missing or invalid parameters gracefully
    • Provide helpful error messages
  5. Testing:

    • Test with various parameter combinations
    • Verify template rendering works correctly
    • Check edge cases (empty parameters, special characters)
  6. Organization:

    • Group related prompts logically
    • Use consistent naming conventions
    • Maintain a catalog of available prompts

Common Errors and Solutions​

Error: "Prompt name already exists"​

Cause: Two Prompt In nodes have the same Prompt Name.

Solution:

  • Ensure each Prompt In node has a unique Prompt Name
  • Check all Prompt In nodes connected to the Listen node

Error: "Missing required parameters"​

Cause: Client didn't provide expected parameters.

Solution:

  • Document required parameters in the Prompt Description
  • Add validation in your flow
  • Provide default values for optional parameters

Error: "Template rendering failed"​

Cause: Invalid Handlebars syntax in the template.

Solution:

  • Verify Handlebars syntax is correct
  • Test template with sample parameters
  • Check for unmatched braces or invalid helpers

Tips for Effective Use​

  1. Parameter Documentation - Clearly document expected parameters in the description
  2. Template Testing - Test templates with various parameter values
  3. Error Handling - Validate parameters before rendering
  4. Versioning - Update prompt names when making breaking changes
  5. Consistency - Use consistent formatting and style across prompts
  6. Reusability - Design templates that work in multiple contexts
  7. Clear Output - Ensure generated prompts are clear and actionable

Advanced Patterns​

Dynamic Prompt Selection​

Connect multiple Prompt In nodes to handle different prompt types, routing to different processing logic based on the prompt name.

Prompt Chaining​

Use one prompt's output as input for another by combining with Tool calls or Resource reads.

Context-Aware Prompts​

Include logic to fetch additional context (from databases, APIs) before generating the final prompt.

Validation and Sanitization​

Add nodes between Prompt In and Prompt Out to validate, sanitize, or enrich parameters before rendering.