{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "260f5434-583e-4d83-b8db-f21822617d45",
      "name": "Sticky Note - Telegram Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        1584
      ],
      "parameters": {
        "color": 4,
        "width": 248,
        "height": 344,
        "content": "## Incoming Message\n### Use this to capture the chat ID for Telegram delivery.\nSend any message to this bot to get started."
      },
      "typeVersion": 1
    },
    {
      "id": "2e5506ca-1137-47fb-aeaf-8789a927b0b8",
      "name": "\ud83d\udce9 Receive Telegram Message1",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        448,
        1760
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8b1ba5c2-533b-4300-bd81-c37d0d8a79ae",
      "name": "\u23f0 Schedule Trigger (Daily)1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        448,
        2112
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 7,
              "triggerAtMinute": 30
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ebe338f1-fb23-407e-9e05-e374f13758e0",
      "name": "\u270d\ufe0f Generate Quote (AI/ML API)1",
      "type": "n8n-nodes-aimlapi.aimlApi",
      "position": [
        752,
        1936
      ],
      "parameters": {
        "model": "openai/gpt-4o",
        "prompt": "You are a generator of short, original, uplifting quotes.\n\nRequirements:\n- Output ONLY the quote text, no author, no quotes, no markdown.\n- Max 180 characters.\n- Avoid clich\u00e9s.\n- Language: the same as this instruction.\n\nGenerate 1 quote.",
        "options": {},
        "requestOptions": {}
      },
      "credentials": {
        "aimlApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "00d23e37-ac8e-4345-8e36-b22e31c2dcea",
      "name": "\ud83c\udfa8 Generate Image (AI/ML API | flux-pro)2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1072,
        1936
      ],
      "parameters": {
        "url": "https://api.aimlapi.com/v1/images/generations",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "flux-pro"
            },
            {
              "name": "prompt",
              "value": "={{ \"Create a cinematic, aesthetically pleasing illustration that captures the spirit of this quote. No text in the image. Emphasize mood, lighting, composition. Quote: \" + $('\u270d\ufe0f Generate Quote (AI/ML API)1').item.json.content }}"
            },
            {
              "name": "n",
              "value": "1"
            },
            {
              "name": "size",
              "value": "1024x1024"
            },
            {
              "name": "response_formats",
              "value": "=1"
            }
          ]
        },
        "nodeCredentialType": "aimlApi"
      },
      "credentials": {
        "aimlApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "1e589308-1a74-4d1d-892e-e3010cce2392",
      "name": "\ud83d\udce4 Send to Telegram1",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1392,
        1936
      ],
      "parameters": {
        "file": "={{ $('\ud83c\udfa8 Generate Image (AI/ML API | flux-pro)2').item.json.images[0].url }}",
        "chatId": "={{ $('\ud83d\udce9 Receive Telegram Message1').item.json.message.chat.id }}",
        "operation": "sendPhoto",
        "additionalFields": {
          "caption": "={{ \"\ud83c\udf05 \" + $('\u270d\ufe0f Generate Quote (AI/ML API)1').item.json.content }}"
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cb3c6fef-2d1d-45bf-8908-b352b2eef2ac",
      "name": "Sticky Note - Generate Quote",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        1744
      ],
      "parameters": {
        "color": 6,
        "width": 300,
        "height": 428,
        "content": "## 2\ufe0f\u20e3 Generate Quote\n### AI/ML API creates a short, original, uplifting quote with no author attribution, ready for visual inspiration."
      },
      "typeVersion": 1
    },
    {
      "id": "a331b89b-f8cb-452e-a88c-e8c301eab1dd",
      "name": "Sticky Note - Create Image",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        1744
      ],
      "parameters": {
        "color": 6,
        "width": 300,
        "height": 428,
        "content": "## 3\ufe0f\u20e3 Create Image\n### The generated quote is turned into an AI image via AI/ML API (flux-pro) with cinematic and aesthetic composition."
      },
      "typeVersion": 1
    },
    {
      "id": "a184f1fb-11df-4b53-bd5a-37d9f8a64be7",
      "name": "Sticky Note - Send to Telegram",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        1744
      ],
      "parameters": {
        "color": 4,
        "width": 300,
        "height": 428,
        "content": "## 4\ufe0f\u20e3 Send to Telegram\n### The final image and quote caption are sent to the captured chat ID from the Telegram trigger."
      },
      "typeVersion": 1
    },
    {
      "id": "67085e4e-0d9c-4c29-baac-da1779c05d66",
      "name": "Sticky Note - Telegram Setup1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        1936
      ],
      "parameters": {
        "color": 4,
        "width": 248,
        "height": 344,
        "content": "## 1\ufe0f\u20e3 Trigger\n### The workflow starts either on schedule (daily) or when a message is received from Telegram to capture the chat ID."
      },
      "typeVersion": 1
    },
    {
      "id": "b57ae9fa-8690-4544-9ee6-86214b26b87c",
      "name": "Sticky Note - Intro",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        1552
      ],
      "parameters": {
        "color": 5,
        "width": 460,
        "height": 236,
        "content": "# \ud83c\udf05 Daily AI Inspiration \u2014 Telegram + AI/ML API\n\nThis workflow sends a daily AI-generated inspirational quote with a matching image directly to your Telegram chat. It can also be triggered manually by sending a message to the bot to capture your chat ID."
      },
      "typeVersion": 1
    },
    {
      "id": "9e4edede-c992-4abc-99cd-15eac550ee71",
      "name": "Sticky Note - Step 1 Trigger",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        1616
      ],
      "parameters": {
        "color": 4,
        "width": 460,
        "height": 284,
        "content": "## 1\ufe0f\u20e3 Trigger Setup (Telegram / Schedule)\n- Start on a **daily schedule** (`Schedule Trigger` node) or via **Telegram message** (`Telegram Trigger` node).\n- **Telegram Bot Setup:**\n  1. Create a bot via [@BotFather](https://t.me/BotFather)\n  2. Save the **Telegram Bot API key**\n  3. In n8n: `Credentials \u2192 Telegram API` \u2192 paste the key\n- Sending any message to the bot captures the **chat ID** for deliveries."
      },
      "typeVersion": 1
    },
    {
      "id": "e113c728-9408-4014-b6a0-1979110a39d5",
      "name": "Sticky Note - Step 2 Quote",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        1792
      ],
      "parameters": {
        "color": 6,
        "width": 460,
        "height": 296,
        "content": "## 2\ufe0f\u20e3 Generate Quote (AI/ML API)\n- Model: `openai/gpt-4o`\n- Generates a short, original, uplifting quote:\n  * No author name\n  * No quotes around text\n  * Max 180 characters\n  * Avoid clich\u00e9s\n- **AI/ML API Setup:**\n  1. Get your API key from [aimlapi.com](https://aimlapi.com)\n  2. In n8n: `Credentials \u2192 AI/ML API` \u2192 paste the key\n- Output is passed to the image generation step."
      },
      "typeVersion": 1
    },
    {
      "id": "987f164a-f000-4538-ad4f-7cc1764c2ec7",
      "name": "Sticky Note - Step 3 Image",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -176,
        1904
      ],
      "parameters": {
        "color": 6,
        "width": 460,
        "height": 296,
        "content": "## 3\ufe0f\u20e3 Create Image (AI/ML API \u2014 flux-pro)\n- Sends the generated quote as a prompt to `flux-pro` model.\n- Produces a cinematic, aesthetically pleasing illustration:\n  * No text in image\n  * Focus on mood, lighting, composition\n- Default parameters:\n  * Size: 1024\u00d71024\n  * n: 1 (one image)\n- Configurable in the HTTP Request node for different styles, sizes, or counts."
      },
      "typeVersion": 1
    },
    {
      "id": "a21f5e8c-6dec-412d-a12f-e6833d4885af",
      "name": "Sticky Note - Step 4 Send",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        2096
      ],
      "parameters": {
        "color": 4,
        "width": 460,
        "height": 172,
        "content": "## 4\ufe0f\u20e3 Send to Telegram\n- Sends the generated image to the captured **chat ID**.\n- Adds the quote as a caption with a \ud83c\udf05 emoji prefix.\n- Works for both scheduled and manual runs.\n- Pro Tip: Test the workflow manually once to confirm delivery before enabling the schedule."
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "\u23f0 Schedule Trigger (Daily)1": {
      "main": [
        [
          {
            "node": "\u270d\ufe0f Generate Quote (AI/ML API)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83d\udce9 Receive Telegram Message1": {
      "main": [
        [
          {
            "node": "\u270d\ufe0f Generate Quote (AI/ML API)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u270d\ufe0f Generate Quote (AI/ML API)1": {
      "main": [
        [
          {
            "node": "\ud83c\udfa8 Generate Image (AI/ML API | flux-pro)2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\ud83c\udfa8 Generate Image (AI/ML API | flux-pro)2": {
      "main": [
        [
          {
            "node": "\ud83d\udce4 Send to Telegram1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}