[{"data":1,"prerenderedAt":370},["ShallowReactive",2],{"flow-lfvdiy3m25xrk68ogeras94402y46fyz":3},{"nodes":4,"edges":229},{"lfvdiy3m25xrk68ogeras94402y46fyz":5,"rd3dejnmdo4t59cgkwglojrntsk86fb6":19,"ntvniq9mxvu1frzdb80n7gxgvi0536uu":27,"pm8eh90j78ujtkjudhyrklaqf4yv0hsh":34,"g2wx37ps2pwikb9t9xnqlwuqqolt5bnq":43,"2deq7gomikey4r9lnqzlc53leop01cae":49,"qhjj6xe2538cttqd0e12w20knys7okxo":54,"j8ikgodkp6ux5cjh8z0flppbc6jtl0uo":59,"ncnlaldy9hhudlv084ll458yfgye3gza":65,"sp1nql4bwjav07kiq6bmsrqzbqdadocp":71,"aqbi71aaot5ochkeqnczlaa43ne1f0l2":77,"7qt1nddzmgloo0a5zccf6omkesli4jkh":83,"qqdr9wariptramvvvnxjp3rq8an48swq":89,"mvqk1n01y3i7mp4r169kdqlmmzp2px3g":96,"jn1wiezk7ekkt8065hnwubo9ifsc8opr":102,"nzlk7stz2fqakxl1reej66ztj6id7440":108,"9bxj3oyk1tfgqkjgc3stoyc1lnb9vxsm":114,"sqg723jgyhoaib7exyvcw1pwvfci7s9o":120,"s31s58144bof41cm3aknfdz25c3fmsiv":126,"e8033o8jzclg4tebgudd9r118mf4lbp2":132,"zubjrssp3sh7fuf2a3ulmukb7ap0bkp8":139,"hbd7js1lowvyqk05lczfy2031305wqbk":145,"ywr9763xtq5i33w5j57lwsqub6dye6rj":151,"1fwgcx8z6dm2si3aalqoqoqgm5y8il69":157,"1ukks6kb5xkczz3fjjfpvnouvlkfmgnf":162,"jindf1zq2f2k2gf3qbr0pfqivni3i10q":167,"enfnc21gntz8av5caaizop02qzwlmh57":173,"cb6b7gp8wpyu8y9m2zeutcbuybaf3mx6":179,"4wum1vrtc3i2s3mednoynlqq9z4494io":185,"b7zmdq6pv3y5wjrfe9f8ztndpainsx3x":191,"r2cj11nx23o5kneohnfw8n72tvmwsonu":196,"k31m80cdsbz6lfkpvr50u7twflt81aj5":202,"ghbx8iqe50rv32tgvqoyfrh5gbzpjyve":207,"uvq8qityu5jjb9vu07fgsxithvw4z6fh":213,"aa7dfk36pf5ldte4m3twrpoh7cmu1at4":218,"0lrho6qlwr0wqj6y4cbsw7vutuymk4p8":224},{"id":6,"type":7,"x":8,"y":8,"properties":9},"lfvdiy3m25xrk68ogeras94402y46fyz","start",0,{"title":10,"excerpt":11,"post":12,"author":13,"license":14,"channel":15,"category":16,"private":17,"slug":18},"Catch unexpected inputs with Try and Throw nodes","This example shows what happens when a user types a new intention into a prompt instead of an expected order number.","**Users don't follow scripts. RGS makes that a feature, not a problem.**\n\n## The Scenario\n\nA customer opens your e-commerce support chat. The flow is straightforward:\n\n1. A **Prompt node** captures the user's initial message.\n2. A **GPT node** classifies the intent.\n3. A **Queue node** routes to the matching **Task node** — here, \"Order Details.\"\n4. Further down, a second **Prompt node** asks for the order number.\n\nNow the user types: *\"What's your address?\"*\n\nThis has nothing to do with order tracking. In most chatbot systems, this is where things break. In RGS, it's where things get elegant.\n\n5. A **Throw node** on the order-number prompt performs a clean exit and pushes its state upward to a **Try node** sitting before the GPT node at the top of the graph.\n6. The GPT node re-evaluates the intercepted input, classifies the new intent, and the Queue and Task nodes react accordingly.\n\nThe conversation pivots seamlessly. The user notices nothing.\n\n## Why This Works in RGS\n\nThe core mechanism: **Throw pushes state to an earlier node, and when any node's state changes, the entire graph re-sequences.**\n\nRGS doesn't \"continue from where it left off.\" It re-evaluates everything. The GPT node sees the new input. The Queue picks up the new intent. The downstream sequence recalculates. No special-case logic, no rewiring — the behavior emerges from the graph structure itself.\n\nThis is fundamentally different from traditional try\u002Fcatch in programming. The Throw node doesn't signal an error. It signals *\"this input belongs somewhere else\"* — and uses a control edge to send it there. The graph then asks: *\"Given everything we know right now, what should be happening?\"* — and re-answers that question from scratch.\n\nEach node keeps a single responsibility. No node needs to understand the full flow. Add a new intent? Add a new task node. The Try\u002FThrow pattern handles rerouting automatically.\n\n## How Traditional Builders Handle This\n\nShort answer: not well. Most flow builders are linear — once you're in a branch, you're stuck. The usual workarounds:\n\n- **Fallback intents** that don't know the current context and just say \"Sorry, try again.\"\n- **Global intents** that compete with local ones and create priority conflicts.\n- **Manual state management** in custom code — functional but fragile and hard to maintain.\n\nThe fundamental limitation: traditional builders execute forward. Once a node has run, its result is final. There's no way to retroactively change an earlier node's state and have everything downstream recalculate. RGS can do exactly that, which is why late intent switching isn't an edge case — it's a natural consequence of how the system works.\n\n---\n\n*Try the live example above, or start building your own adaptive conversations at [wanderer-flow.de](https:\u002F\u002Fwanderer-flow.de).*","Wanderer","CC BY 4.0","chat","Context Reactivity",false,"Catch-unexpected-inputs-with-Try-and-Throw-nodes",{"id":20,"type":21,"x":22,"y":23,"properties":24},"rd3dejnmdo4t59cgkwglojrntsk86fb6","message",-549.8987798658981,140.3511944650159,{"text":25,"repeatOnReentry":26},"Welcome to our online clothing shop. I can help you with your order, with contact details, and opening hours.",true,{"id":28,"type":29,"x":30,"y":31,"properties":32},"ntvniq9mxvu1frzdb80n7gxgvi0536uu","prompt",-83.59065913110732,518.33118104853,{"placeholder":33},"Type your message",{"id":35,"type":36,"x":37,"y":38,"properties":39},"pm8eh90j78ujtkjudhyrklaqf4yv0hsh","chatgpt",972.7546195619409,518.014483984734,{"systemPrompt":40,"userPrompt":41,"model":42,"repeatOnReentry":26,"repeatOnChance":26},"Please determine the user's intent and return it as a RAW JSON object without wrapping it with markdown. We only sell clothes.  Set each field to true or false.\nPossible topics are:\n\n- order: Everything related to orders\n- opening: Opening times\n- contact: Contact details or address\n- wrongProduct: Other products than clothing \n- other: Everything else, or if something wasn't understood","{{#if inputValue}}{{inputValue}}{{\u002Fif}}","gpt-4.1-mini",{"id":44,"type":45,"x":46,"y":47,"properties":48},"g2wx37ps2pwikb9t9xnqlwuqqolt5bnq","task",1308.757767537548,1056.0634813644128,{"repeatOnReentry":26},{"id":50,"type":45,"x":51,"y":52,"properties":53},"2deq7gomikey4r9lnqzlc53leop01cae",658.599814011986,1055.299261194551,{"repeatOnReentry":26},{"id":55,"type":45,"x":56,"y":57,"properties":58},"qhjj6xe2538cttqd0e12w20knys7okxo",782.5126022853145,1201.2158497581129,{"repeatOnReentry":26},{"id":60,"type":21,"x":61,"y":62,"properties":63},"j8ikgodkp6ux5cjh8z0flppbc6jtl0uo",395.96880906618134,1205.9927643942383,{"text":64,"repeatOnReentry":26},"I'm happy to help you with your order.",{"id":66,"type":21,"x":67,"y":68,"properties":69},"ncnlaldy9hhudlv084ll458yfgye3gza",1607.925798427462,1122.1600605965752,{"text":70,"repeatOnReentry":26},"Unfortunately, I don't think I can help you with that.",{"id":72,"type":21,"x":73,"y":74,"properties":75},"sp1nql4bwjav07kiq6bmsrqzbqdadocp",738.1858720756791,1449.2428969083956,{"text":76,"repeatOnReentry":26},"Here is our address and contact details.",{"id":78,"type":21,"x":79,"y":80,"properties":81},"aqbi71aaot5ochkeqnczlaa43ne1f0l2",-8.71460434917961,1498.0390401613765,{"text":82,"repeatOnReentry":26},"I need your order number please.",{"id":84,"type":29,"x":85,"y":86,"properties":87},"7qt1nddzmgloo0a5zccf6omkesli4jkh",-427.77413818107414,1887.2780716082011,{"placeholder":88},"Your order number",{"id":90,"type":36,"x":91,"y":92,"properties":93},"qqdr9wariptramvvvnxjp3rq8an48swq",-579.7675919541622,2194.897589905117,{"systemPrompt":94,"userPrompt":95,"model":42,"repeatOnReentry":26},"You are a specialized node in a chat graph. Your task is to check the correct format of an order number. Our order numbers always look like this:\n\no-2356-5738\n\nIf you recognize an order number, simply say \"check\". If you see a different string of characters that doesn't look like this, please say \"fail\". And if the next prompt is about a completely different topic, please say \"escalate\".","{{orderNumber}}",{"id":97,"type":21,"x":98,"y":99,"properties":100},"mvqk1n01y3i7mp4r169kdqlmmzp2px3g",-130.3588675624519,2449.285426353158,{"text":101,"repeatOnReentry":26},"Thanks for your number!",{"id":103,"type":21,"x":104,"y":105,"properties":106},"jn1wiezk7ekkt8065hnwubo9ifsc8opr",-737.5473971397112,2516.923554289157,{"text":107,"repeatOnReentry":26},"I was expecting an order number. Please wait a moment.",{"id":109,"type":21,"x":110,"y":111,"properties":112},"nzlk7stz2fqakxl1reej66ztj6id7440",-1067.8213298591947,2107.180614861282,{"text":113,"repeatOnReentry":26},"That doesn't look like one of our order numbers.",{"id":115,"type":21,"x":116,"y":117,"properties":118},"9bxj3oyk1tfgqkjgc3stoyc1lnb9vxsm",-1388.5254807412284,1858.3535039642936,{"text":119,"repeatOnReentry":26},"Our numbers look like this: o-2356-5738",{"id":121,"type":21,"x":122,"y":123,"properties":124},"sqg723jgyhoaib7exyvcw1pwvfci7s9o",-1230.3736165922091,1583.0852125075291,{"text":125,"repeatOnReentry":26},"Please double-check and tell me the order number.",{"id":127,"type":21,"x":128,"y":129,"properties":130},"s31s58144bof41cm3aknfdz25c3fmsiv",162.03798550078173,2616.952330154121,{"text":131,"repeatOnReentry":26},"Your order has just been shipped.",{"id":133,"type":134,"x":135,"y":136,"properties":137},"e8033o8jzclg4tebgudd9r118mf4lbp2","throw",-784.0853363359086,2895.812766236011,{"message":138},"User escalated",{"id":140,"type":141,"x":142,"y":143,"properties":144},"zubjrssp3sh7fuf2a3ulmukb7ap0bkp8","try",333.94721316711576,518.9650727191555,[],{"id":146,"type":147,"x":148,"y":149,"properties":150},"hbd7js1lowvyqk05lczfy2031305wqbk","queue",970.6342341777827,995.1712054447922,[],{"id":152,"type":153,"x":154,"y":155,"properties":156},"ywr9763xtq5i33w5j57lwsqub6dye6rj","done",425.8866214057149,2745.3213650816615,[],{"id":158,"type":153,"x":159,"y":160,"properties":161},"1fwgcx8z6dm2si3aalqoqoqgm5y8il69",713.8562420273017,1896.8176300483774,[],{"id":163,"type":153,"x":164,"y":165,"properties":166},"1ukks6kb5xkczz3fjjfpvnouvlkfmgnf",1871.5578865900175,1220.2138193035141,[],{"id":168,"type":21,"x":169,"y":170,"properties":171},"jindf1zq2f2k2gf3qbr0pfqivni3i10q",278.5328572206792,804.5202880036203,{"text":172,"repeatOnReentry":26},"Is there anything else I can help you with?",{"id":174,"type":21,"x":175,"y":176,"properties":177},"enfnc21gntz8av5caaizop02qzwlmh57",-320.0809637832286,-110.2332416595959,{"text":178,"repeatOnReentry":26,"repeatOnChance":26},"This example shows how __unexpected inputs__ in a specific prompt are thrown back to a higher node, which then makes a new decision.",{"id":180,"type":21,"x":181,"y":182,"properties":183},"cb6b7gp8wpyu8y9m2zeutcbuybaf3mx6",-442.09609612227825,440.33862015284785,{"text":184,"repeatOnReentry":26,"repeatOnChance":26},"Type here: __Yes, I need help with my order.__",{"id":186,"type":21,"x":187,"y":188,"properties":189},"4wum1vrtc3i2s3mednoynlqq9z4494io",-255.54901632587936,1685.5371585747193,{"text":190,"repeatOnReentry":26,"repeatOnChance":26},"The user can now enter either a correctly looking order number (as expected), an incorrect order number such as s4534674628, or a completely different request such as \"what are your opening hours\". Feel free to experiment with different values.\n",{"id":192,"type":45,"x":193,"y":194,"properties":195},"b7zmdq6pv3y5wjrfe9f8ztndpainsx3x",1053.1937622208113,1280.3997333656243,[],{"id":197,"type":21,"x":198,"y":199,"properties":200},"r2cj11nx23o5kneohnfw8n72tvmwsonu",1056.2202857959526,1494.0035765861167,{"text":201,"repeatOnReentry":26,"repeatOnChance":26},"Our opening hours are Monday to Thursday, 9 am to 4 pm.",{"id":203,"type":153,"x":204,"y":205,"properties":206},"k31m80cdsbz6lfkpvr50u7twflt81aj5",1051.7429129139834,1797.0653631883592,[],{"id":208,"type":21,"x":209,"y":210,"properties":211},"ghbx8iqe50rv32tgvqoyfrh5gbzpjyve",735.7610256991978,1680.9237962958523,{"text":212,"repeatOnReentry":26,"repeatOnChance":26},"Sample corporation\nSample Street 1\n12345 Sample City",{"id":214,"type":45,"x":215,"y":216,"properties":217},"uvq8qityu5jjb9vu07fgsxithvw4z6fh",1293.2541536235187,1245.4446235107566,[],{"id":219,"type":21,"x":220,"y":221,"properties":222},"aa7dfk36pf5ldte4m3twrpoh7cmu1at4",1350.0759591616954,1538.0035576501823,{"text":223,"repeatOnReentry":26,"repeatOnChance":26},"I'm very sorry. We only sell clothes.",{"id":225,"type":153,"x":226,"y":227,"properties":228},"0lrho6qlwr0wqj6y4cbsw7vutuymk4p8",1409.4507533301753,1798.8926600131972,[],{"xh6zdqrblal8plwkvu16su2e72pstbot":230,"xshmwrkfzz8a90jsebapzzuubspvecd9":236,"ducgib4bn4vlf4d96ne5nrs1n8rea7ps":239,"lfgqpsesmbzzdc20qh31wwkbfrwnblmc":243,"enm67jghv3iv5k85s5sdi5qtk6lmbisz":247,"mubbk0yqnf373y632ru31iriou5td909":253,"cdft08vf1shfxccqfs9bc6h3n1jtl1ak":257,"nhre6ozrv4v7x34u2o7ex0c4owvhupgl":260,"bb378tg96kxs062egqkkr9j5xlqtcd8x":263,"ptqhc660tq9qkd0rjvxyvo4e50vugbr8":266,"vdnwkwj5ib60d750l60nn3bm26ncl2os":269,"bosufblwq6vcdngm8eqtfqw97qmghu3p":273,"fhvssj5tdiddkkc5typlrl8p61umzh99":277,"n5tijzsuhbg578rml4lm7gjfhpdh3np4":281,"zglxxdx6j9ycgqgz4jjo0dmqj9m4yvkz":284,"y83n2o1pmc51brtdizsooh7slf6sgi2f":287,"wmfiifa08o6y25bwbzo35oznka0ivtc0":290,"te3uh4iyd00lp8cjz4vimirl2zz3oj31":293,"x31y7dprrig780tkls2w261ltwhgh6nq":296,"irm2nm5douc435vrj6124flhqhtgg8kv":302,"90pvk2ear6bw9u55nwkr5ovgwockimqq":306,"ylgtjhngw0ry9xqd1q5moeshh0ecl120":311,"upht7x6bwuw1b5vfx6qzkruzzdmhm7af":314,"ltxyswco8ys58vw66dp9xbr1fatntlco":317,"um4p8fxgdrs19wadx7580ps2zpr645cq":321,"frrkhgsocm1n6xzyawxnsaf8993w2uov":326,"7karsig6xu408rt2y112y3n1xov33upw":329,"p9mbogr6i1unyherbe4xmwnn4rdq2jft":334,"68kpaed7ibpfkwqyqjooxqu5f7urdbyr":338,"s7mfbvc515la9sf01pi4dg3uuyrn6469":341,"29bfcgbr2gqxmwytntlejivgtvvylddv":344,"kqt1r95eh1jrgqefj60esx8rgmpot961":347,"p330m59uzzw6679beu3zy0yvna4nsvwl":350,"l571bdojdi7iu4gmy3k39ka6ff0a88pv":354,"o9d3ywhaofzz4n9w3qtr5p9a85iga2yq":357,"5wv2hj1ulwbdanckevq5i9zbst9kqwqj":361,"r9smvg68wq7mf1wq45f73i6ueqs7in80":364,"jkyw338exwwq51iywoooximdqzyqlho8":367},{"id":231,"type":232,"from":44,"to":66,"properties":233},"xh6zdqrblal8plwkvu16su2e72pstbot","may",{"priority":234,"condition":235},4,"running",{"id":237,"type":232,"from":55,"to":72,"properties":238},"xshmwrkfzz8a90jsebapzzuubspvecd9",{"priority":234,"condition":235},{"id":240,"type":232,"from":60,"to":78,"properties":241},"ducgib4bn4vlf4d96ne5nrs1n8rea7ps",{"priority":234,"condition":242},"arrived",{"id":244,"type":232,"from":90,"to":97,"properties":245},"lfgqpsesmbzzdc20qh31wwkbfrwnblmc",{"priority":234,"condition":246},"answer == \"check\"",{"id":248,"type":232,"from":90,"to":103,"properties":249},"enm67jghv3iv5k85s5sdi5qtk6lmbisz",{"priority":234,"condition":250,"push":251,"as":252},"answer == \"escalate\"","userPrompt","",{"id":254,"type":232,"from":90,"to":109,"properties":255},"mubbk0yqnf373y632ru31iriou5td909",{"priority":234,"condition":256},"answer == \"fail\"",{"id":258,"type":232,"from":109,"to":115,"properties":259},"cdft08vf1shfxccqfs9bc6h3n1jtl1ak",{"priority":234,"condition":242},{"id":261,"type":232,"from":115,"to":121,"properties":262},"nhre6ozrv4v7x34u2o7ex0c4owvhupgl",{"priority":234,"condition":242},{"id":264,"type":232,"from":97,"to":127,"properties":265},"bb378tg96kxs062egqkkr9j5xlqtcd8x",{"priority":234,"condition":242},{"id":267,"type":232,"from":103,"to":133,"properties":268},"ptqhc660tq9qkd0rjvxyvo4e50vugbr8",{"priority":234,"condition":242,"push":251},{"id":270,"type":232,"from":146,"to":50,"properties":271},"vdnwkwj5ib60d750l60nn3bm26ncl2os",{"priority":234,"condition":272},"intents.order",{"id":274,"type":232,"from":146,"to":55,"properties":275},"bosufblwq6vcdngm8eqtfqw97qmghu3p",{"priority":234,"condition":276},"intents.contact",{"id":278,"type":232,"from":146,"to":44,"properties":279},"fhvssj5tdiddkkc5typlrl8p61umzh99",{"priority":234,"condition":280},"intents.other",{"id":282,"type":232,"from":66,"to":163,"properties":283},"n5tijzsuhbg578rml4lm7gjfhpdh3np4",{"priority":234,"condition":242},{"id":285,"type":232,"from":6,"to":174,"properties":286},"zglxxdx6j9ycgqgz4jjo0dmqj9m4yvkz",{"priority":234},{"id":288,"type":232,"from":174,"to":20,"properties":289},"y83n2o1pmc51brtdizsooh7slf6sgi2f",{"priority":234,"condition":242},{"id":291,"type":232,"from":20,"to":180,"properties":292},"wmfiifa08o6y25bwbzo35oznka0ivtc0",{"priority":234,"condition":242},{"id":294,"type":232,"from":180,"to":28,"properties":295},"te3uh4iyd00lp8cjz4vimirl2zz3oj31",{"priority":234,"condition":242},{"id":297,"type":232,"from":28,"to":140,"properties":298},"x31y7dprrig780tkls2w261ltwhgh6nq",{"priority":234,"condition":299,"push":300,"as":301},"sent","value","inputValue",{"id":303,"type":232,"from":140,"to":35,"properties":304},"irm2nm5douc435vrj6124flhqhtgg8kv",{"priority":305,"condition":141,"push":301},6,{"id":307,"type":232,"from":35,"to":146,"properties":308},"90pvk2ear6bw9u55nwkr5ovgwockimqq",{"priority":234,"condition":153,"push":309,"as":310},"answer","intents",{"id":312,"type":232,"from":50,"to":60,"properties":313},"ylgtjhngw0ry9xqd1q5moeshh0ecl120",{"priority":234,"condition":235},{"id":315,"type":232,"from":186,"to":84,"properties":316},"upht7x6bwuw1b5vfx6qzkruzzdmhm7af",{"priority":234,"condition":242},{"id":318,"type":232,"from":84,"to":90,"properties":319},"ltxyswco8ys58vw66dp9xbr1fatntlco",{"priority":234,"condition":299,"push":300,"as":320},"orderNumber",{"id":322,"type":323,"from":121,"to":84,"properties":324},"um4p8fxgdrs19wadx7580ps2zpr645cq","call",{"priority":234,"condition":242,"method":325},"reset",{"id":327,"type":232,"from":127,"to":152,"properties":328},"frrkhgsocm1n6xzyawxnsaf8993w2uov",{"priority":234,"condition":242},{"id":330,"type":232,"from":140,"to":35,"properties":331},"7karsig6xu408rt2y112y3n1xov33upw",{"priority":234,"condition":332,"push":333,"as":301},"caught","caught.userPrompt",{"id":335,"type":232,"from":146,"to":192,"properties":336},"p9mbogr6i1unyherbe4xmwnn4rdq2jft",{"priority":234,"condition":337},"intents.opening",{"id":339,"type":232,"from":192,"to":197,"properties":340},"68kpaed7ibpfkwqyqjooxqu5f7urdbyr",{"priority":234,"condition":235},{"id":342,"type":232,"from":197,"to":203,"properties":343},"s7mfbvc515la9sf01pi4dg3uuyrn6469",{"priority":234,"condition":242},{"id":345,"type":232,"from":72,"to":208,"properties":346},"29bfcgbr2gqxmwytntlejivgtvvylddv",{"priority":234,"condition":242},{"id":348,"type":232,"from":208,"to":158,"properties":349},"kqt1r95eh1jrgqefj60esx8rgmpot961",{"priority":234,"condition":242},{"id":351,"type":232,"from":146,"to":168,"properties":352},"p330m59uzzw6679beu3zy0yvna4nsvwl",{"priority":234,"condition":353},"running == 0 and done > 0",{"id":355,"type":323,"from":168,"to":28,"properties":356},"l571bdojdi7iu4gmy3k39ka6ff0a88pv",{"priority":234,"condition":242,"method":325},{"id":358,"type":232,"from":146,"to":214,"properties":359},"o9d3ywhaofzz4n9w3qtr5p9a85iga2yq",{"priority":234,"condition":360},"intents.wrongProduct",{"id":362,"type":232,"from":214,"to":219,"properties":363},"5wv2hj1ulwbdanckevq5i9zbst9kqwqj",{"priority":234,"condition":235},{"id":365,"type":232,"from":219,"to":225,"properties":366},"r9smvg68wq7mf1wq45f73i6ueqs7in80",{"priority":234,"condition":242},{"id":368,"type":232,"from":78,"to":186,"properties":369},"jkyw338exwwq51iywoooximdqzyqlho8",{"priority":234,"condition":242},1777317254176]