{
  "id": 5462,
  "name": "Generate images with OpenAI DALL-E via Telegram & log to Google Sheets",
  "description": "## \ud83d\udccc Workflow Description\n\nThis workflow allows users to generate AI images directly from Telegram while automatically logging each request to Google Sheets for tracking. When a user sends a prompt to your Telegram bot, the workflow receives the prompt, generates an image using OpenAI, saves the prompt and generated image link to Google Sheets, and then sends the image back to the user in Telegram.\n\n\n\n## \u2699\ufe0f How to Set It Up\n\n\nConnect your Telegram credentials by adding your bot token in both the Telegram Trigger and Telegram Send Message nodes. Ensure your bot is added to the intended chat.\n\nConnect your OpenAI credentials by inserting your API key in the OpenAI node and configuring it for image generation.\n\nConnect your Google Sheets account by authorising the Google Sheets node and selecting the target spreadsheet and worksheet where you want to save prompts and image links.\n\nFinally, activate the workflow and test by sending a prompt to your Telegram bot to confirm that the image is generated, saved to Google Sheets, and sent back to Telegram seamlessly.\n\nThat\u2019s it \u2013 your AI Image Generator with Google Sheets logging is ready to use.\n\t\t\n\u2e3b\n\n\u2705 That\u2019s it \u2013 your AI Image Generator with Google Sheets logging is ready for use.",
  "categories": [
    {
      "id": 31,
      "name": "Content Creation"
    },
    {
      "id": 51,
      "name": "Multimodal AI"
    }
  ],
  "totalViews": 2968,
  "createdAt": "2025-06-30T03:09:14.415Z",
  "workflow": {
    "id": "SGqUVskzXEBI5EHa",
    "meta": {
      "instanceId": "2000c64071c20843606b95c63795bb0797c41036047055a6586498e855b96efc",
      "templateCredsSetupCompleted": true
    },
    "name": "Telegram AI Image Generator + Google Sheets Logger",
    "tags": [],
    "nodes": [
      {
        "id": "09061203-acb3-45f3-a2e9-a6899fab1260",
        "name": "OpenAI",
        "type": "@n8n/n8n-nodes-langchain.openAi",
        "position": [
          -100,
          -40
        ],
        "parameters": {
          "prompt": "={{ $json.message.text }}",
          "options": {
            "size": "1024x1024",
            "dalleQuality": "standard",
            "returnImageUrls": true
          },
          "resource": "image"
        },
        "credentials": {
          "openAiApi": {
            "id": "credential-id",
            "name": "openAiApi Credential"
          }
        },
        "typeVersion": 1.8
      },
      {
        "id": "a571ef80-e5ab-457f-8bf0-ab4372420819",
        "name": "Telegram Trigger",
        "type": "n8n-nodes-base.telegramTrigger",
        "position": [
          -320,
          -40
        ],
        "webhookId": "bf451ae4-19ae-4831-9654-823e0b9fc842",
        "parameters": {
          "updates": [
            "message"
          ],
          "additionalFields": {}
        },
        "credentials": {
          "telegramApi": {
            "id": "credential-id",
            "name": "telegramApi Credential"
          }
        },
        "typeVersion": 1.2
      },
      {
        "id": "90001184-fca0-44a2-892b-72c772bfd6da",
        "name": "Telegram",
        "type": "n8n-nodes-base.telegram",
        "position": [
          380,
          -40
        ],
        "webhookId": "c627bb8e-915d-4289-985b-ab1a75c34775",
        "parameters": {
          "file": "={{ $json['Image title'] }}",
          "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
          "operation": "sendPhoto",
          "additionalFields": {}
        },
        "credentials": {
          "telegramApi": {
            "id": "credential-id",
            "name": "telegramApi Credential"
          }
        },
        "typeVersion": 1.2
      },
      {
        "id": "924d8b95-8687-4419-b994-93e32a23ea24",
        "name": "Sticky Note",
        "type": "n8n-nodes-base.stickyNote",
        "position": [
          -400,
          -360
        ],
        "parameters": {
          "width": 920,
          "height": 480,
          "content": "## Telegram AI Image Generator + Google Sheets Logger\n1. Telegram Trigger\nReceives image generation requests from users directly via Telegram.\n\n2. OpenAI Node\nProcesses the request by generating the required image based on the user\u2019s prompt.\n\n3. Saves the prompt and generated image link to Google Sheets.\n\n4. Telegram Send Message\nSends the generated image back to the user in Telegram as a seamless automated response.\n\nLoom Demo : [Link](https://www.loom.com/share/1c5e645442f6441baf9efd12a334eef0)"
        },
        "typeVersion": 1
      },
      {
        "id": "aed2c34b-ef3f-465d-a5bd-9d3fda8f9a9a",
        "name": "Google Sheets",
        "type": "n8n-nodes-base.googleSheets",
        "position": [
          160,
          -40
        ],
        "parameters": {
          "columns": {
            "value": {
              "Image title": "={{ $json.url }}",
              "Image description": "={{ $json.revised_prompt }}"
            },
            "schema": [
              {
                "id": "Image description",
                "type": "string",
                "display": true,
                "required": false,
                "displayName": "Image description",
                "defaultMatch": false,
                "canBeUsedToMatch": true
              },
              {
                "id": "Image title",
                "type": "string",
                "display": true,
                "required": false,
                "displayName": "Image title",
                "defaultMatch": false,
                "canBeUsedToMatch": true
              }
            ],
            "mappingMode": "defineBelow",
            "matchingColumns": [],
            "attemptToConvertTypes": false,
            "convertFieldsToString": false
          },
          "options": {},
          "operation": "append",
          "sheetName": {
            "__rl": true,
            "mode": "list",
            "value": "gid=0",
            "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iABxBKBY9ERctigW1bYvvRTIAf-m-InTSvSKnqANUhg/edit#gid=0",
            "cachedResultName": "Sheet1"
          },
          "documentId": {
            "__rl": true,
            "mode": "list",
            "value": "1iABxBKBY9ERctigW1bYvvRTIAf-m-InTSvSKnqANUhg",
            "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iABxBKBY9ERctigW1bYvvRTIAf-m-InTSvSKnqANUhg/edit?usp=drivesdk",
            "cachedResultName": "image database"
          }
        },
        "credentials": {
          "googleSheetsOAuth2Api": {
            "id": "credential-id",
            "name": "googleSheetsOAuth2Api Credential"
          }
        },
        "typeVersion": 4.6
      }
    ],
    "active": true,
    "pinData": {},
    "settings": {
      "executionOrder": "v1"
    },
    "versionId": "2e4735b4-9872-45d0-af17-2af4314ad196",
    "connections": {
      "OpenAI": {
        "main": [
          [
            {
              "node": "Google Sheets",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Telegram": {
        "main": [
          []
        ]
      },
      "Google Sheets": {
        "main": [
          [
            {
              "node": "Telegram",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Telegram Trigger": {
        "main": [
          [
            {
              "node": "OpenAI",
              "type": "main",
              "index": 0
            }
          ]
        ]
      }
    }
  },
  "workflowInfo": {
    "nodeCount": 5,
    "nodeTypes": {
      "n8n-nodes-base.telegram": {
        "count": 1
      },
      "n8n-nodes-base.stickyNote": {
        "count": 1
      },
      "n8n-nodes-base.googleSheets": {
        "count": 1
      },
      "n8n-nodes-base.telegramTrigger": {
        "count": 1
      },
      "@n8n/n8n-nodes-langchain.openAi": {
        "count": 1
      }
    }
  },
  "nodes": [
    "OpenAI",
    "Telegram Trigger",
    "Telegram",
    "Sticky Note",
    "Google Sheets"
  ],
  "nodeTypes": [
    "n8n-nodes-base.telegramTrigger",
    "n8n-nodes-base.stickyNote",
    "@n8n/n8n-nodes-langchain.openAi",
    "n8n-nodes-base.telegram",
    "n8n-nodes-base.googleSheets"
  ]
}