{
  "nodes": [
    {
      "id": "8f6d83d3-4eb2-4331-b1d7-54b083c91221",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -928,
        -80
      ],
      "parameters": {
        "color": 5,
        "width": 528,
        "height": 640,
        "content": "## Muhammad Farooq Iqbal - Automation Expert & n8n Creator\n\nI am a passionate automation expert and recognized n8n Creator specializing in intelligent workflow automation. With extensive experience in n8n, AI automation, Zapier, and Make.com, I have created innovative workflow templates with 500+ downloads across the global automation community\n\n### Expertise\n- **Workflow Automation**: n8n, Zapier, Make.com, AI automation\n- **AI Integration**: Gemini AI, API integration, data processing\n- **Platform Mastery**: Google Sheets, Google Drive, custom scripts\n\n## Need Help with This Workflow?\n\nIf you face any issues with this workflow or need customization support, feel free to reach out:\n\n**\ud83d\udce7 Email**: mfarooqiqbal143@gmail.com  \n**\ud83d\udcf1 Phone**: +923036991118  \n**\ud83d\udcbc LinkedIn**: [Connect with me](https://linkedin.com/in/muhammadfarooqiqbal)  \n**\ud83c\udf10 Portfolio**: [View my work](https://mfarooqone.github.io/n8n/)\n\n*I'm always excited to help with automation challenges and workflow optimization!*\n"
      },
      "typeVersion": 1
    },
    {
      "id": "acd11449-a6b1-4a76-b64a-714e752a805b",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        64,
        -80
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "bc74b0c2-aa46-4bcd-91f3-1eb6b0720167",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "pending"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "10b3f2ba-2376-4634-90ba-dbc1467c824e",
      "name": "Limit",
      "type": "n8n-nodes-base.limit",
      "position": [
        304,
        -96
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "264b14b6-1dc4-4ea1-a6e1-7e7b23c8df7b",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -304,
        96
      ],
      "parameters": {
        "text": "=You are an expert AI prompt writer specializing in creating vivid, photorealistic image generation prompts. You will be given a simple title and your task is to create a detailed, artistic prompt for an image of nail polish on a woman's hand based on that title.\n\nYour generated prompt should:\n1. Describe a specific nail color, shape, and finish (e.g., glossy, matte, chrome).\n2. Include details about a natural, realistic hand pose and its interaction with an object or environment.\n3. Specify the lighting conditions (e.g., golden hour, studio light, moody).\n4. Set a clear mood or atmosphere.\n5. Conclude with 'Aspect Ratio: 9:16'.\n\n\nImportant formatting requirements for your final output:\n- The entire response must be a single JSON object.\n- The JSON object must have a 'title' key (which should be the original input title you were given) and a 'post' key (which contains your detailed generated prompt).\n- Ensure the text in the JSON values is properly escaped.\n- Do not use double quotes ('') inside the JSON string values; use single quotes (') instead if needed.\n- Do not use asterisks.\n\n\nNow, create a detailed prompt based on the following title:\n{{ $json['Input Title'] }}\n\n\nRespond only with a JSON object in exactly this format:\n{\n\u00a0 \"title\": \"{{ $json.prompt }}\",\n\u00a0 \"post\": \"<your detailed and artistic nail polish prompt here>\"\n}",
        "options": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.8
    },
    {
      "id": "ba3e3f4a-f1c0-4ff7-8d0a-170d309b1cec",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        32,
        96
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\nconst updatedItems = items.map((item) => {\n  if (\n    item.json &&\n    item.json.output &&\n    typeof item.json.output.post === \"string\"\n  ) {\n    item.json.output.post = item.json.output.post.replace(/\\n/g, \"\\\\n\");\n  }\n  return item;\n});\nreturn updatedItems;"
      },
      "typeVersion": 2
    },
    {
      "id": "cbb6d317-fb74-4cf5-a362-5e88ab5e031e",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -176,
        272
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"title\": { \"type\": \"string\" },\n    \"post\":  { \"type\": \"string\" }\n  },\n  \"required\": [\"title\",\"post\"],\n  \"additionalProperties\": false\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "ee5c4ab4-0a9e-43e7-9e39-754b7ed63dcf",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -320,
        272
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "84fa3ea0-77c4-4a50-8392-cb221d35c413",
      "name": "Generate Image with Gemini",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        224,
        96
      ],
      "parameters": {
        "prompt": "=Create a high-quality, visually engaging image for a social media post based on the following text:\n\n\"{{ $json.output.post }}\"\n",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.0-flash-exp-image-generation",
          "cachedResultName": "models/gemini-2.0-flash-exp-image-generation"
        },
        "options": {},
        "resource": "image"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "619e2001-42b5-4e0c-8a07-8eec0a70525a",
      "name": "Upload file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        0,
        336
      ],
      "parameters": {
        "name": "=w_{{ $('Get row(s) in sheet').item.json.ID }}.{{$binary.data.fileExtension || 'png'}}\n",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive",
          "cachedResultName": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "16w6uMS_eMimiMCP1L2tQniPxhGwSeTcO",
          "cachedResultUrl": "https://drive.google.com/drive/folders/16w6uMS_eMimiMCP1L2tQniPxhGwSeTcO",
          "cachedResultName": "wallpaper images"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "98373a36-1e6d-4945-be5a-8ccdf467a181",
      "name": "Share file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        144,
        336
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "share",
        "permissionsUi": {
          "permissionsValues": {
            "role": "reader",
            "type": "anyone"
          }
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "8c8e6c8e-6450-41bb-8e58-1a7085ae7279",
      "name": "update imageUrl",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        288,
        336
      ],
      "parameters": {
        "columns": {
          "value": {
            "ID": "={{ $('If').item.json.ID }}",
            "status": "posted",
            "imageUrl": "={{$node[\"Upload file\"].json.webViewLink}}"
          },
          "schema": [
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "prompt",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "prompt",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "imageUrl",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "imageUrl",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "ID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.YOUR_AWS_SECRET_KEY_HERE_YHI1PFFghFj9R4kBfJNh9g/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1UK0t4Fi55oSpdR3DzeGT_YHI1PFFghFj9R4kBfJNh9g",
          "cachedResultUrl": "https://docs.google.YOUR_AWS_SECRET_KEY_HERE_YHI1PFFghFj9R4kBfJNh9g/edit?usp=drivesdk",
          "cachedResultName": "n8n wallpaper"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "1da85416-4304-42c5-adf4-7ae2fee12516",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -336,
        -80
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 1
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "467096a8-0e30-4502-b290-45c7bd99d22c",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -144,
        -80
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.YOUR_AWS_SECRET_KEY_HERE_YHI1PFFghFj9R4kBfJNh9g/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1UK0t4Fi55oSpdR3DzeGT_YHI1PFFghFj9R4kBfJNh9g",
          "cachedResultUrl": "https://docs.google.YOUR_AWS_SECRET_KEY_HERE_YHI1PFFghFj9R4kBfJNh9g/edit?usp=drivesdk",
          "cachedResultName": "n8n wallpaper"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Generate Image with Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Share file": {
      "main": [
        [
          {
            "node": "update imageUrl",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file": {
      "main": [
        [
          {
            "node": "Share file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Generate Image with Gemini": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}