This n8n workflow powers a Telegram bot designed for prompt engineering. By passing user messages through OpenRouter to the Gemini 3.1 Pro Preview model, it transforms rough ideas into highly optimized, production-ready system prompts. The AI is constrained by a strict system prompt to ensure it only returns its reasoning and the final prompt, completely eliminating conversational filler.
- Seamless Telegram Integration: Listens for incoming messages and replies directly in the chat.
- Non-Blocking Architecture: Immediately acknowledges the Telegram webhook to prevent timeout errors.
- UX Enhancements: Sends a "typing" action to Telegram while the AI generates the response.
- Premium AI Processing: Connects to OpenRouter to utilize the
google/gemini-3.1-pro-previewmodel. - Strict Output Formatting: Forces the AI to reply with bulleted reasoning and the finalized prompt inside a Markdown code block.
- Error Handling: Automatically catches API failures and notifies the user directly in Telegram.
Before importing this workflow, you will need the following:
- An active n8n instance (self-hosted or cloud).
- A Telegram Bot Token (obtained via BotFather).
- An OpenRouter API Key.
- Download the workflow file named Omni-Prompt Engineer Bot(1).json to your local machine.
- Open your n8n workspace.
- Navigate to Workflows and click Add Workflow.
- Click the options menu in the top right corner and select Import from File.
- Upload the Omni-Prompt Engineer Bot(1).json file.
- Open the Telegram Trigger, Show Typing Status, Push Result, and Notify Error nodes to connect your Telegram API credentials.
- Open the OpenRouter API node and update the Bearer token in the Headers section with your actual OpenRouter API key.
- Save and toggle the workflow to Active.
This workflow executes in six distinct steps:
- Telegram Trigger: Receives the text message from the user.
- Ack (Release Connection): Returns a quick JSON status payload to release the webhook connection immediately.
- Show Typing Status: Triggers a chat action in Telegram so the user knows the bot is processing the request.
- OpenRouter API: Sends the user's text alongside a rigid system prompt to the Gemini model.
- Push Result: Parses the successful Markdown response and sends it back as a reply to the original Telegram message.
- Notify Error: If the OpenRouter API fails, this fallback node catches the error and sends a formatted warning to the user.