# Route chat prompts to text, image, or video replies with Agnes AI and Telegram

> Quick overview This workflow receives a chat message, routes it to Agnes AI to generate either a text response, an image, or a video, uploads generated images to ImageKit, and sends completed videos to a Telegram chat. How it works 1. Receives an incoming chat message and reads the user’s prompt. 2. Routes the prompt based on keywords to either a text chat completion, an image generation request, or a video creation request in Agnes AI. 3. For text prompts, calls the Agnes AI chat completions endpoint and returns the generated reply to the chat. 4. For image prompts, calls the Agnes AI image generation endpoint and uploads the returned image URL to ImageKit. 5. For video prompts, starts a video generation job in Agnes AI and polls the job status until it is marked completed. 6. Downloads the completed video file from the returned URL and sends it to a specified Telegram chat as a video message with a caption. Setup 1. Add an Agnes AI HTTP Bearer Auth credential and ensure it is selecte

- **Domain**: `n8n-workflow-17871.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/17871
- Page (HTML): https://agenstry.com/agents/n8n-workflow-17871.n8n.io
- Documentation: https://n8n.io/workflows/17871
