{
  "id": "HXf2YHVaomo4WxAB",
  "name": "AI agent for player segmentation with behavioral prediction & reward",
  "tags": [],
  "nodes": [
    {
      "id": "34f5ed60-bc8b-4a4d-8b49-52b9e63c7360",
      "name": "Gameplay Logs Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        224,
        192
      ],
      "parameters": {
        "path": "gameplay-analytics",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2.1
    },
    {
      "id": "4462e215-968f-4592-b407-af582ba8eecd",
      "name": "Player Segmentation Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        736,
        192
      ],
      "parameters": {
        "text": "={{ $json.body }}",
        "options": {
          "systemMessage": "You are a Player Segmentation Agent specializing in clustering gameplay logs into behavioral archetypes. Analyze player behavior patterns including session frequency, engagement duration, in-game actions, progression velocity, social interactions, and monetization patterns. Use embedding similarity and engagement metrics to identify distinct player segments such as casual players, hardcore gamers, social players, whales, at-risk players, and power users. Provide detailed segment characteristics, size estimates, and key behavioral markers for each archetype."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "73a491ca-c48f-4800-a305-84a7d65d4ace",
      "name": "Segmentation Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        416,
        528
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.2
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "118c359a-7f43-4384-a083-8d0faba86de1",
      "name": "Segmentation Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2400,
        544
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"segments\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"segment_name\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"segment_size\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t},\n\t\t\t\t\t\"behavioral_characteristics\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"engagement_score\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t},\n\t\t\t\t\t\"churn_risk_level\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"key_metrics\": {\n\t\t\t\t\t\t\"type\": \"object\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"analysis_timestamp\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"total_players_analyzed\": {\n\t\t\t\"type\": \"number\"\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "b60d30e4-c09b-44ea-8759-5b7fbac20c30",
      "name": "Player Behavior Embeddings",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        688,
        736
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5b2646b9-fccd-4c37-8baf-5772098e9c52",
      "name": "Player Behavior Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        608,
        528
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "memoryKey": {
          "__rl": true,
          "mode": "id",
          "value": "player_behavior_search"
        },
        "toolDescription": "Search for similar player behavior patterns and profiles based on gameplay characteristics, engagement metrics, and behavioral features. Use this to find comparable players when clustering into archetypes."
      },
      "typeVersion": 1.3
    },
    {
      "id": "7844c123-a6f1-4ccb-bf38-0cc1f7ce9e58",
      "name": "Metrics Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        880,
        576
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "510021be-4863-46ef-bb71-0c3be20c45c6",
      "name": "Statistical Analysis Tool",
      "type": "@n8n/n8n-nodes-langchain.toolCode",
      "position": [
        1024,
        528
      ],
      "parameters": {
        "jsCode": "// Statistical Analysis Tool for Gaming Analytics\n// Input: query should be a JSON string with { metric_type, data }\n\nconst input = JSON.parse(query);\nconst { metric_type, data } = input;\n\nlet result = {};\n\nswitch(metric_type) {\n  case 'engagement_score':\n    // Weighted engagement scoring\n    // Expects data: { session_frequency, avg_duration, actions_per_session }\n    const sessionWeight = 0.3;\n    const durationWeight = 0.4;\n    const actionsWeight = 0.3;\n    \n    const normalizedFrequency = Math.min(data.session_frequency / 30, 1); // Normalize to daily sessions\n    const normalizedDuration = Math.min(data.avg_duration / 120, 1); // Normalize to 2 hours\n    const normalizedActions = Math.min(data.actions_per_session / 100, 1); // Normalize to 100 actions\n    \n    result.engagement_score = (\n      normalizedFrequency * sessionWeight +\n      normalizedDuration * durationWeight +\n      normalizedActions * actionsWeight\n    ) * 100;\n    break;\n    \n  case 'cohort_retention':\n    // Cohort retention calculation\n    // Expects data: { cohort_size, returning_players, days }\n    result.retention_rate = (data.returning_players / data.cohort_size) * 100;\n    result.churn_rate = 100 - result.retention_rate;\n    result.days = data.days;\n    break;\n    \n  case 'percentile_ranking':\n    // Percentile ranking for player metrics\n    // Expects data: { values: [], target_value }\n    const sorted = data.values.sort((a, b) => a - b);\n    const rank = sorted.filter(v => v <= data.target_value).length;\n    result.percentile = (rank / sorted.length) * 100;\n    break;\n    \n  case 'correlation_analysis':\n    // Pearson correlation between two metrics\n    // Expects data: { x: [], y: [] }\n    const n = data.x.length;\n    const sumX = data.x.reduce((a, b) => a + b, 0);\n    const sumY = data.y.reduce((a, b) => a + b, 0);\n    const sumXY = data.x.reduce((sum, x, i) => sum + x * data.y[i], 0);\n    const sumX2 = data.x.reduce((sum, x) => sum + x * x, 0);\n    const sumY2 = data.y.reduce((sum, y) => sum + y * y, 0);\n    \n    const numerator = n * sumXY - sumX * sumY;\n    const denominator = Math.sqrt((n * sumX2 - sumX * sumX) * (n * sumY2 - sumY * sumY));\n    result.correlation = numerator / denominator;\n    break;\n    \n  default:\n    result.error = 'Unknown metric_type. Supported types: engagement_score, cohort_retention, percentile_ranking, correlation_analysis';\n}\n\nreturn JSON.stringify(result);",
        "description": "Perform statistical calculations including engagement score computation, cohort analysis, retention rate calculations, and behavioral metric aggregations. Input should be a JSON object with metric_type and data fields."
      },
      "typeVersion": 1.3
    },
    {
      "id": "77c052b1-2866-451b-bbfe-e2fba14a5e85",
      "name": "Behavioral Prediction Agent",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        1152,
        528
      ],
      "parameters": {
        "text": "={{ $fromAI('segment_data', 'Player segment data and behavioral metrics to analyze for churn prediction') }}",
        "options": {
          "systemMessage": "You are a Behavioral Prediction Agent specializing in churn prediction and causal inference modeling. Analyze player segments and behavioral data to: 1) Calculate churn probability scores for each segment using engagement decay patterns, session frequency trends, and behavioral signals. 2) Apply causal inference techniques to estimate retention uplift from interventions. 3) Identify leading indicators of churn and protective factors. 4) Quantify the expected impact of retention strategies with confidence intervals. Provide probabilistic predictions with supporting evidence."
        },
        "hasOutputParser": true,
        "toolDescription": "Predicts player churn probability and estimates retention uplift through causal inference modeling. Analyzes player segments and behavioral patterns to forecast at-risk players and quantify the impact of retention interventions."
      },
      "typeVersion": 3
    },
    {
      "id": "2cf07839-4ed0-4334-a42d-0e02ccc62b69",
      "name": "Prediction Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1024,
        736
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.2
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "ee0c57f8-082f-42db-9c5e-e6416aae377a",
      "name": "Prediction Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1248,
        736
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"segment_predictions\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"segment_name\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"churn_probability\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t},\n\t\t\t\t\t\"confidence_interval\": {\n\t\t\t\t\t\t\"type\": \"object\"\n\t\t\t\t\t},\n\t\t\t\t\t\"risk_factors\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"protective_factors\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"retention_uplift_estimates\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"intervention_type\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"estimated_uplift_percentage\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t},\n\t\t\t\t\t\"confidence_level\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"causal_insights\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "a8a10b94-5274-44b0-a9bd-e4c9511d2be4",
      "name": "Reward Redesign Simulation Agent",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        1440,
        528
      ],
      "parameters": {
        "text": "={{ $fromAI('reward_proposal', 'Reward system redesign proposal to simulate and analyze') }}",
        "options": {
          "systemMessage": "You are a Reward Redesign Simulation Agent. Analyze proposed reward system changes and simulate their impact on player engagement and retention. Consider: 1) Reward frequency and magnitude effects on different player segments. 2) Psychological impact of reward timing and presentation. 3) Engagement lift from achievement unlocks and progression milestones. 4) Potential negative effects like reward fatigue or devaluation. 5) Cross-segment impact variations. Provide quantified projections with segment-specific breakdowns."
        },
        "hasOutputParser": true,
        "toolDescription": "Simulates the effect of reward system redesign on player engagement and retention. Models how changes to daily rewards, achievement systems, progression incentives, and loyalty programs impact player behavior across different segments."
      },
      "typeVersion": 3
    },
    {
      "id": "98d8081f-175b-482a-bb79-05a815b543f9",
      "name": "Reward Simulation Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1424,
        736
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.2
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "b12d778e-1018-4178-995c-291a7271edad",
      "name": "Reward Simulation Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1584,
        736
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"simulation_results\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"segment_name\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"engagement_lift_percentage\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t},\n\t\t\t\t\t\"retention_impact_percentage\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t},\n\t\t\t\t\t\"participation_rate_change\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"reward_effectiveness_score\": {\n\t\t\t\"type\": \"number\"\n\t\t},\n\t\t\"potential_risks\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t},\n\t\t\"implementation_recommendations\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "f4251dc8-eb5d-423b-afe9-5ecddac4a774",
      "name": "Pricing Adjustment Simulation Agent",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        1728,
        528
      ],
      "parameters": {
        "text": "={{ $fromAI('pricing_proposal', 'Pricing adjustment proposal to simulate and analyze') }}",
        "options": {
          "systemMessage": "You are a Pricing Adjustment Simulation Agent. Analyze proposed pricing changes and model their impact on key metrics. Consider: 1) Price elasticity by player segment and product type. 2) Conversion rate impact from price increases/decreases. 3) Lifetime value changes accounting for retention effects. 4) Competitive positioning and perceived value. 5) Revenue optimization vs. player satisfaction trade-offs. 6) Segment-specific responses to pricing tiers. Provide quantified projections with revenue impact, conversion changes, and retention effects."
        },
        "hasOutputParser": true,
        "toolDescription": "Simulates the impact of pricing adjustments on player conversion, retention, and lifetime value. Models price elasticity, segment-specific willingness to pay, and revenue optimization scenarios."
      },
      "typeVersion": 3
    },
    {
      "id": "2bc32b93-0810-4041-9c5a-6a09dfcc6d73",
      "name": "Pricing Simulation Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1728,
        736
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.2
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "a2ec3179-7020-4cf9-84ba-78a5305a83ea",
      "name": "Pricing Simulation Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1888,
        736
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"pricing_scenarios\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"scenario_name\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"price_change_percentage\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t},\n\t\t\t\t\t\"conversion_impact_percentage\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t},\n\t\t\t\t\t\"retention_impact_percentage\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t},\n\t\t\t\t\t\"revenue_impact_percentage\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t},\n\t\t\t\t\t\"ltv_change\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"segment_responses\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"segment_name\": {\n\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t},\n\t\t\t\t\t\"price_sensitivity\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t},\n\t\t\t\t\t\"expected_churn_rate\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"optimization_recommendation\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "90e0a40a-f2fe-4013-bd91-6b346b0e9f6f",
      "name": "A/B Testing Roadmap Agent",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        2112,
        544
      ],
      "parameters": {
        "text": "={{ $fromAI('analysis_results', 'Segmentation, prediction, and simulation results to base testing roadmap on') }}",
        "options": {
          "systemMessage": "You are an A/B Testing Roadmap Agent. Create data-driven testing strategies based on player segmentation, churn predictions, and simulation insights. For each proposed test: 1) Define clear hypothesis and success metrics. 2) Specify target segments and sample size requirements. 3) Project quantified impact ranges with confidence levels. 4) Estimate test duration and statistical power. 5) Identify potential confounding factors and mitigation strategies. 6) Prioritize tests by expected impact, feasibility, and learning value. Provide a phased roadmap with dependencies and resource requirements."
        },
        "hasOutputParser": true,
        "toolDescription": "Generates comprehensive A/B testing roadmaps with quantified impact projections based on segmentation insights, churn predictions, and simulation results. Prioritizes tests by expected impact and statistical feasibility."
      },
      "typeVersion": 3
    },
    {
      "id": "8afff0e9-b8df-441e-9248-70d23e80911c",
      "name": "Testing Roadmap Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2128,
        752
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "gpt-4o"
        },
        "options": {
          "temperature": 0.3
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "582af83b-9de0-486a-8c4d-701728f19830",
      "name": "Testing Roadmap Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2320,
        752
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"testing_phases\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"object\",\n\t\t\t\t\"properties\": {\n\t\t\t\t\t\"phase_number\": {\n\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t},\n\t\t\t\t\t\"tests\": {\n\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\t\"test_name\": {\n\t\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"hypothesis\": {\n\t\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"target_segments\": {\n\t\t\t\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"success_metrics\": {\n\t\t\t\t\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\t\t\t\t\"type\": \"string\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"sample_size_required\": {\n\t\t\t\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"duration_days\": {\n\t\t\t\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"projected_impact_range\": {\n\t\t\t\t\t\t\t\t\t\"type\": \"object\"\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"priority_score\": {\n\t\t\t\t\t\t\t\t\t\"type\": \"number\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"dependencies\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t},\n\t\t\"resource_requirements\": {\n\t\t\t\"type\": \"object\"\n\t\t},\n\t\t\"timeline_summary\": {\n\t\t\t\"type\": \"object\"\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "a9253a2b-4073-41f8-8e12-93af20cb3807",
      "name": "Prepare Analytics Results",
      "type": "n8n-nodes-base.set",
      "position": [
        2624,
        320
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "analysis_timestamp",
              "type": "string",
              "value": "={{ $now.toISO() }}"
            },
            {
              "id": "id-2",
              "name": "segmentation_results",
              "type": "object",
              "value": "={{ JSON.stringify($json.output) }}"
            },
            {
              "id": "id-3",
              "name": "workflow_execution_id",
              "type": "string",
              "value": "={{ $execution.id }}"
            },
            {
              "id": "id-4",
              "name": "player_count",
              "type": "string",
              "value": "={{ $json.body.players ? $json.body.players.length : 'N/A' }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c0468958-8ebd-4450-a092-9031fbf93d30",
      "name": "Store Analytics Results",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2832,
        320
      ],
      "parameters": {
        "columns": {
          "value": null,
          "mappingMode": "autoMapInputData"
        },
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "<__PLACEHOLDER_VALUE__analytics_results_table__>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "d877a3ca-70fe-4331-a1a7-7a5e44909458",
      "name": "Return Analysis Results",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        3040,
        320
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={{ $json }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "2cc12960-130a-4b71-98b9-1c43f7e237b2",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1488,
        -368
      ],
      "parameters": {
        "color": 6,
        "width": 416,
        "height": 384,
        "content": "\n## Prerequisites\n- LLM API key (OpenAI or compatible)\n- Game backend with webhook event support\n- Vector database for player behavior embeddings\n## Use Cases\n- Identify churning player segments and trigger personalised re-engagement reward offers.\n## Customisation\n- Add more specialist agents (e.g., Social Behaviour, Competitive Play Analysis).\n## Benefits\n- Shifts game studios from reactive to predictive player management."
      },
      "typeVersion": 1
    },
    {
      "id": "6dbb34c2-36e5-4099-804b-c632efa09fba",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        -384
      ],
      "parameters": {
        "width": 544,
        "height": 288,
        "content": "## Setup Steps\n1. Configure the Gameplay Logs Webhook with your game backend event endpoint.\n2. Add LLM API credentials to all agent Chat Model nodes.\n3. Connect Player Behavior Vector Store to your embeddings database or vector index.\n4. Set parameters for Metrics Calculator and Statistical Analysis Tool nodes.\n5. Define reward and pricing simulation variables in the respective agent prompts.\n6. Configure A/B Testing Roadmap agent with your experimentation framework preferences."
      },
      "typeVersion": 1
    },
    {
      "id": "56b18716-81c0-45ba-b461-a33ee9008e86",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        -384
      ],
      "parameters": {
        "width": 704,
        "height": 336,
        "content": "## How It Works\nThis workflow automates player segmentation and game economy optimisation using a multi-agent AI architecture, targeting game designers, product managers, and data teams in mobile, PC, or online gaming studios who need to personalise player experiences at scale. The core problem it solves is the manual, reactive approach to player retention where studios typically analyse churn and monetisation issues too late, without the granularity needed to act on individual player behaviour segments. Gameplay logs are ingested via webhook and passed to the Player Segmentation Orchestrator, which coordinates five specialist agents: Behavioral Prediction, Reward Redesign, Pricing Adjustment Simulation, and A/B Testing Roadmap agents, each with dedicated models, memory, and output parsers. A Player Behavior Vector Store provides embeddings for deep behavioural context. Statistical Analysis and Metrics Calculator tools ground predictions in real data. All agent outputs are consolidated by a Segmentation Output Parser, then prepared, stored, and returned as structured analytics results, enabling continuous, data-driven game economy decisions."
      },
      "typeVersion": 1
    },
    {
      "id": "6232f2f9-dea2-4114-978f-aa4f89ef89c3",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1392,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 624,
        "height": 752,
        "content": "## Reward Redesign & Pricing Simulation\n**What:** Simulates optimised reward structures and adjusted pricing models per segment.\n**Why:** Tests economic changes virtually before live deployment, reducing revenue risk."
      },
      "typeVersion": 1
    },
    {
      "id": "a0226214-01fa-4a99-8ad8-0e42368defb1",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        368
      ],
      "parameters": {
        "color": 7,
        "width": 1520,
        "height": 528,
        "content": "## Behavioral Prediction\n**What:** Predicts future player actions using statistical analysis and a dedicated prediction model.\n**Why:** Identifies at-risk or high-value players before churn or monetisation \nopportunities are missed.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "1523751e-3204-4ad5-b4a8-b1b0e0ef5aeb",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        -16
      ],
      "parameters": {
        "color": 7,
        "width": 1488,
        "height": 352,
        "content": "## Segment & Orchestrate\n**What:** Player Segmentation Orchestrator delegates tasks across specialist agents using behavioral embeddings and segmentation model.\n**Why:** Ensures each player segment receives tailored analysis rather than one-size-fits-all treatment.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "a5f114a8-ea91-4cce-bde1-f87a90e14615",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2048,
        128
      ],
      "parameters": {
        "color": 7,
        "width": 464,
        "height": 816,
        "content": "## A/B Testing Roadmap\n**What:** Generates a structured A/B testing plan based on simulation outputs.\n**Why:** Provides an actionable experimentation framework grounded in predicted segment behaviour."
      },
      "typeVersion": 1
    },
    {
      "id": "2e05a5d3-ce82-47ef-9800-bd76c225e68e",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2560,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 672,
        "height": 496,
        "content": "\n## Parse, Store & Return Results\n**What:** Segmentation Output Parser consolidates all findings; results are stored and returned via API.\n**Why:** Delivers a unified, structured analytics payload ready for downstream dashboards or decision tools."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "3626213c-7ae5-40f0-9bc9-0f32d7ca3575",
  "connections": {
    "Prediction Model": {
      "ai_languageModel": [
        [
          {
            "node": "Behavioral Prediction Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Metrics Calculator": {
      "ai_tool": [
        [
          {
            "node": "Player Segmentation Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Segmentation Model": {
      "ai_languageModel": [
        [
          {
            "node": "Player Segmentation Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Gameplay Logs Webhook": {
      "main": [
        [
          {
            "node": "Player Segmentation Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Testing Roadmap Model": {
      "ai_languageModel": [
        [
          {
            "node": "A/B Testing Roadmap Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Reward Simulation Model": {
      "ai_languageModel": [
        [
          {
            "node": "Reward Redesign Simulation Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Store Analytics Results": {
      "main": [
        [
          {
            "node": "Return Analysis Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prediction Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Behavioral Prediction Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Pricing Simulation Model": {
      "ai_languageModel": [
        [
          {
            "node": "Pricing Adjustment Simulation Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "A/B Testing Roadmap Agent": {
      "ai_tool": [
        [
          {
            "node": "Player Segmentation Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Player Segmentation Agent": {
      "main": [
        [
          {
            "node": "Prepare Analytics Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Analytics Results": {
      "main": [
        [
          {
            "node": "Store Analytics Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Statistical Analysis Tool": {
      "ai_tool": [
        [
          {
            "node": "Player Segmentation Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Player Behavior Embeddings": {
      "ai_embedding": [
        [
          {
            "node": "Player Behavior Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Segmentation Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Player Segmentation Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Behavioral Prediction Agent": {
      "ai_tool": [
        [
          {
            "node": "Player Segmentation Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Player Behavior Vector Store": {
      "ai_tool": [
        [
          {
            "node": "Player Segmentation Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Testing Roadmap Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "A/B Testing Roadmap Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Reward Simulation Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Reward Redesign Simulation Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Pricing Simulation Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Pricing Adjustment Simulation Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Reward Redesign Simulation Agent": {
      "ai_tool": [
        [
          {
            "node": "Player Segmentation Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Pricing Adjustment Simulation Agent": {
      "ai_tool": [
        [
          {
            "node": "Player Segmentation Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}