{"name":"CWC 08 - The Restock Desk - fetch and split your personal products","nodes":[{"id":"c08-public-starter-start","name":"Start","type":"n8n-nodes-base.manualTrigger","typeVersion":1,"position":[0,120],"parameters":{}},{"id":"c08-public-starter-settings","name":"My settings","type":"n8n-nodes-base.set","typeVersion":3.4,"position":[240,120],"parameters":{"assignments":{"assignments":[{"id":"c08-public-username","name":"username","value":"","type":"string"},{"id":"c08-public-key","name":"participantKey","value":"","type":"string"}]},"options":{}}},{"id":"c08-public-starter-fetch","name":"Fetch my products","type":"n8n-nodes-base.httpRequest","typeVersion":4.2,"position":[500,120],"parameters":{"method":"GET","url":"https://marketing.app.n8n.cloud/webhook/cwc/challenge-08/data","sendQuery":true,"queryParameters":{"parameters":[{"name":"username","value":"={{ $json.username }}"}]},"sendHeaders":true,"headerParameters":{"parameters":[{"name":"x-participant-key","value":"={{ $json.participantKey }}"},{"name":"Accept","value":"application/json"}]},"options":{"timeout":30000,"redirect":{"redirect":{"followRedirects":false}}}},"notesInFlow":false,"notes":"The first successful personal data request starts your original timer. Re-fetching returns your saved assignment and original start. No HTTP Basic Auth credential is required."},{"id":"c08-public-starter-split","name":"Split products","type":"n8n-nodes-base.splitOut","typeVersion":1,"position":[780,120],"parameters":{"fieldToSplitOut":"assignment.items","options":{}}},{"id":"c08-public-starter-overview","name":"Read first: C08 and useful links","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[-64,-736],"parameters":{"width":576,"height":704,"color":6,"content":"# The Restock Desk\n**Challenge 08 | Season 3**\n\nFetch eight personal products, then build your own restock calculation with native n8n nodes. This starter prepares the data. It does not contain the completed solution.\n\n## Before you start\n1. Read the task and deadline on the website.\n2. Have your community username and current participant key ready.\n3. Import this starter and prepare your workspace before fetching data.\n\n**Reading, importing and connecting are untimed. Your first personal data fetch starts the clock.**\n\n## Useful links\n- [Read the challenge](https://marketing.app.n8n.cloud/webhook/cwc/site)\n- [Full rules and FAQ](https://marketing.app.n8n.cloud/webhook/cwc/site?view=faq)\n- [Create an account](https://marketing.app.n8n.cloud/webhook/cwc/site?view=register)\n- [Recover a participant key](https://marketing.app.n8n.cloud/webhook/cwc/site?view=reset)"}},{"id":"c08-public-starter-setup","name":"1. Set up and fetch your products","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[560,-736],"parameters":{"width":576,"height":704,"color":5,"content":"# 1. Fetch your personal data\n\n## Configure My settings\n- **username:** your community username.\n- **participantKey:** your current private key.\n\nRun **Start** after both fields are filled. **Fetch my products** makes the personal data request. **Split products** turns the eight products into separate items.\n\n## Why one HTTP request?\nBoth answers come from the **same packet**. You calculate them inside your workflow. There is no separate Question 1 or Question 2 endpoint.\n\n## Access and timing\nThe data endpoint opens with Challenge 08. Before opening, a refused request is expected. Check the [challenge status](https://marketing.app.n8n.cloud/webhook/cwc/site); do not add organiser credentials.\n\nAfter opening, your username and participant key are sufficient. The first successful personal data issue starts your timer. Fetching again keeps the same assignment and original start."}},{"id":"c08-public-starter-build","name":"2. Build the restock calculation","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[1184,-736],"parameters":{"width":736,"height":704,"color":4,"content":"# 2. Build your calculation\nContinue after **Split products**. Read the field-name mapping in your assignment: participants can receive different stock, incoming and target field names.\n\n## Apply the task rules\n1. Keep products where **enabled is true**.\n2. Calculate **target minus stock minus incoming**.\n3. Keep only positive shortfalls.\n4. Count the qualifying products and add their shortfalls.\n\n## Produce two whole-number answers\n- **items_to_restock:** the number of qualifying products.\n- **total_units_to_order:** their total units to order.\n\nEquality, surplus and disabled products contribute nothing. If nothing qualifies, both answers are **0**.\n\nUse native nodes and your own reasoning. AI assistance and Code, Function or Function Item nodes are not allowed, including disabled or disconnected copies.\n\n[Read the complete task and worked example](https://marketing.app.n8n.cloud/webhook/cwc/site) | [Rules and FAQ](https://marketing.app.n8n.cloud/webhook/cwc/site?view=faq)"}},{"id":"c08-public-starter-submit","name":"3. Clean the export and submit","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[-64,384],"parameters":{"width":576,"height":736,"color":3,"content":"# 3. Export and submit\n\n## Make a clean copy\nKeep your working original. In the copy you will upload:\n1. Clear **participantKey** in **My settings**.\n2. Remove any passwords or credential references.\n3. Remove pinned data and saved execution data.\n4. Export the cleaned workflow as JSON.\n\n## Submit on the website\n[Open the submission page](https://marketing.app.n8n.cloud/webhook/cwc/site?view=submit)\n\nEnter **items_to_restock** and **total_units_to_order**, choose the clean JSON file and confirm the declarations. An explanation is optional, up to 2,000 characters.\n\nNo submission HTTP node is needed in this starter. The website receives your answers and uploaded workflow together.\n\nCorrect eligible entries are accepted automatically. The first accepted final is immutable. Keep your receipt.\n\nIf a response is lost, [check My result](https://marketing.app.n8n.cloud/webhook/cwc/site?view=status) before creating a different final request."}},{"id":"c08-public-starter-help","name":"Timing, results and troubleshooting","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[560,384],"parameters":{"width":576,"height":736,"color":2,"content":"# Timing, results and help\n\n## Your clock\nReading and importing this starter do not start a run. The first personal data issue starts it. Refetching does not reset it. A correct accepted final is required to finish.\n\nThe [FAQ](https://marketing.app.n8n.cloud/webhook/cwc/site?view=faq) explains the server timing breakdown, retries and rankings.\n\n## Check your result\n- [My result and saved receipt](https://marketing.app.n8n.cloud/webhook/cwc/site?view=status)\n- [Weekly leaderboard](https://marketing.app.n8n.cloud/webhook/cwc/site?view=results&scope=week)\n- [Season 3 leaderboard](https://marketing.app.n8n.cloud/webhook/cwc/site?view=results&scope=season)\n\nRankings use elapsed completion time. Weekly bonuses are provisional while participation is open.\n\n## If something is unclear\n- Check the website's current participation status and deadline.\n- For a key problem, [recover your current key](https://marketing.app.n8n.cloud/webhook/cwc/site?view=reset).\n- For an error, keep the reference shown on screen.\n- [Questions and announcements](https://marketing.app.n8n.cloud/webhook/cwc/site?view=community)\n\nKeep your participant key and full solution private."}}],"connections":{"Start":{"main":[[{"node":"My settings","type":"main","index":0}]]},"My settings":{"main":[[{"node":"Fetch my products","type":"main","index":0}]]},"Fetch my products":{"main":[[{"node":"Split products","type":"main","index":0}]]}},"settings":{"executionOrder":"v1"},"pinData":{},"active":false,"meta":{"templateCredsSetupCompleted":true}}