Back to n8n Workflows

Realistic AI User Prompts

Mike Taylor Mike Taylor
Synthetic User Data

Generate authentic user search queries for any brand or industry using AI personas, then automatically analyze branded vs unbranded intent. Perfect for SEO keyword research and understanding real consumer search behavior.

Realistic AI User Prompts n8n workflow diagram

Click to expand

Overview

This workflow generates authentic, realistic user queries that people would actually type when searching for products or services in any industry. Using Rally's AI persona network, it simulates how ordinary consumers naturally ask questions about brands and products, then analyzes whether queries are branded or unbranded - perfect for keyword research, SEO strategy, and understanding real user search intent.

🎯 Pro Tips & Secret Sauce

The magic lies in authentic user behavior simulation combined with brand mention analysis:

  1. Real User Psychology - Rally personas don't just generate keywords; they simulate how actual consumers think and type when they need something, including typos, brevity, and natural language patterns
  2. Industry-Agnostic Framework - Works for any brand/industry combination by dynamically inserting context into persona prompts
  3. Branded vs Unbranded Intelligence - Automatically categorizes each query to reveal the crucial difference between brand-aware and generic searches
  4. Organized Data Collection - Creates dedicated spreadsheets per research session with execution ID tracking for easy analysis
  5. Scalable Research Process - Generates multiple diverse queries from different persona perspectives in a single workflow run

This creates invaluable market intelligence that reveals exactly how your target audience naturally searches for solutions, helping optimize SEO strategies and understand competitive positioning.

πŸ“ Step-by-Step Instructions

  1. Form Submission - User enters target brand name and industry category through web form interface
  2. Create Research Spreadsheet - Automatically generates new Google Sheet titled with brand, industry, and execution ID for organized data tracking
  3. Generate User Queries - Rally API receives industry context and instructs personas to simulate realistic consumer search behavior for that market
  4. Extract Response Data - Isolates the 'responses' array from Rally's API response containing all generated user queries
  5. Split Individual Queries - Converts the response array into separate items for individual analysis
  6. Brand Mention Analysis - Custom code checks each query to determine if it mentions the target brand (branded=1) or is generic (branded=0)
  7. Format Results - Structures data with persona ID, actual query text, and brand mention flag for analysis
  8. Log to Spreadsheet - Appends all processed queries with analysis to the dedicated research spreadsheet for review and insights

πŸ“‹ Requirements

Required Integrations

  • Rally API - AI persona simulation service for generating realistic user queries
  • Google Sheets - Data collection and analysis spreadsheet creation
  • Form Trigger - Web form interface for input collection

Required Credentials

  • Rally API Bearer token with persona access
  • Google Sheets OAuth2 credentials with spreadsheet creation permissions

Setup Prerequisites

  • Active Rally account with consumer persona audience (default: rd7a5b279a22647)
  • Google Drive access for spreadsheet creation
  • n8n instance with form trigger capability enabled

πŸš€ n8n Workflow Template

