Optimize Prompt
Configured with Agent, Execute Workflow Trigger, OpenAI Chat Model, Memory Buffer Window, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Trigger
- AI & models
- Messaging
- Code
- Data store
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| When Executed by Another Workflow | Trigger | Execute Workflow Trigger | See node parameters |
| AI Agent | AI & models | Agent | See node parameters |
| Telegram3 | Messaging | Telegram | See node parameters |
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| Split into chunks1 | Code | Code | See node parameters |
| Simple Memory | Data store | Memory Buffer Window | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
openAiApitelegramApi
Workflow notes
Trigger
Trigger
-
Trigger can be anything. For this example the trigger is a call from another workflow and a received Telegram message.
-
Note that this workflow can be integrated in the middle of another larger workflow.
Inference / Optimization
Inference / Optimization
- Incoming trigger is processed by a LLM with a specific system prompt set aimed at improving the input prompt.
Improved prompt:
Improved prompt:
-
Send as a response
-
Use as input for next nodes
Workflow Documentation
Workflow Documentation
Description:
This workflow is designed to optimize prompts by enhancing user inputs for clarity and specificity using AI. The workflow takes a user-provided prompt as input and uses a Natural Language Processing (NLP) model to refine and improve the prompt. The optimized prompt is then sent back to the user, ready for use in further workflows or processes.
Setup:
- This workflow is suitable for users who want to improve their prompts for better communication and understanding in their workflows.
- The workflow utilizes an AI Agent powered by an OpenAI Chat Model to enhance user prompts.
- A Telegram node is used to deliver the optimized prompt back to the user.
- Ensure you have the necessary credentials set up for Telegram and OpenAI accounts.
- Customize the workflow's settings, such as the AI model used for prompt optimization, to suit your requirements.
- Activate the workflow once all configurations are set to start optimizing prompts efficiently.
Expected Outcomes:
- Users can provide vague or imprecise prompts as input to the workflow.
- The AI Agent will refine and optimize the prompt, adding clarity and specific details.
- The optimized prompt will be delivered back to the user via Telegram for further use in workflows or processes.
For more detailed instructions and guidelines on using this workflow, refer to the detailed setup guide above.
Optimize Prompt
Optimize Prompt
Purpose and structure
This folder contains the Optimize Prompt workflow. Its executable nodes use agent, code, executeWorkflowTrigger, lmChatOpenAi, memoryBufferWindow, telegram. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
When Executed by Another Workflow
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Telegram/1877_Telegram_Stickynote_Automation_Triggered.json MIT; preserve source notices.