{
  "name": "Lab 2: Prompt Engineering Techniques",
  "nodes": [
    {
      "parameters": {},
      "id": "trigger-002",
      "name": "Start Lab",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [100, 300],
      "notes": "Click 'Execute Workflow' to run all three prompt techniques in parallel and compare the results."
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "task_description",
              "value": "Classify the following customer feedback and explain your reasoning:\n\n\"I've been using your security scanning tool for 3 months. The vulnerability detection is excellent, but the false positive rate for SQL injection warnings is frustrating -- about 30% of flagged items turn out to be safe parameterized queries. The dashboard UI is clean though.\"\n\nClassify as: POSITIVE, NEGATIVE, MIXED, or NEUTRAL\nIdentify: Key issues mentioned\nSuggest: One improvement"
            }
          ]
        },
        "options": {}
      },
      "id": "set-task-002",
      "name": "Task Description",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [320, 300],
      "notes": "This is the task that all three prompt techniques will attempt. Read it carefully to understand what a good response looks like before writing your prompts."
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "prompt",
              "value": "STUDENT TASK: Write a ZERO-SHOT prompt for the task below. Zero-shot means NO examples -- just clear instructions about what you want.\n\nTask: {{ $json.task_description }}"
            }
          ]
        },
        "options": {}
      },
      "id": "set-zeroshot-002",
      "name": "Zero-Shot Prompt",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [540, 120],
      "notes": "STUDENT TASK: Write your zero-shot prompt.\n\nZero-shot = direct instruction with NO examples.\nBe clear about the task, the desired output format, and any constraints.\n\nTip: Include the task description and specify exactly what format you want the answer in."
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "prompt",
              "value": "STUDENT TASK: Write a FEW-SHOT prompt for the task below. Few-shot means include 2-3 EXAMPLES of similar inputs with their correct outputs before presenting the actual task.\n\nTask: {{ $json.task_description }}"
            }
          ]
        },
        "options": {}
      },
      "id": "set-fewshot-002",
      "name": "Few-Shot Prompt",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [540, 300],
      "notes": "STUDENT TASK: Write your few-shot prompt.\n\nFew-shot = provide 2-3 examples of similar feedback with correct classifications BEFORE the actual task.\n\nTip: Create examples that cover different classifications (POSITIVE, NEGATIVE, MIXED) so the model learns the full pattern. Keep example format consistent with what you want in the output."
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "prompt",
              "value": "STUDENT TASK: Write a CHAIN-OF-THOUGHT prompt for the task below. Chain-of-thought means instruct the model to reason step-by-step before giving its final answer.\n\nTask: {{ $json.task_description }}"
            }
          ]
        },
        "options": {}
      },
      "id": "set-cot-002",
      "name": "Chain-of-Thought Prompt",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [540, 480],
      "notes": "STUDENT TASK: Write your chain-of-thought prompt.\n\nChain-of-thought = instruct the model to break down its reasoning into explicit steps.\n\nTip: Add something like 'Let's analyze this step by step:' and structure the reasoning steps (e.g., 1. Identify sentiment indicators, 2. Weigh positive vs negative, 3. Classify, 4. Extract issues, 5. Suggest improvement)."
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/chat/completions",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ model: 'gpt-4o-mini', messages: [{ role: 'user', content: $json.prompt }], temperature: 0.3 }) }}",
        "options": {}
      },
      "id": "http-zeroshot-002",
      "name": "LLM: Zero-Shot",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [760, 120],
      "notes": "Sends the zero-shot prompt to the LLM. Uses low temperature (0.3) for consistent classification."
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/chat/completions",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ model: 'gpt-4o-mini', messages: [{ role: 'user', content: $json.prompt }], temperature: 0.3 }) }}",
        "options": {}
      },
      "id": "http-fewshot-002",
      "name": "LLM: Few-Shot",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [760, 300],
      "notes": "Sends the few-shot prompt to the LLM. Uses the same temperature for fair comparison."
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/chat/completions",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ model: 'gpt-4o-mini', messages: [{ role: 'user', content: $json.prompt }], temperature: 0.3 }) }}",
        "options": {}
      },
      "id": "http-cot-002",
      "name": "LLM: Chain-of-Thought",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [760, 480],
      "notes": "Sends the chain-of-thought prompt to the LLM. Uses the same temperature for fair comparison."
    },
    {
      "parameters": {
        "mode": "combine",
        "mergeByFields": {},
        "combinationMode": "multiplex",
        "options": {}
      },
      "id": "merge-002",
      "name": "Compare Results",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 1,
      "position": [980, 300],
      "notes": "This node combines all three results so you can compare them side by side.\n\nAfter running, examine the output to see how each prompting technique handled the same task. Consider:\n- Which produced the most accurate classification?\n- Which format was most useful?\n- Which technique would you use in a production system?"
    }
  ],
  "connections": {
    "Start Lab": {
      "main": [
        [
          {
            "node": "Task Description",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Task Description": {
      "main": [
        [
          {
            "node": "Zero-Shot Prompt",
            "type": "main",
            "index": 0
          },
          {
            "node": "Few-Shot Prompt",
            "type": "main",
            "index": 0
          },
          {
            "node": "Chain-of-Thought Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Zero-Shot Prompt": {
      "main": [
        [
          {
            "node": "LLM: Zero-Shot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Few-Shot Prompt": {
      "main": [
        [
          {
            "node": "LLM: Few-Shot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chain-of-Thought Prompt": {
      "main": [
        [
          {
            "node": "LLM: Chain-of-Thought",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM: Zero-Shot": {
      "main": [
        [
          {
            "node": "Compare Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM: Few-Shot": {
      "main": [
        [
          {
            "node": "Compare Results",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "LLM: Chain-of-Thought": {
      "main": [
        [
          {
            "node": "Compare Results",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "instanceId": "lab-template"
  }
}