{
  "active": false,
  "connections": {
    "Code": {
      "main": [
        [
          {
            "index": 0,
            "node": "Edit Fields",
            "type": "main"
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "index": 0,
            "node": "Google Sheets2",
            "type": "main"
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "index": 0,
            "node": "Split Out",
            "type": "main"
          }
        ]
      ]
    },
    "Google Sheets1": {
      "main": [
        [
          {
            "index": 0,
            "node": "HTTP Request",
            "type": "main"
          }
        ]
      ]
    },
    "Google Sheets2": {
      "main": [
        []
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "index": 0,
            "node": "Edit Fields1",
            "type": "main"
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "index": 0,
            "node": "Google Sheets1",
            "type": "main"
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "index": 0,
            "node": "Code",
            "type": "main"
          }
        ]
      ]
    }
  },
  "id": "021k6kipldnDlb8k",
  "meta": {
    "instanceId": "7aa2e96d57ff40383569724f8ecb13d674a87bf09d39aa5d8fa5ba31f7a8407a"
  },
  "name": "Realistic AI user prompts",
  "nodes": [
    {
      "credentials": {
        "httpBearerAuth": {
          "id": "HeUQ9K9oUtQ5TyHr",
          "name": "Bearer Auth account"
        }
      },
      "id": "f47b51ea-02de-4a8c-bad2-2fa2d42ebf40",
      "name": "HTTP Request",
      "parameters": {
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "smart",
              "value": "false"
            },
            {
              "name": "provider",
              "value": "openai"
            },
            {
              "name": "query",
              "value": "=You are in the market for {{ $(\u0027On form submission\u0027).item.json.Industry }}, and are asking ChatGPT for advice on what to buy. Be sure to prompt as most ordinary people would prompt chatgpt. Be extremely brief. People don\u0027t put much effort into typing prompts. Some people might search for an alternative to a brand, others might search for the \u0027best\u0027 option (or a modifier on that word), others might mention one or two features they care about. Do whatever matches your persona. Start the message in a natural way. Respond only with the brief query"
            },
            {
              "name": "audience_id",
              "value": "rd7a5b279a22647"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "accept",
              "value": "application/json"
            }
          ]
        },
        "method": "POST",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "url": "https://backend-staging-858a.up.railway.app/api/v1/chat"
      },
      "position": [
        220,
        40
      ],
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2
    },
    {
      "id": "e04a70a7-1e8b-4683-87a8-5205334d5036",
      "name": "On form submission",
      "parameters": {
        "formDescription": "Simulate a bunch of user LLM queries for a company (e.g. what users ask about Nike)",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Brand",
              "placeholder": "Nike",
              "requiredField": true
            },
            {
              "fieldLabel": "Industry",
              "placeholder": "Shoes",
              "requiredField": true
            }
          ]
        },
        "formTitle": "AIO Scenario",
        "options": {}
      },
      "position": [
        -380,
        20
      ],
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "webhookId": "e719d793-fa9c-4bea-a88a-7d1501c169bb"
    },
    {
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "D3gzSdLQUA7CCmVX",
          "name": "Google Sheets account"
        }
      },
      "id": "3a26e8dd-ec5f-403e-99be-87e77c2fac29",
      "name": "Google Sheets1",
      "parameters": {
        "documentId": {
          "__rl": true,
          "cachedResultName": "AIO Keywords",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ODQnDhJACuPPLkfZEPOq0T4C0HSiY3EyTqFhdodqMKM/edit?usp=drivesdk",
          "mode": "list",
          "value": "1ODQnDhJACuPPLkfZEPOq0T4C0HSiY3EyTqFhdodqMKM"
        },
        "operation": "create",
        "options": {},
        "title": "={{ $(\u0027On form submission\u0027).item.json.Brand }} - {{ $(\u0027On form submission\u0027).item.json.Industry }} ({{ $execution.id }})"
      },
      "position": [
        -60,
        -20
      ],
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6
    },
    {
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "D3gzSdLQUA7CCmVX",
          "name": "Google Sheets account"
        }
      },
      "id": "efa2eb7d-ac44-4274-9e8f-2bf1621d5dc3",
      "name": "Google Sheets2",
      "parameters": {
        "columns": {
          "attemptToConvertTypes": false,
          "convertFieldsToString": false,
          "mappingMode": "autoMapInputData",
          "matchingColumns": [
            "responses"
          ],
          "schema": [
            {
              "canBeUsedToMatch": true,
              "defaultMatch": false,
              "display": true,
              "displayName": "persona_id",
              "id": "persona_id",
              "removed": false,
              "required": false,
              "type": "string"
            },
            {
              "canBeUsedToMatch": true,
              "defaultMatch": false,
              "display": true,
              "displayName": "response",
              "id": "response",
              "removed": false,
              "required": false,
              "type": "string"
            },
            {
              "canBeUsedToMatch": true,
              "defaultMatch": false,
              "display": true,
              "displayName": "branded",
              "id": "branded",
              "removed": false,
              "required": false,
              "type": "string"
            }
          ],
          "value": {}
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $(\u0027Google Sheets1\u0027).item.json.spreadsheetId }}"
        },
        "operation": "append",
        "options": {
          "useAppend": true
        },
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $(\u0027Google Sheets1\u0027).item.json.sheetId }}"
        }
      },
      "position": [
        1320,
        60
      ],
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6
    },
    {
      "id": "57d13ddc-d7b2-4983-91fb-18a97cd15edb",
      "name": "Edit Fields1",
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "03bd089b-de03-4931-8eea-c65d0ae575e8",
              "name": "responses",
              "type": "array",
              "value": "={{ $json.responses }}"
            }
          ]
        },
        "options": {}
      },
      "position": [
        440,
        40
      ],
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4
    },
    {
      "id": "e4fe2496-3951-4814-bca2-0a74119e4e51",
      "name": "Split Out",
      "parameters": {
        "fieldToSplitOut": "responses",
        "options": {}
      },
      "position": [
        660,
        60
      ],
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1
    },
    {
      "id": "86659d8c-d0a1-4770-b58d-05462784a884",
      "name": "Edit Fields",
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "72a85438-a2bb-46b5-aad8-a3498fec83ad",
              "name": "persona_id",
              "type": "string",
              "value": "={{ $json.persona_id }}"
            },
            {
              "id": "3cabb1ab-9a7c-4dd0-ac92-6b5434185418",
              "name": "response",
              "type": "string",
              "value": "={{ $json.response }}"
            },
            {
              "id": "f4627db5-4611-482e-bbf6-ee783e181b06",
              "name": "branded",
              "type": "number",
              "value": "={{ $json.branded }}"
            }
          ]
        },
        "options": {}
      },
      "position": [
        1100,
        60
      ],
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4
    },
    {
      "id": "148e6b22-103d-4c6c-9fc0-ee4f9ee36ce2",
      "name": "Code",
      "parameters": {
        "jsCode": "// Get the brand from form submission\nconst brand = $(\u0027On form submission\u0027).item.json.Brand;\n\n// Check if brand is in the current item (adjust the field name as needed)\n// This example checks if brand appears anywhere in the \u0027response\u0027 field\nconst itemText = $input.item.json.response || \u0027\u0027; // Change \u0027response\u0027 to your field name\n\n// Set branded to 1 if brand is found, 0 if not\nif (itemText.toLowerCase().includes(brand.toLowerCase())) {\n  $input.item.json.branded = 1;\n} else {\n  $input.item.json.branded = 0;\n}\n\nreturn $input.item;",
        "mode": "runOnceForEachItem"
      },
      "position": [
        880,
        60
      ],
      "type": "n8n-nodes-base.code",
      "typeVersion": 2
    }
  ],
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "tags": [],
  "versionId": "84f6c189-f61c-4d34-b8df-58bcb061ffe0"
}

About the Author

Mike Taylor

Mike Taylor

Mike Taylor is the CEO & Co-Founder of Rally. He previously co-founded a 50-person growth marketing agency called Ladder, created marketing & AI courses on LinkedIn, Vexpower, and Udemy taken by over 450,000 people, and published a book with O’Reilly on prompt engineering.