{
  "id": 7307,
  "name": "Generate and quality control images with DALL-E 2 and human review loop",
  "description": "This n8n workflow automates the process of generating AI images using OpenAI's DALL-E 2 model with built-in human review and quality control. The workflow creates an image based on a predefined prompt, sends it for human review, and if the image is rejected, automatically generates a new version with an improved prompt. This is perfect for content creators, marketers, or anyone who needs high-quality AI-generated images with human oversight to ensure they meet specific standards.\n\n### Key Features:\n- Automated image generation using DALL-E 2\n- Human-in-the-loop review process\n- Automatic regeneration if images are rejected\n- Customizable prompts and review criteria\n- Quality assurance workflow\n\n## Step-by-Step Implementation Guide\n\n### Prerequisites\nBefore setting up this workflow, you'll need:\n\n1. **n8n instance** (cloud or self-hosted)\n2. **OpenAI API account** with DALL-E access\n3. **GotoHuman account** for review management\n\n### Step 1: Set Up OpenAI API Credentials\n\n1. Go to [OpenAI's website](https://platform.openai.com/api-keys)\n2. Create an account or sign in\n3. Navigate to \"API Keys\" in your dashboard\n4. Click \"Create new secret key\"\n5. Copy the API key and save it securely\n6. In n8n, go to **Credentials** \u2192 **Add Credential** \u2192 **OpenAI API**\n7. Paste your API key and save as \"OpenAI account\"\n\n### Step 2: Set Up GotoHuman Credentials\n\n1. Visit [GotoHuman](https://gotohuman.com/) and create an account\n2. Navigate to your API settings/dashboard\n3. Generate an API key\n4. In n8n, go to **Credentials** \u2192 **Add Credential** \u2192 **GotoHuman API**\n5. Enter your API credentials and save as \"gotoHuman account\"\n\n### Step 3: Configure the Review Template\n\n1. In your GotoHuman dashboard, create a new review template with ID: `3473LaRDbdf03sd6uzYG`\n2. Set up the template with:\n   - **Image field**: For displaying the generated image\n   - **Prompt field**: For showing the original prompt\n   - **Review options**: Approve/Reject buttons\n3. Configure reviewers and notification settings\n\n### Step 4: Import and Configure the Workflow\n\n1. Copy the provided workflow JSON\n2. In n8n, click **Import from File** or **Import from Clipboard**\n3. Paste the workflow JSON\n4. The workflow will automatically create the following nodes:\n\n#### Node Configuration Details:\n\n##### Start Workflow (Manual Trigger)\n- No configuration needed\n- Used to manually start the workflow\n\n##### Set Image Prompt\n- **Prompt**: \"Make an image of an attractive person standing in new york city\"\n- **Name**: \"woman-nyc\"\n- *Customize these values for your specific use case*\n\n##### Loop Over Items1 (Split in Batches)\n- Processes items in batches\n- No additional configuration needed\n\n##### Initial Image Generation (OpenAI)\n- **Resource**: Image\n- **Model**: DALL-E 2\n- **Prompt**: Uses the prompt from \"Set Image Prompt\"\n- **Credentials**: Select your \"OpenAI account\"\n\n##### Initial Review (GotoHuman)\n- **Review Template ID**: 3473LaRDbdf03sd6uzYG\n- **Fields**: Maps image URL and prompt to review form\n- **Credentials**: Select your \"gotoHuman account\"\n\n##### If Rejected (Conditional Logic)\n- Checks if review response equals \"rejected\"\n- Routes to regeneration if rejected\n\n##### Second Image Generation (OpenAI)\n- Same configuration as initial generation\n- Uses updated prompt from review feedback\n\n##### Second Review (GotoHuman)\n- Same configuration as initial review\n- Final quality check\n\n### Step 5: Customize for Your Use Case\n\n1. **Update Image Prompts**: Modify the \"Set Image Prompt\" node with your specific requirements\n2. **Adjust Review Criteria**: Update your GotoHuman template with specific quality guidelines\n3. **Configure Notifications**: Set up email or Slack notifications in GotoHuman for reviewers\n\n### Step 6: Test the Workflow\n\n1. Click **Execute Workflow** on the manual trigger\n2. Monitor the execution flow\n3. Check that images are generated and sent for review\n4. Verify the conditional logic works when images are rejected\n5. Confirm final approved images are properly handled\n\n### Step 7: Production Deployment\n\n1. Set up proper error handling and logging\n2. Configure webhooks if you need external triggers\n3. Set up monitoring and alerts for failed executions\n4. Document your specific prompt guidelines for reviewers\n\n## Workflow Flow Summary\n\n1. **Start** \u2192 Manual trigger initiates the workflow\n2. **Set Prompt** \u2192 Define the image generation parameters\n3. **Generate Image** \u2192 DALL-E 2 creates the initial image\n4. **Human Review** \u2192 GotoHuman presents image for approval\n5. **Quality Check** \u2192 If rejected, generate new image with improved prompt\n6. **Final Review** \u2192 Second human review ensures quality standards\n7. **Complete** \u2192 Approved images are ready for use\n\n## Troubleshooting Tips\n\n- **API Rate Limits**: Ensure your OpenAI account has sufficient credits\n- **Review Template Issues**: Verify the template ID matches exactly\n- **Image URLs**: Check that image URLs are accessible for review\n- **Webhook Failures**: Ensure GotoHuman webhooks are properly configured\n\n---\n\n## Contact Information\n\n**Robert A Ynteractive**\n\nFor support, customization, or questions about this workflow:\n\n- \ud83d\udce7 Email: rbreen@ynteractive.com\n- \ud83c\udf10 Website: https://ynteractive.com/\n- \ud83d\udcbc LinkedIn: https://www.linkedin.com/in/robert-breen-29429625/\n\n*Need help implementing this workflow or want custom automation solutions? Get in touch for professional n8n consulting and workflow development services.*",
  "categories": [
    {
      "id": 31,
      "name": "Content Creation"
    },
    {
      "id": 51,
      "name": "Multimodal AI"
    }
  ],
  "totalViews": 822,
  "createdAt": "2025-08-12T20:57:10.600Z",
  "workflow": {
    "meta": {
      "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
      "templateCredsSetupCompleted": true
    },
    "nodes": [
      {
        "id": "7b815687-00ea-4dc8-a97c-503ba6e90361",
        "name": "Start Workflow",
        "type": "n8n-nodes-base.manualTrigger",
        "position": [
          240,
          4016
        ],
        "parameters": {},
        "typeVersion": 1
      },
      {
        "id": "27c7bcf8-92f6-4e9e-8341-392b41e45728",
        "name": "Set Image Prompt",
        "type": "n8n-nodes-base.set",
        "position": [
          416,
          4016
        ],
        "parameters": {
          "options": {},
          "assignments": {
            "assignments": [
              {
                "id": "5f36bc2b-9acb-4159-b9c3-98a6f9650787",
                "name": "Prompt",
                "type": "string",
                "value": "Make an image of an attractive person standing in new york city"
              },
              {
                "id": "e5823995-d822-4f59-b580-c9efaabc465c",
                "name": "Name",
                "type": "string",
                "value": "woman-nyc"
              }
            ]
          }
        },
        "typeVersion": 3.4
      },
      {
        "id": "dca87162-622b-4c42-8642-d60501673a79",
        "name": "Sticky Note2",
        "type": "n8n-nodes-base.stickyNote",
        "position": [
          -208,
          3088
        ],
        "parameters": {
          "width": 1600,
          "height": 100,
          "content": "**Need more help?**  \nWebsite: https://ynteractive.com  \nEmail: robert@ynteractive.com"
        },
        "typeVersion": 1
      },
      {
        "id": "899e1ec5-b857-4863-a8d5-a07b8065df8d",
        "name": "Loop Over Items1",
        "type": "n8n-nodes-base.splitInBatches",
        "position": [
          496,
          4256
        ],
        "parameters": {
          "options": {
            "reset": false
          }
        },
        "typeVersion": 3
      },
      {
        "id": "27472c1e-6c24-491a-b759-c6d544fbdd6c",
        "name": "Sticky Note3",
        "type": "n8n-nodes-base.stickyNote",
        "position": [
          -208,
          3232
        ],
        "parameters": {
          "color": 3,
          "width": 1072,
          "height": 1480,
          "content": "## Step-by-Step Implementation Guide\n\n### Prerequisites\nBefore setting up this workflow, you'll need:\n\n1. **n8n instance** (cloud or self-hosted)\n2. **OpenAI API account** with DALL-E access\n3. **GotoHuman account** for review management\n\n### Step 1: Set Up OpenAI API Credentials\n\n1. Go to [OpenAI's website](https://platform.openai.com/api-keys)\n2. Create an account or sign in\n3. Navigate to \"API Keys\" in your dashboard\n4. Click \"Create new secret key\"\n5. Copy the API key and save it securely\n6. In n8n, go to **Credentials** \u2192 **Add Credential** \u2192 **OpenAI API**\n7. Paste your API key and save as \"OpenAI account\"\n\n### Step 2: Set Up GotoHuman Credentials\n\n1. Visit [GotoHuman](https://gotohuman.com/) and create an account\n2. Navigate to your API settings/dashboard\n3. Generate an API key\n4. In n8n, go to **Credentials** \u2192 **Add Credential** \u2192 **GotoHuman API**\n5. Enter your API credentials and save as \"gotoHuman account\"\n\n### Step 3: Configure the Review Template\n\n1. In your GotoHuman dashboard, create a new review template with ID: `3473LaRDbdf03sd6uzYG`\n2. Set up the template with:\n   - **Image field**: For displaying the generated image\n   - **Prompt field**: For showing the original prompt\n   - **Review options**: Approve/Reject buttons\n3. Configure reviewers and notification settings\n\n### Step 4: Import and Configure the Workflow\n\n1. Copy the provided workflow JSON\n2. In n8n, click **Import from File** or **Import from Clipboard**\n3. Paste the workflow JSON\n4. The workflow will automatically create the following nodes:\n\n#### Node Configuration Details:\n\n##### Start Workflow (Manual Trigger)\n- No configuration needed\n- Used to manually start the workflow\n\n##### Set Image Prompt\n- **Prompt**: \"Make an image of an attractive person standing in new york city\"\n- **Name**: \"woman-nyc\"\n- *Customize these values for your specific use case*\n\n"
        },
        "typeVersion": 1
      },
      {
        "id": "dd0abc01-e2a4-4892-9b76-547b0573d6c8",
        "name": "Initial Review",
        "type": "@gotohuman/n8n-nodes-gotohuman.gotoHuman",
        "position": [
          704,
          4576
        ],
        "webhookId": "915e31f2-6f70-4e73-af20-2b3423a772c6",
        "parameters": {
          "fields": {
            "value": {
              "Image": "={{\n  JSON.stringify([\n    {\n      url: $json.url,\n      label: 'Generated Image'\n    }\n  ])\n}}\n",
              "Prompt": "={{ $('Set Image Prompt').item.json.Prompt }}"
            },
            "schema": [
              {
                "id": "Image",
                "type": "array",
                "display": true,
                "required": false,
                "displayName": "Image (imageGrid)",
                "defaultMatch": false,
                "canBeUsedToMatch": true
              },
              {
                "id": "Prompt",
                "type": "string",
                "display": true,
                "required": false,
                "displayName": "Prompt (text)",
                "defaultMatch": false,
                "canBeUsedToMatch": true
              }
            ],
            "mappingMode": "defineBelow",
            "matchingColumns": [],
            "attemptToConvertTypes": false,
            "convertFieldsToString": false
          },
          "additionalFields": {},
          "reviewTemplateID": {
            "__rl": true,
            "mode": "list",
            "value": "3473LaRDbdf03sd6uzYG",
            "cachedResultName": "Image Review (3473LaRDbdf03sd6uzYG)"
          }
        },
        "credentials": {
          "gotoHumanApi": {
            "id": "credential-id",
            "name": "gotoHumanApi Credential"
          }
        },
        "typeVersion": 1
      },
      {
        "id": "520b4b3c-0ddc-4349-8af9-66103ace3701",
        "name": "Initial Image Generation",
        "type": "@n8n/n8n-nodes-langchain.openAi",
        "position": [
          624,
          4384
        ],
        "parameters": {
          "model": "dall-e-2",
          "prompt": "={{ $json.Prompt }}",
          "options": {
            "returnImageUrls": true
          },
          "resource": "image"
        },
        "credentials": {
          "openAiApi": {
            "id": "credential-id",
            "name": "openAiApi Credential"
          }
        },
        "typeVersion": 1.8
      },
      {
        "id": "8ef0f626-05d2-4867-be56-b3b2ea045b01",
        "name": "Second Image Generation",
        "type": "@n8n/n8n-nodes-langchain.openAi",
        "position": [
          1056,
          4464
        ],
        "parameters": {
          "model": "dall-e-2",
          "prompt": "={{ $('Initial Review').item.json.responseValues.Prompt.value }}",
          "options": {
            "returnImageUrls": true
          },
          "resource": "image"
        },
        "credentials": {
          "openAiApi": {
            "id": "credential-id",
            "name": "openAiApi Credential"
          }
        },
        "typeVersion": 1.8
      },
      {
        "id": "2761ec7f-7eea-455a-9fdb-edc36028a9d8",
        "name": "Second Review",
        "type": "@gotohuman/n8n-nodes-gotohuman.gotoHuman",
        "position": [
          1248,
          4480
        ],
        "webhookId": "915e31f2-6f70-4e73-af20-2b3423a772c6",
        "parameters": {
          "fields": {
            "value": {
              "Image": "={{\n  JSON.stringify([\n    {\n      url: $json.url,\n      label: 'Generated Image'\n    }\n  ])\n}}\n",
              "Prompt": "={{ $('Set Image Prompt').item.json.Prompt }}"
            },
            "schema": [
              {
                "id": "Image",
                "type": "array",
                "display": true,
                "required": false,
                "displayName": "Image (imageGrid)",
                "defaultMatch": false,
                "canBeUsedToMatch": true
              },
              {
                "id": "Prompt",
                "type": "string",
                "display": true,
                "required": false,
                "displayName": "Prompt (text)",
                "defaultMatch": false,
                "canBeUsedToMatch": true
              }
            ],
            "mappingMode": "defineBelow",
            "matchingColumns": [],
            "attemptToConvertTypes": false,
            "convertFieldsToString": false
          },
          "additionalFields": {},
          "reviewTemplateID": {
            "__rl": true,
            "mode": "list",
            "value": "3473LaRDbdf03sd6uzYG",
            "cachedResultName": "Image Review (3473LaRDbdf03sd6uzYG)"
          }
        },
        "credentials": {
          "gotoHumanApi": {
            "id": "credential-id",
            "name": "gotoHumanApi Credential"
          }
        },
        "typeVersion": 1
      },
      {
        "id": "f2860033-4ce8-4ca2-8a96-b2040ad0ed3d",
        "name": "If rejected",
        "type": "n8n-nodes-base.if",
        "position": [
          928,
          4240
        ],
        "parameters": {
          "options": {},
          "conditions": {
            "options": {
              "version": 2,
              "leftValue": "",
              "caseSensitive": true,
              "typeValidation": "strict"
            },
            "combinator": "and",
            "conditions": [
              {
                "id": "159a5db4-20d3-4c84-86bb-a405de6d9ab4",
                "operator": {
                  "name": "filter.operator.equals",
                  "type": "string",
                  "operation": "equals"
                },
                "leftValue": "={{ $json.response }}",
                "rightValue": "rejected"
              }
            ]
          }
        },
        "typeVersion": 2.2
      },
      {
        "id": "2220b8db-85df-4ec4-a1e5-50d9e20ca25b",
        "name": "Sticky Note4",
        "type": "n8n-nodes-base.stickyNote",
        "position": [
          896,
          3232
        ],
        "parameters": {
          "color": 5,
          "width": 496,
          "height": 1480,
          "content": "##### Loop Over Items1 (Split in Batches)\n- Processes items in batches\n- No additional configuration needed\n\n##### Initial Image Generation (OpenAI)\n- **Resource**: Image\n- **Model**: DALL-E 2\n- **Prompt**: Uses the prompt from \"Set Image Prompt\"\n- **Credentials**: Select your \"OpenAI account\"\n\n##### Initial Review (GotoHuman)\n- **Review Template ID**: 3473LaRDbdf03sd6uzYG\n- **Fields**: Maps image URL and prompt to review form\n- **Credentials**: Select your \"gotoHuman account\"\n\n##### If Rejected (Conditional Logic)\n- Checks if review response equals \"rejected\"\n- Routes to regeneration if rejected\n\n##### Second Image Generation (OpenAI)\n- Same configuration as initial generation\n- Uses updated prompt from review feedback\n\n##### Second Review (GotoHuman)\n- Same configuration as initial review\n- Final quality check\n\n### Step 5: Customize for Your Use Case\n\n1. **Update Image Prompts**: Modify the \"Set Image Prompt\" node with your specific requirements\n2. **Adjust Review Criteria**: Update your GotoHuman template with specific quality guidelines\n3. **Configure Notifications**: Set up email or Slack notifications in GotoHuman for reviewers\n\n### Step 6: Test the Workflow\n\n1. Click **Execute Workflow** on the manual trigger\n2. Monitor the execution flow\n3. Check that images are generated and sent for review\n4. Verify the conditional logic works when images are rejected\n5. Confirm final approved images are properly handled\n"
        },
        "typeVersion": 1
      }
    ],
    "pinData": {},
    "connections": {
      "If rejected": {
        "main": [
          [],
          [
            {
              "node": "Second Image Generation",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Initial Review": {
        "main": [
          [
            {
              "node": "If rejected",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Start Workflow": {
        "main": [
          [
            {
              "node": "Set Image Prompt",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Loop Over Items1": {
        "main": [
          [],
          [
            {
              "node": "Initial Image Generation",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Set Image Prompt": {
        "main": [
          [
            {
              "node": "Loop Over Items1",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Second Image Generation": {
        "main": [
          [
            {
              "node": "Second Review",
              "type": "main",
              "index": 0
            }
          ]
        ]
      },
      "Initial Image Generation": {
        "main": [
          [
            {
              "node": "Initial Review",
              "type": "main",
              "index": 0
            }
          ]
        ]
      }
    }
  },
  "workflowInfo": {
    "nodeCount": 11,
    "nodeTypes": {
      "n8n-nodes-base.if": {
        "count": 1
      },
      "n8n-nodes-base.set": {
        "count": 1
      },
      "n8n-nodes-base.stickyNote": {
        "count": 3
      },
      "n8n-nodes-base.manualTrigger": {
        "count": 1
      },
      "n8n-nodes-base.splitInBatches": {
        "count": 1
      },
      "@n8n/n8n-nodes-langchain.openAi": {
        "count": 2
      },
      "@gotohuman/n8n-nodes-gotohuman.gotoHuman": {
        "count": 2
      }
    }
  },
  "nodes": [
    "Start Workflow",
    "Set Image Prompt",
    "Sticky Note2",
    "Loop Over Items1",
    "Sticky Note3",
    "Initial Review",
    "Initial Image Generation",
    "Second Image Generation",
    "Second Review",
    "If rejected",
    "Sticky Note4"
  ],
  "nodeTypes": [
    "n8n-nodes-base.splitInBatches",
    "n8n-nodes-base.stickyNote",
    "@n8n/n8n-nodes-langchain.openAi",
    "n8n-nodes-base.manualTrigger",
    "n8n-nodes-base.if",
    "@gotohuman/n8n-nodes-gotohuman.gotoHuman",
    "n8n-nodes-base.set"
  ]
}