{
  "id": "WNu97ohWDOaqPXwj",
  "name": "Set Node Tutorial Workflow",
  "tags": [],
  "nodes": [
    {
      "id": "945ccba0-646e-4559-b674-d9df83157aa3",
      "name": "Start (Manual Trigger)",
      "type": "n8n-nodes-base.start",
      "notes": "This node serves as your manual trigger. Click 'Execute Workflow' to start the tutorial. It passes a basic 'welcome' message.",
      "position": [
        -512,
        464
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0cd6c126-3320-4084-9ebf-65ba2e2ef95e",
      "name": "Tutorial Intro",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        96
      ],
      "parameters": {
        "width": 400,
        "height": 424,
        "content": "## \ud83c\udfaf Set Node Tutorial Workflow\n\n**Welcome to the comprehensive Set node tutorial!**\n\nThis workflow will teach you:\n1. Basic data types (string, number, boolean)\n2. Using expressions with {{ }} syntax\n3. Complex data structures (objects & arrays)\n4. The \"Keep Only Set\" option\n5. Conditional data setting\n\n**How to use:**\n- Execute each node step by step\n- Check the output data after each Set node\n- Read the notes on each node\n- Try modifying values to experiment!"
      },
      "typeVersion": 1
    },
    {
      "id": "64d5550c-af2c-4cb5-bb5f-db92c0de7688",
      "name": "1. Set Basic Values",
      "type": "n8n-nodes-base.set",
      "notes": "This demonstrates setting basic data types:\n- Strings for text data\n- Numbers for integers and decimals\n- Booleans for true/false values",
      "position": [
        -288,
        464
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "f14ff918-718e-4d77-a9a8-5446f47c59d1",
      "name": "Basic Set Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -16
      ],
      "parameters": {
        "color": 7,
        "width": 320,
        "height": 240,
        "content": "## \ud83d\udcdd Basic Set Operations\n\n**What this node does:**\n- Sets simple string values (name, email)\n- Sets number values (age, score) \n- Sets boolean values (true/false)\n\n**Key concepts:**\n- Each data type has its own section\n- Values can be static text/numbers\n- Booleans are true/false only\n\n**Try this:** Change the user_age to see how it affects later nodes!"
      },
      "typeVersion": 1
    },
    {
      "id": "31e36bb6-f39f-4d6b-b2e4-f5a35d18098a",
      "name": "2. Set with Expressions",
      "type": "n8n-nodes-base.set",
      "notes": "This shows how to use expressions in Set nodes:\n- Reference previous data with $json\n- Use JavaScript expressions with ={{ }}\n- Access built-in functions like $now\n- Perform calculations and string interpolation",
      "position": [
        -64,
        272
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "a886eb9a-26fb-4510-bef2-761188994246",
      "name": "Expression Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        16
      ],
      "parameters": {
        "width": 320,
        "height": 240,
        "content": "## \ud83d\udd27 Expression Magic\n\n**What this node shows:**\n- Using {{ }} to reference previous data\n- $json.fieldname gets data from previous node\n- $now gives current date/time\n- Math operations with JavaScript\n\n**Key patterns:**\n- {{ $json.user_name }} = gets user_name\n- {{ $json.score * 2 }} = multiplies score\n- {{ $now.toFormat('yyyy-MM-dd') }} = formats date\n\n**This is where Set nodes get powerful!**"
      },
      "typeVersion": 1
    },
    {
      "id": "2fabf9a9-47e9-4248-aa51-7d01fde8773b",
      "name": "3. Set Complex Data",
      "type": "n8n-nodes-base.set",
      "notes": "This demonstrates setting complex data structures:\n- Objects with nested properties\n- Arrays with mixed data types\n- Combining static values with dynamic expressions\n- Building hierarchical data structures",
      "position": [
        160,
        272
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "d559b4bd-a32c-4d33-8b3f-782dad7034d7",
      "name": "Complex Data Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        48
      ],
      "parameters": {
        "width": 320,
        "height": 240,
        "content": "## \ud83c\udfd7\ufe0f Complex Data Structures\n\n**Objects:** Nested data with properties\n```\nuser_profile: {\n  personal: { name, age, email },\n  account: { is_active, score }\n}\n```\n\n**Arrays:** Lists of values\n```\nuser_permissions: [\"read\", \"write\", \"premium\"]\nscore_history: [85.5, 171, 128.25]\n```\n\n**Pro tip:** Mix static values with dynamic expressions!"
      },
      "typeVersion": 1
    },
    {
      "id": "6aba6d91-55be-4042-87bb-ffdaafe7625b",
      "name": "4. Set Clean Output",
      "type": "n8n-nodes-base.set",
      "notes": "This shows the 'Keep Only Set' option:\n- When enabled, only the newly set values are kept\n- Previous data from the workflow is removed\n- Useful for cleaning up data and creating final outputs\n- Notice how we reference nested object properties",
      "position": [
        384,
        272
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "48f1a5f2-cfbd-439b-8093-ba04aea5eac4",
      "name": "Keep Only Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        48
      ],
      "parameters": {
        "width": 320,
        "height": 240,
        "content": "## \ud83e\uddf9 Keep Only Set Option\n\n**IMPORTANT FEATURE:**\nWhen \"Keep Only Set\" is enabled:\n- \u2705 Only new values are kept\n- \u274c All previous data is removed\n- \ud83c\udfaf Perfect for final outputs\n\n**Use cases:**\n- Clean API responses\n- Final data formatting\n- Removing unwanted fields\n\n**Notice:** This node only has 3 fields in output instead of all previous data!"
      },
      "typeVersion": 1
    },
    {
      "id": "1f99d00d-dc21-4ff1-a48c-a70cc5d316a5",
      "name": "Age Check",
      "type": "n8n-nodes-base.if",
      "notes": "Branching logic to demonstrate conditional Set nodes",
      "position": [
        -64,
        560
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "condition-1",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.user_age }}",
              "rightValue": 25
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "e2dcd60e-246e-4f1b-80e4-e50b1d08e7b9",
      "name": "5a. Set Adult Data",
      "type": "n8n-nodes-base.set",
      "notes": "Conditional Set node for adults (age > 25)\nShows how Set nodes work in different branches",
      "position": [
        160,
        464
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "dc01d597-9b1e-454e-b4fa-fdb81571b44d",
      "name": "5b. Set Young Adult Data",
      "type": "n8n-nodes-base.set",
      "notes": "Conditional Set node for young adults (age <= 25)\nShows different values based on conditions",
      "position": [
        160,
        656
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "c31f2f39-ad3a-4207-809c-722445703135",
      "name": "Conditional Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        480
      ],
      "parameters": {
        "width": 320,
        "height": 240,
        "content": "## \ud83d\udd00 Conditional Set Nodes\n\n**The IF node splits the workflow:**\n- \u2705 TRUE: Age > 25 \u2192 Adult path\n- \u274c FALSE: Age \u2264 25 \u2192 Young adult path\n\n**Each path has different Set nodes:**\n- Adults get premium offers\n- Young adults get student discounts\n\n**Key insight:** Set nodes can have completely different logic based on conditions!\n\n**Try:** Change user_age to 20 and see the different path!"
      },
      "typeVersion": 1
    },
    {
      "id": "3ae0a260-db4b-4ac4-8b71-3c5d1e952676",
      "name": "Merge Branches",
      "type": "n8n-nodes-base.merge",
      "notes": "Merge the conditional branches back together",
      "position": [
        384,
        560
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "mergeByFields": {
          "values": [
            {}
          ]
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "2ed81df9-7a96-483b-b736-012e89e08595",
      "name": "6. Tutorial Summary",
      "type": "n8n-nodes-base.set",
      "notes": "Final summary of the Set node tutorial with all key concepts covered",
      "position": [
        608,
        560
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "a630ce01-86c0-44c8-82f8-5e4f790a936a",
      "name": "Completion Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        688
      ],
      "parameters": {
        "width": 400,
        "height": 376,
        "content": "## \ud83c\udf93 Tutorial Complete!\n\n**What you've learned:**\n\u2705 Basic data types in Set nodes\n\u2705 Expression syntax with {{ }}\n\u2705 Referencing data with $json\n\u2705 Complex objects and arrays\n\u2705 Keep Only Set for clean outputs\n\u2705 Conditional data setting\n\n**Next steps:**\n- Try modifying the values\n- Add your own Set nodes\n- Experiment with expressions\n- Build your own data transformations!\n\n**Set nodes are the Swiss Army knife of n8n! \ud83d\udee0\ufe0f**"
      },
      "typeVersion": 1
    },
    {
      "id": "42624e8d-e79c-4064-a999-59fff9b684f9",
      "name": "0. Test Data Input",
      "type": "n8n-nodes-base.set",
      "notes": "\ud83d\udd27 **ALTERNATIVE START NODE** - Use this instead of 'Start (Manual Trigger)' for testing!\n\n**How to switch to test data:**\n1. **Disconnect** the line from 'Start (Manual Trigger)' to '1. Set Basic Values'\n2. **Connect** this node to '1. Set Basic Values'\n3. **Execute workflow** to see different results\n\n**Test different scenarios by changing:**\n- user_age (try 20 vs 30 for different branches)\n- score values\n- boolean flags\n\n**This node already has sample data ready to go!**",
      "position": [
        -288,
        800
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "d9932d91-1f9f-40d0-b83f-6891be6bfa19",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -512,
        768
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "7a423cd7-82f0-4193-8203-0d7c1afa258f",
  "connections": {
    "Age Check": {
      "main": [
        [
          {
            "node": "5a. Set Adult Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "5b. Set Young Adult Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Branches": {
      "main": [
        [
          {
            "node": "6. Tutorial Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0. Test Data Input": {
      "main": [
        []
      ]
    },
    "5a. Set Adult Data": {
      "main": [
        [
          {
            "node": "Merge Branches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1. Set Basic Values": {
      "main": [
        [
          {
            "node": "2. Set with Expressions",
            "type": "main",
            "index": 0
          },
          {
            "node": "Age Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3. Set Complex Data": {
      "main": [
        [
          {
            "node": "4. Set Clean Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start (Manual Trigger)": {
      "main": [
        [
          {
            "node": "1. Set Basic Values",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2. Set with Expressions": {
      "main": [
        [
          {
            "node": "3. Set Complex Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5b. Set Young Adult Data": {
      "main": [
        [
          {
            "node": "Merge Branches",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "0. Test Data Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}