[{"data":1,"prerenderedAt":449,"buildId":450},["ShallowReactive",2],{"\u002Fautomations\u002Fbranching":3,"\u002Fautomations\u002Fbranching-surround":344,"navigation":356},{"id":4,"title":5,"body":6,"description":335,"extension":336,"meta":337,"navigation":338,"path":340,"seo":341,"stem":342,"__hash__":343},"docs\u002F3.automations\u002F05.branching.md","Conditions and branching",{"type":7,"value":8,"toc":325},"minimark",[9,34,38,44,78,154,161,176,179,202,209,213,224,227,237,245,251,255,258,262,296,300,315],[10,11,12,13,17,18,21,22,25,26,29,30,33],"p",{},"A workflow can branch. A ",[14,15,16],"strong",{},"Condition"," step has a ",[14,19,20],{},"True"," and a ",[14,23,24],{},"False"," output, and a ",[14,27,28],{},"Switch"," step has one output per case plus ",[14,31,32],{},"Otherwise",". Only the steps connected to the output that was chosen run; the others are skipped.",[35,36,16],"h2",{"id":37},"condition",[10,39,40,41,43],{},"A Condition checks one or more rules and continues on ",[14,42,20],{}," when they match:",[45,46,47,63],"ul",{},[48,49,50,53,54,58,59,62],"li",{},[14,51,52],{},"Match"," decides whether ",[55,56,57],"em",{},"all rules"," or ",[55,60,61],{},"any rule"," must match.",[48,64,65,66,69,70,73,74,77],{},"Each rule has a ",[14,67,68],{},"Value"," (usually from a step), an ",[14,71,72],{},"Operator",", and for most operators a value to ",[14,75,76],{},"Compare with",".",[79,80,81,94],"table",{},[82,83,84],"thead",{},[85,86,87,91],"tr",{},[88,89,90],"th",{},"Operators",[88,92,93],{},"For",[95,96,97,106,114,122,130,138,146],"tbody",{},[85,98,99,103],{},[100,101,102],"td",{},"equals, doesn't equal",[100,104,105],{},"Any value",[85,107,108,111],{},[100,109,110],{},"contains, doesn't contain, starts with, ends with",[100,112,113],{},"Text and lists",[85,115,116,119],{},[100,117,118],{},"matches the pattern",[100,120,121],{},"Text, with a regular expression (at most 50 ms per match)",[85,123,124,127],{},[100,125,126],{},"is greater than, is at least, is less than, is at most",[100,128,129],{},"Numbers and dates",[85,131,132,135],{},[100,133,134],{},"exists, doesn't exist",[100,136,137],{},"Whether the value is there at all",[85,139,140,143],{},[100,141,142],{},"is empty (null), isn't null",[100,144,145],{},"Whether it has a value",[85,147,148,151],{},[100,149,150],{},"is empty, isn't empty",[100,152,153],{},"Empty text or lists",[10,155,156,157,160],{},"Text comparisons ignore case unless you turn on ",[14,158,159],{},"Case-sensitive"," in the rule. A rule comparing a missing or null value doesn't match.",[10,162,163,164,168,169,58,172,175],{},"The step's ",[165,166,167],"code",{},"result"," output is ",[165,170,171],{},"true",[165,173,174],{},"false",", if a later step needs it.",[35,177,28],{"id":178},"switch",[10,180,181,182,184,185,188,189,192,193,58,196,199,200,77],{},"A Switch compares one ",[14,183,68],{}," against a list of ",[14,186,187],{},"Cases"," in order, and continues on the first case it equals. Each case has an ",[14,190,191],{},"Output"," name (lowercase letters, digits and dashes, such as ",[165,194,195],{},"png",[165,197,198],{},"large",") that becomes an output on the canvas. When nothing matches, the run continues on ",[14,201,32],{},[10,203,204,205,208],{},"Its ",[165,206,207],{},"case"," output holds the name of the output it took.",[35,210,212],{"id":211},"skips-and-joins","Skips and joins",[10,214,215,216,219,220,223],{},"A step runs once ",[14,217,218],{},"all"," the connections leading into it are settled and ",[14,221,222],{},"at least one"," of them was taken. If none were taken, the step is skipped, and so are the steps after it, unless another path still reaches them.",[10,225,226],{},"This makes joins simple. Connect both branches of a Condition to the same step, and it runs exactly once, after whichever branch ran:",[228,229,235],"pre",{"className":230,"code":232,"language":233,"meta":234},[231],"language-text","File received → Condition (wide?) ─True──→ Resize ─┐\n                                 └─False─────────────┴→ Save file\n","text","",[165,236,232],{"__ignoreMap":234},[10,238,239,240,77],{},"Here Save file runs whether or not Resize ran. But Resize's output only exists on the True branch, so Save file can't simply read Resize's content: on the False branch that value is missing. See ",[241,242,244],"a",{"href":243},"\u002Fautomations\u002Fvalues#missing-empty-and-null","Values and templates",[246,247,248],"tip",{},[10,249,250],{},"When both branches need to hand content to the same step, give each branch its own Save file instead of joining them. In an intake workflow, two Save file steps that both save the upload are allowed as long as they're on different branches of the same Condition or Switch.",[35,252,254],{"id":253},"order-of-steps","Order of steps",[10,256,257],{},"A run works on one step at a time. When several steps are ready, it picks them in a fixed order (by how far they are from the trigger, then by step id), so the same workflow always runs its steps in the same order, whatever order you added them in.",[35,259,261],{"id":260},"handling-failures-on-a-branch","Handling failures on a branch",[10,263,264,265,268,269,272,273,276,277,280,281,284,285,288,289,292,293,77],{},"Under a step's ",[14,266,267],{},"Advanced"," settings, ",[14,270,271],{},"If this step fails"," can be set to ",[14,274,275],{},"Take the error path",". The step gets an ",[14,278,279],{},"Error"," output; connect steps to it to handle the failure, for example to tag the file ",[165,282,283],{},"needs-review",". Those steps can read ",[165,286,287],{},"steps.\u003Cid>.error.code"," and ",[165,290,291],{},"steps.\u003Cid>.error.message",". A run that took an error path ends as ",[55,294,295],{},"Completed with errors",[35,297,299],{"id":298},"stopping-early","Stopping early",[10,301,302,303,306,307,310,311,314],{},"The ",[14,304,305],{},"Stop"," step (in ",[14,308,309],{},"Flow",") ends the run where it is and skips everything after it. Give it a ",[14,312,313],{},"Reason"," to see in the run's history.",[316,317,318],"warning",{},[10,319,320,321,324],{},"In an intake workflow, stopping before a Save file step has saved the upload means the upload is never saved. The run fails with ",[165,322,323],{},"primary_not_saved"," and the workflow's failure policy applies, which by default sends the upload to quarantine.",{"title":234,"searchDepth":326,"depth":327,"links":328},2,3,[329,330,331,332,333,334],{"id":37,"depth":326,"text":16},{"id":178,"depth":326,"text":28},{"id":211,"depth":326,"text":212},{"id":253,"depth":326,"text":254},{"id":260,"depth":326,"text":261},{"id":298,"depth":326,"text":299},"Send files down different paths with Condition and Switch, and understand how branches skip and join.","md",{},{"icon":339},"i-lucide-split","\u002Fautomations\u002Fbranching",{"title":5,"description":335},"3.automations\u002F05.branching","sXOOvXOTuieXHbpUaP3K7AT_kqGjgQY1Y_mkMaBEC4g",[345,350],{"title":244,"path":346,"stem":347,"description":348,"icon":349,"children":-1},"\u002Fautomations\u002Fvalues","3.automations\u002F04.values","Fixed values, values from earlier steps, text templates, and what happens when a value is missing.","i-lucide-braces",{"title":351,"path":352,"stem":353,"description":354,"icon":355,"children":-1},"Testing","\u002Fautomations\u002Ftesting","3.automations\u002F06.testing","Run a draft on a real file and see what every step would do, without changing your library.","i-lucide-flask-conical",[357,366,386],{"title":358,"path":359,"stem":360,"children":361,"icon":365},"Getting started","\u002Fgetting-started","1.getting-started\u002F1.index",[362],{"title":363,"path":359,"stem":360,"icon":364},"Introduction","i-lucide-house",false,{"title":367,"icon":365,"path":368,"stem":369,"children":370,"page":365},"Library","\u002Flibrary","2.library",[371,376,381],{"title":372,"path":373,"stem":374,"icon":375},"Fields","\u002Flibrary\u002Ffields","2.library\u002F1.fields","i-lucide-text-cursor-input",{"title":377,"path":378,"stem":379,"icon":380},"Attachments","\u002Flibrary\u002Fattachments","2.library\u002F2.attachments","i-lucide-paperclip",{"title":382,"path":383,"stem":384,"icon":385},"Search","\u002Flibrary\u002Fsearch","2.library\u002F3.search","i-lucide-search",{"title":387,"path":388,"stem":389,"children":390,"icon":365},"Automations","\u002Fautomations","3.automations\u002F01.index",[391,394,399,404,405,406,407,412,417,422,433],{"title":392,"path":388,"stem":389,"icon":393},"Overview","i-lucide-workflow",{"title":395,"path":396,"stem":397,"icon":398},"Your first workflow","\u002Fautomations\u002Ffirst-workflow","3.automations\u002F02.first-workflow","i-lucide-rocket",{"title":400,"path":401,"stem":402,"icon":403},"The editor","\u002Fautomations\u002Feditor","3.automations\u002F03.editor","i-lucide-mouse-pointer-2",{"title":244,"path":346,"stem":347,"icon":349},{"title":5,"path":340,"stem":342,"icon":339},{"title":351,"path":352,"stem":353,"icon":355},{"title":408,"path":409,"stem":410,"icon":411},"Upload intake","\u002Fautomations\u002Fintake","3.automations\u002F07.intake","i-lucide-inbox",{"title":413,"path":414,"stem":415,"icon":416},"Quarantine and failures","\u002Fautomations\u002Fquarantine","3.automations\u002F08.quarantine","i-lucide-shield-alert",{"title":418,"path":419,"stem":420,"icon":421},"Runs and history","\u002Fautomations\u002Fruns","3.automations\u002F09.runs","i-lucide-history",{"title":423,"icon":424,"path":425,"stem":426,"children":427,"page":365},"Guides","i-lucide-book-open","\u002Fautomations\u002Fguides","3.automations\u002F10.guides",[428],{"title":429,"path":430,"stem":431,"icon":432},"Compress and resize uploads","\u002Fautomations\u002Fguides\u002Fcompress-uploads","3.automations\u002F10.guides\u002F1.compress-uploads","i-lucide-file-image",{"title":434,"icon":435,"path":436,"stem":437,"children":438,"page":365},"Reference","i-lucide-library","\u002Fautomations\u002Freference","3.automations\u002F11.reference",[439,444],{"title":440,"path":441,"stem":442,"icon":443},"Step reference","\u002Fautomations\u002Freference\u002Fsteps","3.automations\u002F11.reference\u002F1.steps","i-lucide-blocks",{"title":445,"path":446,"stem":447,"icon":448},"Limits and errors","\u002Fautomations\u002Freference\u002Flimits","3.automations\u002F11.reference\u002F2.limits","i-lucide-gauge",1796147277457,"6b28aab5-1860-4b98-b972-637aef5edbec"]